Jump to content
Sign in to follow this  
anony10

Get process name

Recommended Posts

anony10

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

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
anony10

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 by anony10

Share this post


Link to post
Share on other sites
anony10

then write an example please, because i dont get it

Edited by anony10

Share this post


Link to post
Share on other sites
anony10

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 this

If ProcessExists("Firefox.exe") Then

MsgBox(0,0,"Firefox.exe")

Exit

EndIf

I hope you understand now, what i want to do.

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
anony10

Thank you. Can you write an example please?

Share this post


Link to post
Share on other sites
anony10

Can you start me off somehow then, please? I dont even know, how to start it.

Alright - i did it. Thank you.

Edited by anony10

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×