Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / November 2006

Tip: Looking for answers? Try searching our database.

How to uniquely identify a process?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
01423481d@gmail.com - 22 Nov 2006 06:23 GMT
Hi all

The question is simple:
How can I find out if an executable is running apart from verifying
process name, path, program title etc which does not ensure uniqueness?
I think classid (GUID) could help but I dont know if it is the right
direction and how to achieve this. Any advise is welcomed!

Thanks
01423481d@gmail.com - 22 Nov 2006 07:31 GMT
01423481d@gmail.com 寫道:

> Hi all
>
[quoted text clipped - 5 lines]
>
> Thanks

OK I got it

Process.getType.GUID.toString()
Tom Shelton - 22 Nov 2006 08:09 GMT
> Hi all
>
[quoted text clipped - 5 lines]
>
> Thanks

This is generally done with a mutex.

public sub main
 dim created as bool
 dim instanceCheck as new mutex (true, "MY_UNIQUE_MUTEX_NAME",
created)

 if created then ' we got the mutex
    try
        application.run (new form1())
    finally
         instanceCheck.ReleaseMutex () ' make sure we release this bad
boy
   end try
 else
    ' process already running
    ' i've been known to use WM_COPYDATA to send messages to prev
instances :)
 end if

end sub

HTH,
Tom Shelton

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.