INTELLIGENT WORK FORUMS FOR COMPUTER PROFESSIONALS
Come Join Us!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- Turn Off Ad Banners
- 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.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site

(Download This Button Today!)
Member Feedback
"...Keep up the good work - excellent site - i'd been looking for something like this for ages !..."
Geography
Where in the world do Tek-Tips members come from?
|
Visual Basic(Microsoft) -VB.NET 2002-2008 FAQ
|
How-to
|
Change text on the start button
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):
CODEPrivate 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 2002-2008 FAQ Index
Back to Visual Basic(Microsoft) -VB.NET 2002-2008 Forum
My FAQ Archive
Email This FAQ To A Friend |
|
 |
|