tags:

views:

264

answers:

1
+1  A: 

When another application is made active, your window receives the WM_ACTIVATE notification (wParam set to WA_INACTIVE).

When your application is made active again, your window will receive the WM_ACTIVATE notification again, this time with wParam set to WA_ACTIVE or WA_CLICKACTIVE

Since you're not using the dialog manager, you may need to set focus to the edit control yourself when you're activated.

If in doubt, use Spy++ on a dialog window, and watch the message traffic when the app is deactivated and then activated again.*

Scott Smith
If it was a dialog would it focus back automatically?
Lars Kanto
I'm not certain, but I think so. It's easy enough to check out; just bring up a regular dialog in some app, and switch away and back using Alt+Tab (as opposed to the mouse).
Scott Smith