Here is the code to change the text in the start button:
WARNING! If you set the text to more than 5 characters it will be cut off.Code:Option Strict Off Public Class Form1 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 ChangeStartButtonText(ByVal str As String) Try Dim StartButton As Integer Dim StartButtonText As Integer Dim Caption As String StartButton = FindWindow("Shell_TrayWnd", vbNullString) StartButtonText = FindWindowEx(StartButton, 0&, "button", vbNullString) Caption = Mid(str, 1, 5) SendMessageSTRING(StartButtonText, WM_SETTEXT, 256, Caption) Catch ex As Exception End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ChangeStartButtonText(TextBox1.Text) End Sub End Class
If you like this code please rate it and leave feedback.
Thanks!


Remember to mark the thread as resolved too.
Reply With Quote


