iam5 Posted July 17, 2023 Share Posted July 17, 2023 (edited) I have a goofy problem I can't seem to figure out. I'm using a data recovery program called "Disk Genius" to recover data of a large hard drive. I'm scanning for partitions and this program is really annoying because once it finds one the scan will stop and it asks if I want to save the partition info or not. Well scanning a 14tb drive with TONS of partitions it's found, make it impossible to scan this things since it stops every 45 seconds. So, I was writing a script just to click buttons for me. For some reason, when I try to send ANY input while this window is active, nothing will work. Even if I write a script thats 4 lines, While 1 MouseClick($LeftButtonClick) Sleep(500) WEnd my button will click where ever the pointer is, but the second I bring the Disk Genius window to the front, all input is ignored. On the Disk Genius window, and if I even try to just click a window behind it, nope, ignored. Minimize it, then it clicks all over. I've tried MouseClick, ControlClick, MouseDown, keyboard instead of mouse sendkey("{tab}") everything is ignored. Tried Opt("MouseCoordMode", 2) Opt("MouseCoordMode", 0) using ControlID for the buttons, No ControlID, every single way you could go about sending input and everything is ignored. 100% out of ideas. Anyone ever run into something like this? As I said, I can just have a very basic 4 line script just clicking the mouse button with no regard to any windows, and the second this one comes to front of screen, all input is ignored. Edit: Video https://streamable.com/shxltg Edit: Here is my scratchpad expandcollapse popup;;Click "reserve" for Disk Genius #include <MsgBoxConstants.au3> #include <WinAPISys.au3> #include <AutoItConstants.au3> Opt("MouseCoordMode", 2) Opt("MouseClickDownDelay", 30) diskClick() Func diskClick() $i = 0 While 1 $i = $i + 1 Local $hWnd = WinWait("Partition Found", "") If WinExists($hWnd) Then ConsoleWrite("run: " & $i & " window found." & @CRLF) Sleep(1000) ;MsgBox($MB_SYSTEMMODAL, "", "Window exists") ConsoleWrite("Partion Found Window! " + @CRLF) Sleep(5000) ConsoleWrite("Activating Window." & @CRLF) WinActivate($hWnd) Sleep(5000) MouseMove(167, 254, 20) ConsoleWrite("Click!" & @CRLF) MouseDown($MOUSE_CLICK_LEFT) ; Set the left mouse button state as down. Sleep(100) MouseUp($MOUSE_CLICK_LEFT) ;ControlClick("Partition Found", "", "[CLASS:Button; INSTANCE:2]", "left", 167, 254) ;MouseClick("left", 52, 614, 1) ;Send("{TAB}") ;_WinAPI_Keybd_Event(0x09, $KEYEVENTF_KEYUP) ConsoleWrite("sleep start." & @CRLF) Sleep(5000) ConsoleWrite("sleep end." & @CRLF) ;Send("{ENTER}") ;_WinAPI_Keybd_Event(0x20, $KEYEVENTF_KEYUP) ;Sleep(1000) MsgBox(0, "break", "break") Else ConsoleWrite("waiting..." & @CRLF) MsgBox(0, "break", "break") EndIf WEnd EndFunc Edited July 17, 2023 by iam5 Link to comment Share on other sites More sharing options...
paw Posted July 18, 2023 Share Posted July 18, 2023 Start your script as Administrator, use #RequireAdmin 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