Solved

Showing a process from within a diff app.

Posted on 1997-06-01
2
185 Views
Last Modified: 2010-04-06
I have used delphi and the Win API call CreateProcess to run another program when the user presses a button.  If the user presses the same button and the app is still running, I want it to be brought to the foreground.  How do I do this using the Process-Information data returned from the CreateProcess call (ie: without doing an EnumWindow or other such function)?
0
Comment
Question by:chrisk
[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
2 Comments
 
LVL 1

Accepted Solution

by:
jackb022197 earned 100 total points
ID: 1336733
Is this app you are starting a Win-app developed with Delphi?
If so, get a copy of the freeware JustOne component and drop this on the form of this app and recompile it. Then this all will be done for you...
The source of this freeware component is also available. So, if this first option is no option for you, check this source for further hints to solve your problem.

0
 

Author Comment

by:chrisk
ID: 1336734
Unfortunately, the programs I am running are not my own, so I cannot add the JustOne component to them.  Also, the method JustOne uses to find the previous instance is to do an EnumWindows function and look through all of the windows.  I was looking for a way to bring up the application as I already have a handle to it's process (and a process ID and a thread handle and a thread ID).  There has to be a way to get the handle to the main window from one of these handles/IDs???
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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