Solved

Preventing Multiple Instances of Exe

Posted on 1998-12-17
3
431 Views
Last Modified: 2010-05-18
How can I prevent multiple instances of my application in Delphi 3?
0
Comment
Question by:fh1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 100 total points
ID: 1351706
There's an article about it here: http://www.delumpa.com/tips/apps/apps5.htm
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1351707
hi fh1,

there are components that takes the work foe you

i.e.:

http://www.torry.webnorth.com/vcl/system/gmjustone.zip
http://www.torry.webnorth.com/vcl/system/maininst.zip 
and more ..

meikl
0
 
LVL 1

Expert Comment

by:BlackDeath
ID: 1351708
hi, fh.

just to add some code but url's -

var
 hwnd: Word;
 ...
if hPrevInst = 0 then
  // run your programm
else begin
  // is the window visible?
  hwnd := FindWindow(' (title of your window) ', nil);
  // if not, show it
  if (not IsWindowVisible(hwnd)) then begin
    ShowWindow(hwnd, sw_ShowNormal);
    PostMessage(hwnd, wm_User, 0, 0);
  end
  // else bring to top
  else
    SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE);
end;

bye,

Black Death.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question