|
-
Jun 15th, 2006, 06:00 PM
#1
Thread Starter
Frenzied Member
How to change caption of external windows
Hi all . could any one show me how i can change the caption of external window?Thanks
-
Jun 15th, 2006, 06:08 PM
#2
-
Jun 15th, 2006, 06:11 PM
#3
Thread Starter
Frenzied Member
Re: How to change caption of external windows
 Originally Posted by manavo11
You use the FindWindow API to get the handle of the window you want and then the SetWindowText API to change the text. If you search for these two APIs you'll find more than enough examples 
thank u for reply. I do not want to change the text i mean change caption. Could u show me how ? i have no experince one changing caption of window.
-
Jun 15th, 2006, 06:15 PM
#4
Re: How to change caption of external windows
Open a notepad window and try the following :
VB Code:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Sub Form_Load()
Dim hNotepad As Long
hNotepad = FindWindow("notepad", vbNullString)
SetWindowText hNotepad, "test"
End Sub
Only, instead of using the "notepad" classname, you need to either change the classname to that of the window you want to change or use the caption of the window to find it's handle
Has someone helped you? Then you can Rate their helpful post. 
-
Jun 15th, 2006, 06:19 PM
#5
Thread Starter
Frenzied Member
Re: How to change caption of external windows
Thank u for u reply . It worked perfectly. Is there away to bring a window in front baced on its caption ?Thanks
Last edited by tony007; Jun 15th, 2006 at 06:35 PM.
-
Jun 15th, 2006, 11:42 PM
#6
Re: How to change caption of external windows
VB Code:
AppActivate "Untitled - Notepad"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|