?
Solved

Preventing Multiple Instances of Exe

Posted on 1998-12-17
3
Medium Priority
?
434 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 400 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

777 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