Board index » Visual Studio » SetFocus problem.
|
kubalister
|
SetFocus problem.
Visual Studio160
My application has a hidden main display window that is never used. The application hangs out in the system tray and has a couple of configuration windows that can be opened from the system tray menu. The program has a couple of odd-ball fatal error scenarios. When these happen, the program displays a fatal error message using AfxMessageBox and it shuts down normal processing. This includes stopping the system menu so that the config windows can't be opened. Here's the problem: If the AfxMessageBox window is covered by some other program, I want the action of right clicking my system tray icon to pop the AfxMessageBox window to the top of the display priority so that the operator can see it. Is there a way to tell the AfxMessageBox to come to the top? My main program window is hidden and not used. I thought maybe setting focus to that window would somehow cause the AfxMessageBox window to pop up. It doesn't work. Specifically I tried: ((CMainFrame *)AfxGetMainWnd())->SetFocus(); Any ideas? - |
