Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Wait for process to end

Posted on 2004-09-16
8
Medium Priority
?
178 Views
Last Modified: 2010-05-02
Give the hwnd of a window can someone supply me with the code to wait for it to end processing?

Thanks,
0
Comment
Question by:ampapa
8 Comments
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 240 total points
ID: 12080048
0
 
LVL 13

Assisted Solution

by:Michael_D
Michael_D earned 240 total points
ID: 12080053
0
 
LVL 8

Author Comment

by:ampapa
ID: 12080587
emoreau, WSH is out as a solution. Thanks.

Michael, this process is already running so the second part of the suggested answer won't work and the first part doesn't seem to. Even though the process stopped process or was hidden, the event never fired.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 7

Accepted Solution

by:
_agj_ earned 280 total points
ID: 12081899
use this:
http://www.mvps.org/access/api/api0004.htm

the only change u need to make to the code is to take off the section running the exe and jus do a:

ret& = WaitForSingleObject(proc.hProcess, INFINITE)
0
 
LVL 8

Author Comment

by:ampapa
ID: 12083153
A couple of questions.

The 'proc' in "WaitForSingleObject(proc.hProcess, INFINITE)" is a HWND? to the process that was started with the shell application is that correct? So they are getting the HWND using 'SHELL', the process that I am using is already running so do I need to identify the HWND and PID of it and then supply it to the 'WaitForSingleObject' function ?
0
 
LVL 3

Assisted Solution

by:aParser
aParser earned 240 total points
ID: 12084410
Karl Peterson's site has a sample with three solutions to shell and wait.
http://www.mvps.org/vb/

Click "Samples" from the menu and then scroll down to the item listed as Shell32.zip
0
 
LVL 8

Author Comment

by:ampapa
ID: 12085528
This process has not been 'shelled' but is currently a running process. So, essentially I want to be able to wait for a process to end given a HWND and or PID.

Thanks,
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

963 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