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. Detect screen resolution change

Detect screen resolution change

Scheduled Pinned Locked Moved C / C++ / MFC
5 Posts 4 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.
  • M Offline
    M Offline
    manchukuo
    wrote on last edited by
    #1

    Hi! I need to detect screen resolution change cause i am working in a toolbar that docks in the borders of the screen. Thanks

    enhzflepE L M 3 Replies Last reply
    0
    • M manchukuo

      Hi! I need to detect screen resolution change cause i am working in a toolbar that docks in the borders of the screen. Thanks

      enhzflepE Offline
      enhzflepE Offline
      enhzflep
      wrote on last edited by
      #2

      Easy peasy. Handle the WM_DISPLAYCHANGE message. Nnnnext!

      L 1 Reply Last reply
      0
      • M manchukuo

        Hi! I need to detect screen resolution change cause i am working in a toolbar that docks in the borders of the screen. Thanks

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        If you us the GetSystemMetrics Function[^]int x = GetSystemMetrics(SM_CXSCREEN); int y = GetSystemMetrics(SM_CYSCREEN);
        On a multi-monitor system you can use SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN. You could also use the GetDeviceCaps Function[^]int x = GetDeviceCaps(hDC, HORZRES); int y = GetDeviceCaps(hDC, VERTRES);
        Best Wishes, -David Delaune

        1 Reply Last reply
        0
        • enhzflepE enhzflep

          Easy peasy. Handle the WM_DISPLAYCHANGE message. Nnnnext!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Thats what I get for answering a post before my first morning cup of coffee. I didnt even realize that was what he was asking. :doh: Best Wishes, -David Delaune

          1 Reply Last reply
          0
          • M manchukuo

            Hi! I need to detect screen resolution change cause i am working in a toolbar that docks in the borders of the screen. Thanks

            M Offline
            M Offline
            molesworth
            wrote on last edited by
            #5

            There's a system event which should be what you're looking for documented here.[^]

            There are three kinds of people in the world - those who can count and those who can't...

            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