anony10 Posted May 26, 2012 Share Posted May 26, 2012 Hi. How could i do this: If i run an .exe file, then my program open an msgbox with the process's name in it (i mean, i open mozilla firefox msgbox pop ups, and writes firefox.exe in it). I dont want to do ProcessExists with every single .exe file in the world, because i want to see my own programs names as well. So, i want it something like this: I open mozilla firefox, an msgbox pop ups, and writes firefox.exe in it. And so on, with everything else like that. I want to do it just with .exe files. I already tried _ProcessGetName, it does anything else, it's not that what i want. really really sorry for my english, and for my grammar. thank you Link to comment Share on other sites More sharing options...
JohnOne Posted May 26, 2012 Share Posted May 26, 2012 I already tried _ProcessGetName, it does anything else, it's not that what i want.I think you should explain why that does not works It works just fine.Explain by posing your coding attempts. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
anony10 Posted May 26, 2012 Author Share Posted May 26, 2012 (edited) Because i have to wait until the window comes "active". I dont want this, I just run it, it doesnt have to come active, and it pops up an msgbox with the .exe name in it. WinWaitActive("[CLASS:Notepad]", "") $pid = WinGetProcess("[CLASS:Notepad]", "") $name = _ProcessGetName($pid) you have to write the window's name first. its like doing processexists with all the exe files.thats why its not good for me now Edited May 26, 2012 by anony10 Link to comment Share on other sites More sharing options...
JohnOne Posted May 26, 2012 Share Posted May 26, 2012 If you want to wait for a window to become active or not, that's your business.But _ProcessGetName() works nonetheless.It's your code that is failing you. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
anony10 Posted May 26, 2012 Author Share Posted May 26, 2012 (edited) then write an example please, because i dont get it Edited May 26, 2012 by anony10 Link to comment Share on other sites More sharing options...
JohnOne Posted May 26, 2012 Share Posted May 26, 2012 I don;t really know what you need if it's not that. Is this what you want? While 1 If ProcessExists("Firefox.exe") Then MsgBox(0,0,"Firefox.exe") Exit EndIf Sleep(100) WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
anony10 Posted May 26, 2012 Author Share Posted May 26, 2012 Okay. So, lets say there is one .exe file on somebodys computer, and we dont know its name.We want to do this: If the stranger opens the .exe file (we dont know its name!), then an msgbox pops up, and writes the .exe files name in it. Like the code that you wrote, but i want to avoid to write all the words, programs name, etc. So i want to watch every .exe file in the world, without writing them in sections like thisIf ProcessExists("Firefox.exe") Then MsgBox(0,0,"Firefox.exe") ExitEndIfI hope you understand now, what i want to do. Link to comment Share on other sites More sharing options...
JohnOne Posted May 26, 2012 Share Posted May 26, 2012 Take a look at processlist() With that you can get a list of all the current running processes. You can then put the same function in a loop, and check in another loop if any other processes are started apart from them already running, and show a msgbox. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
anony10 Posted May 26, 2012 Author Share Posted May 26, 2012 Thank you. Can you write an example please? Link to comment Share on other sites More sharing options...
JohnOne Posted May 26, 2012 Share Posted May 26, 2012 No. An example of that is a full working script. You can do the work for something you need, if you get stuck, people will help. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
anony10 Posted May 26, 2012 Author Share Posted May 26, 2012 (edited) Can you start me off somehow then, please? I dont even know, how to start it. Alright - i did it. Thank you. Edited May 26, 2012 by anony10 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