Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Preventing Multiple Instances of Exe

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

Industry Leaders: 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

609 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