| View previous topic :: View next topic |
| Author |
Message |
Qbi
Joined: 17 Feb 2005 Posts: 12
|
Posted: Tue Feb 22, 2005 2:35 pm Post subject: Searching for pixels in a windows client area |
|
|
Hello!
I actually write a AHK script to measure the performance of an application. The script simulates user input and measures the times between the mouse click and the display of the results for several actions.
To do so I wanted to watch some single pixels and wait for them to change color to determine whether the results are displayed.
The problem is that in windows the user is able to change the size of the title bar of a window. So adressing the pixels with the CoordMode "relative" doesn't work because the zero point is not on top left of the window's client area but on the top left on the window's titlebar.
My question: Is it possible to adress pixels relative to a window's client area?
I'd prefer a solution without having to read the display settings from the registry.
cuQ |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Tue Feb 22, 2005 3:22 pm Post subject: |
|
|
does the distance b/w the start of window and start of client area remain same? _________________
 |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Tue Feb 22, 2005 3:42 pm Post subject: |
|
|
and by the way, what abt ControlGetPos? ... the client area must be a control?! _________________
 |
|
| Back to top |
|
 |
Qbi
Joined: 17 Feb 2005 Posts: 12
|
Posted: Tue Feb 22, 2005 5:00 pm Post subject: |
|
|
Hey Rajat,
the distance remains the same but may be different from user to user.
The suggestion with the control is probably the solution! The application I measure is web based (frontend is internet explorer) and the Window Spy told me that the client area is called "Internet Explorer_Server1".
As soon as I'm back at work I will try it.
Thanks a lot!
cuQ |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Feb 23, 2005 7:21 am Post subject: |
|
|
Great workaround.
I've added "CoordMode, ToolTip|Pixel|Mouse, Client" to the to-do list for a future version. |
|
| Back to top |
|
 |
Qbi
Joined: 17 Feb 2005 Posts: 12
|
Posted: Wed Feb 23, 2005 1:33 pm Post subject: |
|
|
I definitely love AHK and Chris's work!!!!!
Using AHK I save a big amount of time previously used for stupid manual actions. Compiled AHKs in combination with windows' task planner or bound to hotkeys do a lot of time consuming work for me now!
Example:
I made a little script which copies xml error messages out of a log file, eliminates nasty linefeeds (that are produced by our server) and pass the cleaned error messages directly into XML Spy where they're checked for schema conformance.
Previously I had to copy the error messages manually into a text editor where I killed the linefeeds with search&replace functions, save the text as xml file and open it manually with XML Spy.
Since there are no really good freeware editors with macro features, AHK is now the solution with maximum flexibility for me.
AHK is 100% perfect for me - but would be 120% if I could also do some eye candy with it (rembember translucent pngs?)
cuQ |
|
| Back to top |
|
 |
|