|
-
September 20th, 1999, 02:41 PM
#1
detecting Windows(or its name) in VB and use it in other program
Is it possible to write a VB program that detects the name of a window and use it to interact with that window(finding captions or clicking buttons)?
What API functions should I use?
-
September 20th, 1999, 03:47 PM
#2
Re: detecting Windows(or its name) in VB and use it in other program
Try this:
Declare Function FindWindow& Lib "user32" Alias "FindWindowA" (byval lpClassName as string, byval lpWindowName as string)
It will return you a handle of window. As a parameters you can use either Caption of window or Window Class. Window Class of particular window you can find using Spy++ wich comes with VB (with Enterprise edition for sure). Example of finding MS Word:
lngHandle = FindWindow("OpusApp", vbNullString)
Example when you know Caption:
lngHandle = = FindWindow(vbNullString,"MyWindow")
HTH
Vlad
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
|