Meisi Posted April 8, 2010 Share Posted April 8, 2010 Hi there! I'm new to this forum, but I've allready written some AutoIt-Code before. Now I've written a new Script that would work perfectly if there wasn't that "small" problem: I start a programm in window-mode. I found some code before to write customised functions. Thus Send and MouseClick works perfectly in that window. Even if it's minimized. My Problem is that I want my Script to search for a specific color in that window. After a specified Sleep-time the Script should check for that color with PixelSearch, but everytime i check the Coordinates in the window and write that down in the Script, the script uses the wohle display to search for that specified color in that area. Is there any way to check that specified area with PixelSearch - or with another command - in that window only? The window is active, but something won't work. I don't know how I could check that window only... Can anybody help me please? I would be very pleased! I tried to get rid of that problem with: $checkcolor1 = PixelSearch( 634, 552, 641, 560, 0x000058, 0, 1, WinGetHandle("Programme")) If (@error=0) Then .... .... but smthg won't work. Any hints!? Please! Link to comment Share on other sites More sharing options...
ShawnW Posted April 8, 2010 Share Posted April 8, 2010 (edited) Ok are you saying the rectangle you give to PixelSearch is going off absolute screen coords, and you want it to be based on coords inside the window? If so just use WinGetPos(). It returns x,y,width,height of a window in an array. Use that info to change your rectangle of pixels in PixelSearch(). This will cause it to search that window only. Edited April 8, 2010 by ShawnW Link to comment Share on other sites More sharing options...
JohnOne Posted April 8, 2010 Share Posted April 8, 2010 Have a read up on PixelCoordMode Option. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
ShawnW Posted April 8, 2010 Share Posted April 8, 2010 (edited) Have a read up on PixelCoordMode Option.Yeah i must be blind my 1st response before i edited it was MouseCoordMode then I read again and saw he wanted to change the pixel function not how he got his mouse coords. I looked through the AutoItSetOption page and totally skipped right over PixelCoordMode. Edited April 8, 2010 by ShawnW Link to comment Share on other sites More sharing options...
Meisi Posted April 8, 2010 Author Share Posted April 8, 2010 Thanks a lot for your fast replies!! I will try it out right now Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now