No announcement yet.

Detect name(s) of running processes in WinNT

  • Filter
  • Time
  • Show
Clear All
new posts

  • William Fletcher
    Guest replied
    Works like a charm - thanks Semen!


    Leave a comment:

  • Semen Matusovski

    ps. but if you want to prevent double start, there is much simple way - createmutex
    #compile exe
    #dim all
    #register none
    #include ""
    function pbmain()
       local hmutex as long, hdlg as long, prgname as asciiz * %max_path
       prgname = "any unique name" ' important
       hmutex = createmutex(byval %null, 0, prgname): _
          if hmutex = 0 then exit function ' error in mutex
       if getlasterror = %error_already_exists then _
          msgbox "already running": exit function
       dialog new hdlg, "first instance", , , 100, 100, %ws_sysmenu to hdlg
       dialog show modal hdlg
       closehandle hmutex ' possible to delete
    end function
    [this message has been edited by semen matusovski (edited december 13, 2000).]

    Leave a comment:

  • William Fletcher
    Guest started a topic Detect name(s) of running processes in WinNT

    Detect name(s) of running processes in WinNT

    Can someone give me a tip how to list the 'process-image names'
    running on an NT workstation? (i.e. in Task Mgr - the
    'Processes' tab)

    I need to be able to detect whether an instance of my program
    is already running. It monitors the system in a time-delayed
    loop and has *no* dialog, hence it has *no* App Title to search
    for (!).

    Many TIA.

    William Fletcher