JonF Posted October 30, 2024 Posted October 30, 2024 (edited) I'm trying to read a pixel from the screen of a particular program. It always comes out black (0x000000). One should be white, the other should be blue. Is there some aspect of this program that prevents reading a pixel? #include <GetScreen.au3> Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc Run("C:\Program Files (x86)\YT Saver\ytsaverw.exe",@TempDir,@SW_MAXIMIZE) Opt("WinTitleMatchMode", 2) _WinWaitActivate("YT Saver","") $Handle = WinGetHandle("YT Saver") Sleep(5000) $aWin = WinGetPos($Handle) $Width = $aWin[2] $Height = $aWin[3] _GetScreen_Initialize($Width, $Height) _GetScreen_GetWindow($Handle) $Color = _GetScreen_GetPixel(350,200) $Color2 = _GetScreen_GetPixel(110,90) WinClose($Handle) $Color=Hex($Color,6) $Color2=Hex($Color2,6) MsgBox(0,"Info",$Color & " " & $Color2 & @CRLF & $Width & " " & $Height) Test.mp4 Edited October 30, 2024 by JonF
Solution Nine Posted October 30, 2024 Author Solution Posted October 30, 2024 (edited) Yes, like previously discussed in this topic, some windows do not support WM_PRINT or WM_PRINTCLIENT messages. You may try _GetScreen_GetWindow with flag set at 2. But since you are activating the window, I strongly suggest that you use _GetScreen_GetScreen instead. Edited October 30, 2024 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
JonF Posted October 31, 2024 Posted October 31, 2024 Oooh, GetScreen worked. I don't remember why I chose Get Window. Thank you!
BinaryBrother Posted January 22 Posted January 22 (edited) Example 2 did this to my Scite. Is that expected? I can't interacts with it, I'll have to kill the process. Thank God I save what I'm working on often. X) Running latest AutoIt on Win11 24H2 x64. Edited January 22 by BinaryBrother SIGNATURE_0X800007D NOT FOUND
Nine Posted January 22 Author Posted January 22 (edited) <removed> Edited January 23 by Nine Misunderstood your post “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
BinaryBrother Posted January 23 Posted January 23 (edited) Huh?... I doubt you're going to get anywhere with that report, because I'm being serious. I've been here for over 18 years. I'm running a triple-monitor setup, so that's what I figured the issue was. Read the rest of my threads and you'll see that I don't aggravate people. I'm here to learn, build, and occasionally help others. I was just curious, ran your script from ScITE on my 3rd monitor, and my ScITE moved to my middle monitor with no body and I was unable to interact with it. Edited January 23 by BinaryBrother SIGNATURE_0X800007D NOT FOUND
Nine Posted January 23 Author Posted January 23 Well I don't know what to tell you. I thought you were making some inappropriate trolling joke. Seems that the WinMove did something wrong in your setup. I do not have multiple monitors and I am still using Win10. In any case, I am (of course) unable to replicate the issue and can hardly help you out. Try running Scite from the first monitor (not maximized), see if that helps. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
BinaryBrother Posted January 23 Posted January 23 (edited) Win11 24H2 X64 - On Primary monitor not maximized. It was maximized on my far right (3rd) monitor when I ran it last time. *shrug*. P.S. I'm not sticking with those ScITE colors, I messed it up. X) 0x0000000000050B80 1 = F0F4F9 = 1295139178 2 = F0F4F9 = -72188319 3 = F0F4F9 = 1364808461 4 = F0F4F9 = -1620914717 5 = F0F4F9 = 1364808461 6 = F0F4F9 = -2078673808 7 = F0F4F9 = -1620914717 8 = F0F4F9 = 1364808461 9 = F0F4F9 = 1364808461 10 = F0CB86 = 1364808461 11 = F0F4F9 = 1364808461 12 = F7832E = 1364808461 13 = FE83CF = 1364808461 14 = F0F4F9 = 1364808461 15 = F0F4F9 = 1364808461 16 = F0F4F9 = 1364808461 17 = FAF4F9 = 1364808461 18 = F0F4F9 = 1364808461 19 = F0F4F9 = 1364808461 20 = F0F4F9 = 1364808461 Edited January 23 by BinaryBrother Added Details SIGNATURE_0X800007D NOT FOUND
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