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. Obtaining screen dimensions

Obtaining screen dimensions

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
6 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.
  • G Offline
    G Offline
    gokings
    wrote on last edited by
    #1

    Can anyone tell me how to obtain the screen dimensions in an MFC app? Thanks

    4 V R 3 Replies Last reply
    0
    • G gokings

      Can anyone tell me how to obtain the screen dimensions in an MFC app? Thanks

      4 Offline
      4 Offline
      4apai
      wrote on last edited by
      #2

      it doesnt seems to be mfc. but its simply call api functions: GetSystemMetrics(SM_CXSCREEN); GetSystemMetrics(SM_CYSCREEN);

      G 1 Reply Last reply
      0
      • G gokings

        Can anyone tell me how to obtain the screen dimensions in an MFC app? Thanks

        V Offline
        V Offline
        V 0
        wrote on last edited by
        #3

        Get SystemMetrics will do the trick, if you'd like to substract the taskbar of other toolbars => use SystemParametersInfo. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

        G 1 Reply Last reply
        0
        • V V 0

          Get SystemMetrics will do the trick, if you'd like to substract the taskbar of other toolbars => use SystemParametersInfo. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

          G Offline
          G Offline
          gokings
          wrote on last edited by
          #4

          Awesome, thanks!

          1 Reply Last reply
          0
          • 4 4apai

            it doesnt seems to be mfc. but its simply call api functions: GetSystemMetrics(SM_CXSCREEN); GetSystemMetrics(SM_CYSCREEN);

            G Offline
            G Offline
            gokings
            wrote on last edited by
            #5

            Awesome, thanks!

            1 Reply Last reply
            0
            • G gokings

              Can anyone tell me how to obtain the screen dimensions in an MFC app? Thanks

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #6

              CWnd::GetDesktopWindow()->GetWindowRect (...); Although this will return the same screen size regardless of the presence of app bars. You probably want the size of the workspace. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

              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