INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How-to

Change text on the start button by PsychoCoder
Posted: 26 Jan 07

Below is a simple procedure for changing the text on the Windows Start Button. Now I'm not sure why you would want to do this, unless say you're creating an application in multiple languages and want to change the text to that language (though I imagine most who use a different language have the Local set to theirs):

CODE

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
            (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer
    Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer

    Private Const WM_SETTEXT = &HC
    Private Const WM_GETTEXT = &HD

        

Public Sub SetStartCaption(ByVal str As String)
   Try
     Dim StartBar As Integer
     Dim StartBarText As Integer
     Dim sCaption As String
     StartBar = FindWindow("Shell_TrayWnd", vbNullString)
     StartBarText = FindWindowEx(StartBar, 0&, "button", vbNullString)
     sCaption = Mid(str, 1, 5)
     SendMessageSTRING(StartBarText, WM_SETTEXT, 256, sCaption)
   Catch ex As Exception
   End Try
End Sub

Keep in mind that this wont change it forever, or even for a period of time you specify as every so often Windows frees memory and redraws the UI, thus reverting to the original start button text.

Enjoy

Back to Visual Basic (Microsoft) VB.NET FAQ Index
Back to Visual Basic (Microsoft) VB.NET Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close