Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I activate one process from another?

Posted on 1998-05-08
3
Medium Priority
?
210 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 300 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

618 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