Detecting Resolution Change?
-
I'm working on an MDI application using MFC in VC6.0. The application should run in Win98 or higher. I need my application to notice and respond if the user changes their desktop display settings, changing the resolution or bit depth. I tried WM_DEVMODECHANGE but that seems to something different. I looked for WM_DISPLAYCHANGE but I couldn't find a way to add that using the wizards. How do I get my MDI to receive notification of display changes?
-
I'm working on an MDI application using MFC in VC6.0. The application should run in Win98 or higher. I need my application to notice and respond if the user changes their desktop display settings, changing the resolution or bit depth. I tried WM_DEVMODECHANGE but that seems to something different. I looked for WM_DISPLAYCHANGE but I couldn't find a way to add that using the wizards. How do I get my MDI to receive notification of display changes?
Sometimes the user might move the dialog box around screen till it is partly outside the desktop. And you might want to bring the dialog box back into full view. There might also be a a situation where you did the development on a higher resolution and on your machine it comes up nice and full, but the final user might be using a lower screen resolution and thus part of the dialog will be out of the screen. Again you'd really want to make sure the dialog box is fully visible. Well, believe it or not, this can be accomplished with just one line of code. SendMessage(DM_REPOSITION); Smooth eh? Remember that this message only works for top level dialog boxes and will not work for child dialogs. u can also check for GetSystemmetrix
-
I'm working on an MDI application using MFC in VC6.0. The application should run in Win98 or higher. I need my application to notice and respond if the user changes their desktop display settings, changing the resolution or bit depth. I tried WM_DEVMODECHANGE but that seems to something different. I looked for WM_DISPLAYCHANGE but I couldn't find a way to add that using the wizards. How do I get my MDI to receive notification of display changes?
Dov Sherman wrote: I looked for WM_DISPLAYCHANGE but I couldn't find a way to add that using the wizards. The class wizard only handles a subset of the WM_ windows messages. For ones like WM_DISPLAYCHANGE you'll have to add the code by hand. Add into your message map ON_MESSAGE(WM_DISPLAYCHANGE, OnDisplayChange) And then add a function to the class LRESULT OnDisplayChange(WPARAM wParam, LPARAM lParam) { // Do processing of WM_DISPLAYCHANGE here return 1; } Michael Snow is lying on the ground, and in the air the sleigh bells sound, The frosted patterned window panes, it's British summer time again. No, it's not, It's Christmas - Santa Claus in on the Dole (Spitting Image 1986)