Change Caption

‘get handle top-level window
Private Declare Function FindWindow Lib “user32” alias “FindWindowA” (ByVal lpClassName as String, byVal lpWindowName as string) as long

‘sent message to window
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

‘constanta set text window
Private Const WM_SETTEXT= &HC

Private Sub cmdSet_Click()
Dim lTargetHandle as long
Dim strTarget as string
Dim strNewCaption as string


‘find target (window)
If lTargetHandle=0 then
msgbox (“Target Not Found”)
Exit Sub
End if

‘set caption target
SendMessage lTargetHandle, WM_SETTEXT, 0, byVal strNewCaption
End Sub


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s