Solved

How do I activate one process from another?

Posted on 1998-05-08
3
205 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
[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
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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