Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are numerous Windows API functions you can use to do this. I'd start with looking at <a href="http://msdn.microsoft.com/en-us/library/ms682629%28v=vs.85%29.aspx" rel="nofollow noreferrer"><code>EnumProcesses</code></a> (<a href="http://allapi.mentalis.org/apilist/EnumProcesses.shtml" rel="nofollow noreferrer">VB6 example and declaration here</a>) which can be used to gather information about all running processes. You can also use <a href="http://msdn.microsoft.com/en-us/library/ms684320%28v=vs.85%29.aspx" rel="nofollow noreferrer"><code>OpenProcess</code></a> to start interrogating Windows about a particular process (<a href="http://allapi.mentalis.org/apilist/OpenProcess.shtml" rel="nofollow noreferrer">another VB6 example</a>).</p> <p>There is also a <a href="http://support.microsoft.com/kb/187913" rel="nofollow noreferrer">fairly nice example on MSDN</a>.</p> <p>And of course, there is <a href="http://msdn.microsoft.com/en-us/library/ms682425%28v=vs.85%29.aspx" rel="nofollow noreferrer"><code>CreateProcess</code></a> (<a href="http://allapi.mentalis.org/apilist/CreateProcess.shtml" rel="nofollow noreferrer">AllApi link</a>) or <a href="http://msdn.microsoft.com/en-us/library/bb762153%28v=VS.85%29.aspx" rel="nofollow noreferrer"><code>ShellExecute</code></a> (<a href="http://allapi.mentalis.org/apilist/ShellExecute.shtml" rel="nofollow noreferrer">AllApi</a>) for spawning processes - the former gives you more control over the creation of the process, while the latter is a much simpler call.</p> <p><a href="https://stackoverflow.com/questions/318334/monitoring-processes-to-see-if-theyve-crashed-in-vb6">There was another question posted about this a while back with some example code.</a></p> <p>Another possible approach would be to use <a href="http://msdn.microsoft.com/en-us/library/aa394582%28v=VS.85%29.aspx" rel="nofollow noreferrer">WMI</a> (<a href="http://msdn.microsoft.com/en-us/library/aa394599%28v=vs.85%29.aspx" rel="nofollow noreferrer">some useful snippets to adapt</a>).</p> <p>Finally, here are some tutorials that show you how to do it (I'd recommend trying it yourself first though :):</p> <ul> <li><a href="http://www.vbaccelerator.com/home/Vb/Tips/Getting_Process_Information_Using_PSAPI/article.asp" rel="nofollow noreferrer">Getting Process Information using PSAPI</a></li> <li><a href="http://memoryhacking.com/forums/viewtopic.php?f=2&amp;t=6037" rel="nofollow noreferrer">Another EnumProcesses/OpenProcess implementation</a></li> <li><a href="http://www.vbforums.com/showthread.php?t=347552" rel="nofollow noreferrer">WMI-based demonstration</a></li> </ul> <p>Here are some related questions although you probably already saw them when you searched this site before posting:</p> <ul> <li><a href="https://stackoverflow.com/questions/318334/monitoring-processes-to-see-if-theyve-crashed-in-vb6">Monitoring processes to see if they've crashed in vb6</a></li> <li><a href="https://stackoverflow.com/questions/292098/vb-6-how-can-i-execute-a-bat-file-but-wait-until-its-done-running-before-moving">How can I execute a .bat file but wait until its done running before moving on?</a></li> <li><a href="https://stackoverflow.com/questions/318334/monitoring-processes-to-see-if-theyve-crashed-in-vb6">How To Enumerate Processes From VB 6 on Win 2003?</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload