user45 Posted June 2, 2016 Share Posted June 2, 2016 Hi, I am trying to call a .exe application using the WinGetHandle( ) and assign it to variable $h: $h = WinGetHandle( "myapp.exe") or, $h = WinGetHandle("myapp") the application is installed inside c:\program files but the WinGetHandle seems not working. However notepad works. Can anybody help me in this? thanks!! Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2016 Developers Share Posted June 2, 2016 define what you mean with "call a .exe"? Is the programma already running and the Window existing? If so, What is the exact Window title? Look at the helpfile on how these Functions and parameters should be used. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
user45 Posted June 2, 2016 Author Share Posted June 2, 2016 I mean any .exe application is not working- firefox.exe, nitro.exe, MineSweeper.exe and so on. the title are firefox, nitro, minesweeper etc. I have read that wingethandle can match titles and the title i gave should be ok. notepad is working as I have already said. I have looked into the helpfile, couldn't get it done and therefore I am asking here. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2016 Developers Share Posted June 2, 2016 Well you seem to contradict yourself there. WinGetHandle() gets the Handle of a WINDOW, not a program file name! So look for the correct Window Title and use that in the parameter as described in the Helpfile. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
user45 Posted June 2, 2016 Author Share Posted June 2, 2016 I tested with https://www.autoitscript.com/autoit3/docs/intro/au3spy.htm tool. the title is correct. I know that WinGetHandle() gets the Handle of a WINDOW and not a program file name! Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2016 Developers Share Posted June 2, 2016 (edited) Ok, then show us a real life example that is giving you issues, so we can see what is going on. Jos Edited June 2, 2016 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
user45 Posted June 2, 2016 Author Share Posted June 2, 2016 here is the code: #include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <GuiMenu.au3> Run("Minesweeper") WinWait("Minesweeper") $h = WinGetHandle("Minesweeper") Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2016 Developers Share Posted June 2, 2016 I can't test with that as minesweeper.exe isn't part of Win10 anymore. any other example? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
user45 Posted June 2, 2016 Author Share Posted June 2, 2016 NewZip - WinZip Pro, firefox anything with correct title should work with the above code right? or there might be some issue with windows 7 and WinGetHandle() Link to comment Share on other sites More sharing options...
Developers Jos Posted June 2, 2016 Developers Share Posted June 2, 2016 Yes, but your code isn't really telling me what issue you have.... so what is the problem when running the code you have shown? Does it hang or what else? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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