Solved

How do I activate one process from another?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now