Solved

How do I activate one process from another?

Posted on 1998-05-08
3
201 Views
Last Modified: 2013-12-03
I've got two applications (a master and a slave) written in MSVC++ 5.0 running under NT 4.0.  I've used CreateProcess to launch the slave from the master and now I'm trying to activate the slave from the master.  I've tried using a custom message that uses SetActiveWindow to activate the slave process' main window, but that crashed and burned the slave process.  i've also tried:

   WPARAM iParam = WA_ACTIVE;
   PostThreadMessage( tProcInfo.dwThreadId, WM_ACTIVATE,
                      iParam, 0 );

from the master, but that did nothing. tProcInfo.dwThreadId is the id of the main thread of the slave.

thanks
SeanSP
0
Comment
Question by:SeanPS
  • 3
3 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 1400161
answer coming
0
 
LVL 22

Expert Comment

by:nietod
ID: 1400162
SetActiveWindow() works to activate a window within your proccess only.  Instead use SetForegroundWindow() to activate the thread the owns the window and bring it to the front.

Note SetActiveWindow() should not have caused a crash.  You may have a bug somewhere in the slave program that it revealed.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1400163
Let me know if this does not work.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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