drewdavis Posted August 15 Share Posted August 15 I've looked but can't find the code to produce a "left mouse click" if no instance of a Chrome browser is open on my PC. That is, if I open a Chrome browser, and then it gets closed somehow, I want the code to notice this and the do a "left mouse click". Can anyone provide me with those few lines Link to comment Share on other sites More sharing options...
ioa747 Posted August 15 Share Posted August 15 Local $hWnd = WinGetHandle("[CLASS:Chrome_WidgetWin_1]") If $hWnd Then ConsoleWrite("$hWnd=" & $hWnd & @CRLF) While WinExists($hWnd) Sleep(100) WEnd ConsoleWrite("Chrome Win is closed" & @CRLF) Local $iMClick = MouseClick("left") ConsoleWrite("$iMClick=" & $iMClick & @CRLF) Else ConsoleWrite("Chrome Win not found" & @CRLF) EndIf to forum I know that I know nothing Link to comment Share on other sites More sharing options...
Nine Posted August 15 Share Posted August 15 @ioa747 There could be multiple instances of Chrome. In your code, you only check one handle. @drewdavis Out of curiosity, what would be the purpose of the 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...
ioa747 Posted August 15 Share Posted August 15 6 hours ago, Nine said: There could be multiple instances of Chrome. In your code, you only check one handle I agree, but here, since it's not specified, and what we're interested is, if Chrome is open, I think it's sufficient and the op can take a step further Nine 1 I know that I know nothing 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