Solved

Showing a process from within a diff app.

Posted on 1997-06-01
2
184 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 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