|
From: navi2000 on 4 Jul 2008 12:29 Hi group! I'm writting an application and I need to know when user changes tasks (ALT-TAB, for instance). The application is a full screen DirectDraw app. I need to know when the user activates the application and when the user changes to other application. First I've tried to capture WM_SETFOCUS and WM_KILLFOCUS messages, but windows is sending these messages a lot of times, not only when really is changing the focus. Do you know any way to do it easily? Thanks
From: Kellie Fitton on 4 Jul 2008 15:40 On Jul 4, 9:29 am, navi2000 <ivan.ga...(a)gmail.com> wrote: > Hi group! > > I'm writting an application and I need to know when user changes tasks > (ALT-TAB, for instance). The application is a full screen DirectDraw > app. > I need to know when the user activates the application and when the > user changes to other application. > First I've tried to capture WM_SETFOCUS and WM_KILLFOCUS messages, but > windows is sending these messages a lot of times, not only when really > is changing the focus. > > Do you know any way to do it easily? > Thanks Hi, Since the video mode have changed with task switching Alt+Tab, you need to call Restore() on each of your surfaces, including front buffer, back buffers and in-memory surfaces. Most of the DirectDraw video game samples handles the following Windows messages to restore all surfaces upon task switching: WM_ACTIVATEAPP WM_ACTIVATE http://msdn2.microsoft.com/en-us/library/ms632614.aspx http://msdn.microsoft.com/en-us/library/ms646274(VS.85).aspx Kellie.
|
Pages: 1 Prev: Time measurement problem during task switching Next: Colored Edit control |