Solved

How do I activate one process from another?

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save copy of document in Word 4 89
C# Performance testing with Visual Studio Profession 2015 2 39
Slow process to read Excel 15 139
VS2015 Redefinition errors 4 73
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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