Re: How to activate another application?
- From: David Lowndes <davidl@xxxxxxxxxxxxxxx>
- Date: Tue, 12 Jul 2005 17:37:56 +0100
>I am not a C++ expert and I want to activate another application from my C++
>code (doesn't matter if it is Windows SDK or MFC). First I successfully find
>the handle to the window. For example using hwnd->SendMessage(WM_CLOSE,0,0)
>closes the app I want to activate. But I have tried to use WM_ACTIVATE and
>WM_SETFOCUS to bring this app to the foreground, but it did not seem to have
>any effect. Does anyone have a working code for activating another
>application?
Miroslaw,
If your application is the active foreground window, you can call
SetForegroundWindow to activate the other application. See the
platform SDK documentation on SetForegroundWindow for the restrictions
the OS imposes to prevent focus snatching.
Dave
.
- References:
- How to activate another application?
- From: MPA
- How to activate another application?
- Prev by Date: Re: Compile error with AfxBeginThread?
- Next by Date: Re: Please straighten this c++/mfc newbie out
- Previous by thread: Re: How to activate another application?
- Next by thread: Compile error with AfxBeginThread?
- Index(es):
Relevant Pages
|