For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > April 2006 > Find Process ID from Process Name









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Find Process ID from Process Name
Andibevan

2006-04-26, 6:56 pm

If all I have is the process name, i.e. winword or msaccess, how can I find
out the process ID?

I only need to use this for MS Office products so there should be little
chance for 2 instances to be running.

I have been searching through various API sites but can't find the right
combination of functions.


Ken Halter

2006-04-26, 6:56 pm

"Andibevan" <andibevan@notherehotmail.com> wrote in message
news:uvBDbwUaGHA.3304@TK2MSFTNGP04.phx.gbl...
> If all I have is the process name, i.e. winword or msaccess, how can I
> find
> out the process ID?
>
> I only need to use this for MS Office products so there should be little
> chance for 2 instances to be running.
>
> I have been searching through various API sites but can't find the right
> combination of functions.


I have no idea if this'll run in VBA but.....

Enumerate all Currently Running Processes
http://www.thescarms.com/vbasic/RunningProcs.asp

....there are more where that came from <g>

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm


Andibevan

2006-04-26, 6:56 pm


"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:O7TsW9UaGHA.4544@TK2MSFTNGP02.phx.gbl...
> "Andibevan" <andibevan@notherehotmail.com> wrote in message
> news:uvBDbwUaGHA.3304@TK2MSFTNGP04.phx.gbl...
>
> I have no idea if this'll run in VBA but.....
>
> Enumerate all Currently Running Processes
> http://www.thescarms.com/vbasic/RunningProcs.asp
>
> ...there are more where that came from <g>
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
>
>


Worked a treat - thanks


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com