AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Searching for pixels in a windows client area

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Qbi



Joined: 17 Feb 2005
Posts: 12

PostPosted: Tue Feb 22, 2005 2:35 pm    Post subject: Searching for pixels in a windows client area Reply with quote

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
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Tue Feb 22, 2005 3:22 pm    Post subject: Reply with quote

does the distance b/w the start of window and start of client area remain same?
_________________
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1718

PostPosted: Tue Feb 22, 2005 3:42 pm    Post subject: Reply with quote

and by the way, what abt ControlGetPos? ... the client area must be a control?!
_________________
Back to top
View user's profile Send private message
Qbi



Joined: 17 Feb 2005
Posts: 12

PostPosted: Tue Feb 22, 2005 5:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Feb 23, 2005 7:21 am    Post subject: Reply with quote

Great workaround.

I've added "CoordMode, ToolTip|Pixel|Mouse, Client" to the to-do list for a future version.
Back to top
View user's profile Send private message Send e-mail
Qbi



Joined: 17 Feb 2005
Posts: 12

PostPosted: Wed Feb 23, 2005 1:33 pm    Post subject: Reply with quote

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?) Wink

cuQ
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group