|
-
Jul 2nd, 2007, 04:14 PM
#1
Thread Starter
Hyperactive Member
Twips, pixels, and conversion between them
I use the following code to move the mouse at one selected spot (20000, 20000) on the screen.
Code:
mouse_event MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, 20000, 20000, 0, 0
If I click the mouse at THAT spot, the Form_MouseDown returns the following coords: x=351, y=237 (There are in PIXELS, I believe). (see EDIT)
I want to know how I can convert 351,237 back to 20000, 20000.. I don't think that mouse_event coords (20000,20000) are in twips (351 * 15 != 20000, but 5265).
I'm sure that's a quite easy one.. Thanks for helping me out.
Edit: I started using the GetCursorPos API to get the X,Y coords in pixels - x=351,y=263 would be more like it. Extra pixels in the Y coord because the form_mousedown would calculate only the visible form, EXCLUDING the title bar. In my case, I need the title bar included... MOUSEEVENTF_MOVE with coords 1000 and 1000 will bring the mouse over the title bar, and that's something I may need to do.
Last edited by Krass; Jul 2nd, 2007 at 04:27 PM.
Chris
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
|