Royale Posted February 20, 2016 Posted February 20, 2016 Hello, Im new to AutoIT so i hope this is not a stupid question, I am an Administrator/Technician (not a developer) so I hope this is not a stupid question. Ive been trying to get PixelChecksum to take a Window Handle which is listed as an option in the function reference, but it never seems to work and seems to keep taking the check sum for the entire desktop. Following is an example of what I've tried to do. $hWnd = WinGetHandle("Untitled") $checksum = PixelChecksum(0, 28, 50, 78, 1, $hWnd) consolewrite ("$hWnd & " " & Checksum is " & $checksum & @CRLF) Am i passing the windows handle in correctly, or getting the wrong handle? Im on Windows 8.1 Pro 64 bit with AutoIT 3.3.14.2 Thanks, Martin
AutoBert Posted February 20, 2016 Posted February 20, 2016 You can test: $hWnd = WinGetHandle("Untitled") $checksum = PixelChecksum(0, 28, 50, 78, 1, $hWnd) consolewrite ($hWnd & " Error:" & @error&@TAB&"Checksum is " & $checksum & @CRLF) please post Console output.
Royale Posted February 21, 2016 Author Posted February 21, 2016 Hi AutoBert, This is what i get back: 0x000805CC Error:0 Checksum is 1744610305 >Exit code: 0 Time: 0.0869 I'm thinking maybe the option doesn't work anymore, although I'm surprised i can't find any queries about it assuming i've understood the syntax correctly.
AutoBert Posted February 21, 2016 Posted February 21, 2016 You got a valid Hwnd, no error and the checksum.
Moderators Melba23 Posted February 21, 2016 Moderators Posted February 21, 2016 Royale, From my testing it does indeed look as if the handle parameter is being ignored and the DeskTop is used for every call. I have only ever used the PixelCheckSum function with screen coordinates so I cannot offer any comment as to whether it has ever worked on a window level. I suggest you open a Trac ticket so it can be investigated. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Iamaldrin08 Posted February 21, 2016 Posted February 21, 2016 I thought i got the code wrong for using handle with pixel search, it also doesn't work for me.
Moderators Melba23 Posted February 21, 2016 Moderators Posted February 21, 2016 Iamaldrin08, We are discussing PixelCheckSum, not PixelSearch. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
AutoBert Posted February 21, 2016 Posted February 21, 2016 The console ouput for: ; Close the Notepad window using the handle returned by WinWait. WinClose($hWnd) ; Now a screen will pop up and ask to save the changes, the classname of the window is called ; "#32770" and simulating the "TAB" key to move to the second button in which the "ENTER" is simulated to not "save the file" WinWaitActive("[CLASS:#32770]") Sleep(500) Send("{TAB}{ENTER}") tells me PixelChecksum is working, 3 different checksums: Checksum Desktop is 3737190578 Checksum NotePad is 246544381 Checksum just edited NotePad is 1366642386
Moderators Melba23 Posted February 21, 2016 Moderators Posted February 21, 2016 AutoBert, I agree that the function works, but when I try to use a window handle I do not get the same result if I move the window around the screen - but I do get the same result if I leave the desktop area unchanged. Hence my belief that there is a problem. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Royale Posted February 22, 2016 Author Posted February 22, 2016 On 2/21/2016 at 9:56 PM, Iamaldrin08 said: I thought i got the code wrong for using handle with pixel search, it also doesn't work for me. Actually i just tried to get it to work with PixelSearch and it seems to be doing the same thing and just taking the whole desktop. Thanks everyone for your replies. It was driving me crazy trying to get it to work but its not really worth taking up more of your time, im only trying to perfect the automation of a bunch of startup programs and its not that big a deal.
Moderators Melba23 Posted February 22, 2016 Moderators Posted February 22, 2016 (edited) Royale, I will open a Trac ticket for the problem. M23 Edit: And done: https://www.autoitscript.com/trac/autoit/ticket/3211#ticket Edited February 22, 2016 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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