Qeuep Posted July 17, 2018 Share Posted July 17, 2018 Hi everyone, this is driving me craaaazy ! So, MouseClick works perfectly fine when I use it on desktop BUT when I open another program, the mouse just doesn't move ! Here is my code : ShellExecute("MYPROGRAM") WinWaitActive("MYPROGRAM") WinActivate("MYPROGRAM") Opt("MouseCoordMode", 2) --> I've tried relative coords, absolute, everything... MouseClick("left", 320, 139, 1, 10) --> Same thing, tried all coords with Window Info, nothing moves... Help is welcome ! PS : Even tried Controlclick, not working... Link to comment Share on other sites More sharing options...
AutoBert Posted July 17, 2018 Share Posted July 17, 2018 (edited) 35 minutes ago, Qeuep said: BUT when I open another program, the mouse just doesn't move ! Not every program allows automation, what's the program name and what is your intention. Edit: are you sure the window is found and script is not waiting for it (WinWaitActive)? Try this: Opt("MouseCoordMode", 2) Local $sName = "notepad.exe" Local $sWinTitle = "Unbenannt - Editor" ;change to your language $pid = ShellExecute($sName) MsgBox(0, "Started", "The PID is " & $pid, 2) Local $i = 0 Do $hWND = WinWaitActive($sWinTitle, "", 1) ;waiting one second $i = $i + 1 Until $hWND Or $i > 60 ;1 minute waited If $hWND Then MouseClick("left", 320, 139, 1, 10) ;--> Same thing, tried all coords with Window Info, nothing moves... Else MsgBox(0, $sWinTitle, "not activated") EndIf Edited July 17, 2018 by AutoBert Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 GPUz, I want to automatically save all the BIOSes of my GPUs, and put them in a folder. Link to comment Share on other sites More sharing options...
Bert Posted July 17, 2018 Share Posted July 17, 2018 Don't use MouseClick. Use ControlClick. That way the window doesn't need focus to let you activate the control you want. aa2zz6 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 17, 2018 Share Posted July 17, 2018 @Qeuep Are you sure that GPUz doesn't have command line options? Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 I tried, but it looks incredibly difficult... I can program in C, but never did any AU3 before. Anyway, this is what I get in Window Info when I click on the button I need : >>>> Window <<<< Title: TechPowerUp GPU-Z 2.9.0 Class: #32770 Position: 552, 134 Size: 428, 514 Style: 0x94CE0044 ExStyle: 0x00050100 Handle: 0x0004184E >>>> Control <<<< Class: Button Instance: 5 ClassnameNN: Button5 Name: Advanced (Class): [CLASS:Button; INSTANCE:5] ID: 1019 Text: Position: 311, 129 Size: 24, 18 ControlClick Coords: 12, 8 Style: 0x5001004B ExStyle: 0x00000004 Handle: 0x001F0860 >>>> Mouse <<<< Position: 323, 137 Cursor ID: 0 Color: 0xF0F0F0 This is what I tried : ControlClick("TechPowerUp GPU-Z 2.9.0", "", "[CLASS:Button; INSTANCE:5]") Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 41 minutes ago, AutoBert said: Not every program allows automation, what's the program name and what is your intention. Edit: are you sure the window is found and script is not waiting for it (WinWaitActive)? Try this: Opt("MouseCoordMode", 2) Local $sName = "notepad.exe" Local $sWinTitle = "Unbenannt - Editor" ;change to your language $pid = ShellExecute($sName) MsgBox(0, "Started", "The PID is " & $pid, 2) Local $i = 0 Do $hWND = WinWaitActive($sWinTitle, "", 1) ;waiting one second $i = $i + 1 Until $hWND Or $i > 60 ;1 minute waited If $hWND Then MouseClick("left", 320, 139, 1, 10) ;--> Same thing, tried all coords with Window Info, nothing moves... Else MsgBox(0, $sWinTitle, "not activated") EndIf Having the exact same problem :/ Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 9 minutes ago, FrancescoDiMuro said: @Qeuep Are you sure that GPUz doesn't have command line options? Best Regards. No, I don't think so... I have already checked Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 17, 2018 Share Posted July 17, 2018 @Qeuep Are you sure? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 1 hour ago, FrancescoDiMuro said: @Qeuep Are you sure? Well, you cannot do it that way, it doesn't give you the BIOS. I need a .rom format. (Or perhaps I'm missing something) Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 17, 2018 Share Posted July 17, 2018 2 hours ago, Qeuep said: This is what I tried : ControlClick("TechPowerUp GPU-Z 2.9.0", "", "[CLASS:Button; INSTANCE:5]") Can you show me the exact button are you trying to press? Attach an image here Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 10 minutes ago, FrancescoDiMuro said: Can you show me the exact button are you trying to press? Attach an image here Here you go. I also need a loop to do it on several Gpus, but that's another problem (less complicated I think :P) Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 17, 2018 Share Posted July 17, 2018 Are you sure that this doesn't be a solution? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 No, unfortunately... Actually, my program is very long. And it requires the stock .rom of each gpu (which are amd btw) I use another tool to flash and modify the BIOS. Link to comment Share on other sites More sharing options...
Qeuep Posted July 17, 2018 Author Share Posted July 17, 2018 But there must certainly exist a way to simulate a mouse click on that damn button... Link to comment Share on other sites More sharing options...
mala Posted November 13, 2018 Share Posted November 13, 2018 I am having the same exact problem. When I comment out any commands like WinWaitActive or WinActivate then it works fine. If I add any of those two commands it stops working. I know the MouseMove and MouseClick (I am using coordinates for that latter too just for testing) are being executed because they return 1. Also, I have a ConsoleWrite statement after the mouseclick event and that prints. Here is my code. #include <AutoItConstants.au3> Opt("WinTitleMatchMode", 2) $pos = WinGetPos("[MyProgram]") ConsoleWrite($pos[0]) ConsoleWrite($pos[1]) ;WinWaitActive("[MyProgram]") WinActivate("[MyProgram]") Sleep(1000) ConsoleWrite(MouseMove($pos[0]+290, $pos[1]+290)) ConsoleWrite(MouseClick($MOUSE_CLICK_LEFT, $pos[0]+290, $pos[1]+290)) ConsoleWrite('clicked') Link to comment Share on other sites More sharing options...
pablitko Posted September 18, 2020 Share Posted September 18, 2020 Please try to open your script as a Administrator. 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