Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Detecting Resolution Change?

Detecting Resolution Change?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dov Sherman
    wrote on last edited by
    #1

    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?

    S M 2 Replies Last reply
    0
    • D Dov Sherman

      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?

      S Offline
      S Offline
      satadru
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • D Dov Sherman

        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?

        M Offline
        M Offline
        Michael P Butler
        wrote on last edited by
        #3

        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)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups