ttt480 Posted April 25, 2019 Share Posted April 25, 2019 Hello, friends. Tell me how to script autoit to recognize the flashing in the window. That is, periodically in window 1.exe flashes at a constant frequency. Flashing is a frequent and abrupt change of color for 3 seconds. Link to comment Share on other sites More sharing options...
Nine Posted April 25, 2019 Share Posted April 25, 2019 Look at _WinAPI_RegisterShellHookWindow () example, but use this message instead $HSHELL_FLASH “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 Link to comment Share on other sites More sharing options...
ttt480 Posted April 25, 2019 Author Share Posted April 25, 2019 Nine, I only found this link by _WinAPI_RegisterShellHookWindow() : https://www.autoitscript.com/trac/autoit/ticket/2910 What to do next ? Where to add $HSHELL_FLASH ? Link to comment Share on other sites More sharing options...
Nine Posted April 25, 2019 Share Posted April 25, 2019 Use the example here. Replace the message $HSHELL_REDRAW by $HSHELL_FLASH. You are done... “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 Link to comment Share on other sites More sharing options...
ttt480 Posted April 25, 2019 Author Share Posted April 25, 2019 Nine, I cannot run this script. Writes "#include <WinAPISysWin.au3> Error opening the file". expandcollapse popup#include <APISysConstants.au3> #include <WinAPISysWin.au3> Opt('TrayAutoPause', 0) OnAutoItExitRegister('OnAutoItExit') Global $g_hForm = GUICreate('') GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), 'WM_SHELLHOOK') _WinAPI_RegisterShellHookWindow($g_hForm) While 1 Sleep(1000) WEnd Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg Switch $hWnd Case $g_hForm Local $sTitle = WinGetTitle($lParam) Switch $wParam Case $HSHELL_FLASH If IsString($sTitle) Then ConsoleWrite('Redrawn: ' & $sTitle & @CRLF) EndIf Case Else If BitAND($wParam, $HSHELL_WINDOWACTIVATED) = $HSHELL_WINDOWACTIVATED And IsString($sTitle) Then ConsoleWrite('Activated: ' & $sTitle & @CRLF) EndIf EndSwitch EndSwitch EndFunc ;==>WM_SHELLHOOK Func OnAutoItExit() _WinAPI_DeregisterShellHookWindow($g_hForm) EndFunc ;==>OnAutoItExit Link to comment Share on other sites More sharing options...
Nine Posted April 25, 2019 Share Posted April 25, 2019 It is working fine on my comp. Make sure you got the most recent version of autoit, fully installed with the autoit installer. Look in the include folder for that specific file. It is quite a basic script. “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 Link to comment Share on other sites More sharing options...
ttt480 Posted April 25, 2019 Author Share Posted April 25, 2019 Nine, Please explain how this script recognizes the flash in the window ? Does it somehow track the color change of the window pixels ? Link to comment Share on other sites More sharing options...
Nine Posted April 25, 2019 Share Posted April 25, 2019 Nope, it is a message sent. You need to change your paradigms about detecting pixels or color changes (that will not work at all). Whenever there is an action to be performed, most of those actions are sent through notification (or message if you prefer). In this case, the script intercepts the request for the form (or window handle if you prefer) to flash. Then instead of checking whatever change in color, you can perform your usual tasks and wait the desired window to flash. You must read about messages and notifications to fully understand how it is working, but in the mean time, just use the code I gave you, modify it to your needs, and work your way up. “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 Link to comment Share on other sites More sharing options...
ttt480 Posted April 25, 2019 Author Share Posted April 25, 2019 Nine, What notifications are we talking about ? I asked about the reaction of the script autoit, the appearance of flashing in the window. No messages appear in the window, only at a certain moment the window is flashing. And I asked how to react to this moment. Link to comment Share on other sites More sharing options...
ttt480 Posted April 25, 2019 Author Share Posted April 25, 2019 (edited) Nine, Here is an example of flashing: <snip> Edited April 25, 2019 by JLogan3o13 Link to comment Share on other sites More sharing options...
Nine Posted April 25, 2019 Share Posted April 25, 2019 Sorry, I can't help you no more. Maybe someone else will try, but I won't. Your youtube is useless and stupid. And I am tired of all this. “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 Link to comment Share on other sites More sharing options...
ComradVlad Posted April 25, 2019 Share Posted April 25, 2019 (edited) Hes talking about messages that components send to each other to perform specific actions. There is no actual message saying "this action is being performed" that is displayed to the user. That being said if you are looking to the script visually detect flashing in a window it is technically possible assuming the flashing is always done in a specific color. For example if one portion of the window is red, but when it flashes it becomes a brighter shade of red you can use PixelGetColor to detect the color change. It would look something like this: while PixelGetColor ( x , y [, hwnd] ) <> $colorOfFlashingPixel sleep(100) wend Msgbox(0,"Alert","Window is flashing!") You can use autoit window info to get the color, But once again this assumes that the flashing color you are looking for is always the same and in the same location (or you can determine the location every time). Edited April 25, 2019 by ComradVlad Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 25, 2019 Moderators Share Posted April 25, 2019 @ttt480 other than your seizure inducing video (which I removed for its stupidity) you have yet to explain precisely what you are attempting to do. What application are you working with (window 1.exe doesn't cut it) and what causes the window to "flash at a constant frequency". More detail and fewer vague responses will help us help you. ===In case you missed it, this is a Mod stepping into a thread=== "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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