Hey,
I would like to know how to only allowing one instance of a program to run at once. Ie: You can't run the application multiple times creating multiple processes. I only want to allow one instance of that application to be running at any given time.
BradenMurphy
0
Light Poster
Recommended Answers
Jump to PostUse a mutex:
MutexUt.pas: (Change 'LeatherPDF' to your application name)
unit MutexUt; interface uses Windows, Messages, SysUtils, Variants, Classes, Forms; function IsPrevInst: Boolean; procedure CheckPrevInstEx(MainFormClassName, MainFormCaption : String); implementation {---------------------------------------------} function IsPrevInst: Boolean; var semName, appClass: PChar; hSem : THandle; hWndMe : HWnd; appTitle: Array[0..MAX_PATH] of …
All 4 Replies
sknake
1,622
Senior Poster
Featured Poster
BradenMurphy
0
Light Poster
sknake
1,622
Senior Poster
Featured Poster
mediastar
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.