Who had focus. Any high level suggestion would be helpful.
-
I want to create an app that runs in the background most of the time. On rare occasions I want to display a modeless dialog for a short amount of time and then dismiss the dialog. This all seems easy enough to do. I would like some advice on how to place the focus back on the app or control that had focus before my dialog interrupted it. Any high level suggestion would be helpful. Thank you. PMCGAHAN@UCSWORKS.COM
-
I want to create an app that runs in the background most of the time. On rare occasions I want to display a modeless dialog for a short amount of time and then dismiss the dialog. This all seems easy enough to do. I would like some advice on how to place the focus back on the app or control that had focus before my dialog interrupted it. Any high level suggestion would be helpful. Thank you. PMCGAHAN@UCSWORKS.COM
If you haven't switched to any other windows, then it'll happen automatically when the dialog box is closed. That's the way Windows works and I advice that you let it work that way. If you want to override that behavior then before showing the dialog box, get the handle of the foreground window (using GetForegroundWindow) and then restore it when the dialog closes (SetForegroundWindow). Cheers! Alvaro