|
-
Oct 24th, 2001, 08:52 PM
#1
Thread Starter
Frenzied Member
Get X-Y position of a control????
I bet this is a tough question!
How can I get the X / Y coordinates of a control in a program so I can capture only that part? I have the class name and the handle and I need to capture only that part of the screen. The control can be in a different position of the program depending how the user has it setup because it is in Outlook Express.
Is there an API call I can do to get this?
Anyone have any suggestions?
Thanks!
-
Oct 25th, 2001, 07:36 AM
#2
Frenzied Member
You can use this API:
Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long
· hWnd
Identifies the window.
· lpRect
Points to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window.
-
Oct 25th, 2001, 08:07 AM
#3
Thread Starter
Frenzied Member
-
Oct 25th, 2001, 02:42 PM
#4
If you want to capture the points of a child window, you would either need to use GetClientRect, or if the control actually has a separate client section, then you need to convert the coordinates (from GetWindowRect) to the client coordinates by using the ScreenToClient function.
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
|