|
-
Feb 7th, 2002, 07:56 AM
#1
Thread Starter
Member
Object Picker like Spy++???
I know there is an API call "WindowFromPoint" that returns the handle of a WINDOW based on coordinates.
(see sample here: http://www.mvps.org/vb/code/WndPick.zip
But does anyone know of an API call that allows you to identify objects (such as a form, frame, radio button, and windows)?
I've seen this done with software like "PowerPad", "Rational Visual Test", "Snag It"... can this be done in VB?
-
Feb 7th, 2002, 08:42 AM
#2
Frenzied Member
Once you have the window handle you can get all this additional information using the windows API. There are a number of calls, all of which are wrapped up in this ApiWindow class.
To use it:
VB Code:
Dim wndTest As New ApiWindow
wndTest.hwnd = WindowFromPoint(ptThis)
Debug.print wndTest.WNDCLASS.lpszClassname 'eg. ThunderList is a VB listbox etc...
Debug.Print wndTest.WindowText 'if its a textbox this is the text , etc...
There are a whole raft of other properties - which you would like to know about?
HTH,
Duncan
-
Feb 7th, 2002, 09:20 AM
#3
Bishop, GetClassName API could be used to find out the class name of each window/object.
-
Feb 7th, 2002, 12:53 PM
#4
Thread Starter
Member
Thanks for the feedback guys.. but you're actually two steps in my project ahead of me... ^_^
Now I know I can use what you have recommended to get the rest of the information I need...
But what if I want to get the handle of a button, or frame, or text field instead of the window? Is there anyway to point at a control and ask it to give me the handle for that instead?
-
Feb 7th, 2002, 01:05 PM
#5
Thread Starter
Member
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
|