lvv Posted May 1, 2008 Share Posted May 1, 2008 Hi there, I want to catch some changes on the window using PixelChecksum. But it always return 0. Is there anything wrong with this code: Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") Dim $pos = WinGetPos("Untitled - Notepad") $checksum = PixelChecksum($pos[0],$pos[1], 50,50) MsgBox(0, "", $pos[0] & " " & $pos[1] & " " & $checksum) Thanks Link to comment Share on other sites More sharing options...
Valuater Posted May 1, 2008 Share Posted May 1, 2008 Maybe... Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client Run("notepad.exe") WinWaitActive("Untitled - Notepad") $checksum = PixelChecksum(0,0, 50,50) Send("This is some text.") Sleep(200) If $checksum <> PixelChecksum(0,0, 50,50) Then MsgBox(0, "Yes", $checksum) Else MsgBox(0, "No", $checksum) EndIf **** TESTED 8) Link to comment Share on other sites More sharing options...
lvv Posted May 1, 2008 Author Share Posted May 1, 2008 Thanks a lot! Link to comment Share on other sites More sharing options...
lvv Posted May 1, 2008 Author Share Posted May 1, 2008 Still got some problem: Here is my code, I want to install office 2007. (the last page has same handle, title, no text) So I want to use PixelChecksum to see the if there is sth changed . The result is that PixelChecksum always return 0. ; after select components, click install. Send("!i") Sleep(1000*60*10) Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client If( Not WinActive("Microsoft Office Professional Plus 2007")) Then WinActivate("Microsoft Office Professional Plus 2007") EndIf $file = FileOpen("c:\test.txt", 1) $checksum = PixelChecksum(275,175,50,50) FileWriteLine($file,$checksum) While ($checksum == PixelChecksum(275,175,50,50)) FileWriteLine($file, PixelChecksum(275,175,50,50)) Sleep(5000) WEnd FileWriteLine($file , "End") ;WinWaitActive("Microsoft Office Professional Plus 2007","has been successfully installed") Sleep(200) Send("!c") 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