VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Change Start Button Text

by steve0 (1 Submission)
Category: Windows API Call/Explanation
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Example of FindWindowEx and SendMessage

Rate Change Start Button Text

Option 
Explicit

'

Private Declare Function FindWindowEx Lib "user32" 
Alias "FindWindowExA" ( _

          
                                       
          
ByVal hWnd1 As Long, _

          
                                       
          
ByVal hWnd2 As Long, _

          
                                       
          
ByVal lpsz1 As String, _

          
                                       
          
ByVal lpsz2 As String _

          
                                       
          
As Long

                                        
'

Private Declare Function SendMessage Lib "user32" 
Alias "SendMessageA" ( _

          
                                       
ByVal hwnd As Long, _

          
                                       
ByVal wMsg As Long, _

          
                                       
ByVal wParam As Long,
_

          
                                       
          
lParam As Any _

          
                                       
          
) As Long

                                        
'

Const WM_SETTEXT As Long = &HC

'

Public Sub ChangeSB(sNewText As String)

     
  '

      Dim hWnd_ As 
Long

      '

     
  hWnd_ = FindWindowEx(0&, 0&, "Shell_TrayWnd", 
vbNullString)

    '

     
  If (hWnd_ > 0) Then

          
   '

          
   hWnd_ = 
FindWindowEx(hWnd_, 0&, "Button", vbNullString)

          
   '

           If (hWnd_ > 
0) Then

    
           
    
'

    
           
    
SendMessage hWnd_, WM_SETTEXT, 0&, ByVal sNewText

    
           
    
'

           End If

          
   '

      End If

     
  '

End Sub

Download this snippet    Add to My Saved Code

Change Start Button Text Comments

No comments have been posted about Change Start Button Text. Why not be the first to post a comment about Change Start Button Text.

Post your comment

Subject:
Message:
0/1000 characters