KurogamineNox Posted June 17, 2010 Share Posted June 17, 2010 How would I be able to get PixelSearch() to Search for a pixel based on a window. Say you have multiple windows and you only want it to search within say the web browser and not the entire screen? Link to comment Share on other sites More sharing options...
BitByteBit Posted June 17, 2010 Share Posted June 17, 2010 Get the position and size of the window you want to search using WinGetPos, using the values returned from this you can figure out where to search. ShellExecute(@WindowsDir & "\Notepad.exe") WinWait("Untitled - Notepad") WinActivate("Untitled - Notepad") $PositionAndSize = WinGetPos("Untitled - Notepad") If IsArray($PositionAndSize) Then $Result = PixelSearch($PositionAndSize[0], $PositionAndSize[1], $PositionAndSize[0] + $PositionAndSize[2], $PositionAndSize[1] + $PositionAndSize[3], 0x5A5E59) EndIf If IsArray($Result) Then MouseMove($Result[0], $Result[1]) #cs [0] = X [1] = Y [2] = Width [3] = Height #CE Link to comment Share on other sites More sharing options...
JohnOne Posted June 17, 2010 Share Posted June 17, 2010 I think you can just use the handle of the window in the last parameter of the call. Not 100% though as I dont really use the pixel functions. 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...
KurogamineNox Posted June 18, 2010 Author Share Posted June 18, 2010 Thanks guys, I think both ways would work, using handle or getting the position, ill just figure out what is easier though I haven't worked with handle's of windows so Ill figure out something. This will at least get me started. Maybe someone could give me and example handle? 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