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
2010-02-09 23:34:01