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. Get the x and y pixelsize of the screen?

Get the x and y pixelsize of the screen?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
6 Posts 5 Posters 1 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.
  • A Offline
    A Offline
    anderslundsgard
    wrote on last edited by
    #1

    This is surely an easy q for you but I don’t remember how to do it… How do I get the size of the users screen? _____________________________ ...and justice for all APe

    C M J 3 Replies Last reply
    0
    • A anderslundsgard

      This is surely an easy q for you but I don’t remember how to do it… How do I get the size of the users screen? _____________________________ ...and justice for all APe

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      HDC tmpDC = GetDC(NULL); int xRes = GetDeviceCaps(tmpDC,HORZRES); int yRes = GetDeviceCaps(tmpDC,VERTRES);

      1 Reply Last reply
      0
      • A anderslundsgard

        This is surely an easy q for you but I don’t remember how to do it… How do I get the size of the users screen? _____________________________ ...and justice for all APe

        M Offline
        M Offline
        Murlai
        wrote on last edited by
        #3

        GetClientRect(hWnd, &clientRect);

        V 1 Reply Last reply
        0
        • M Murlai

          GetClientRect(hWnd, &clientRect);

          V Offline
          V Offline
          Vikram Kashyap
          wrote on last edited by
          #4

          ;P Use this one... int cx = GetSystemMetrics(SM_CXSCREEN); // return the width in pixels int cy = GetSystemMetrics(SM_CYSCREEN); // return the height in pixels Vikram Kashyap Sr. Software Engineer TechBooks International R&D Division

          A 1 Reply Last reply
          0
          • A anderslundsgard

            This is surely an easy q for you but I don’t remember how to do it… How do I get the size of the users screen? _____________________________ ...and justice for all APe

            J Offline
            J Offline
            Juan Antonio Bermejo
            wrote on last edited by
            #5

            See the 'GetSystemMetrics' function. You can get de screen metrics among many other parameters of the system

            1 Reply Last reply
            0
            • V Vikram Kashyap

              ;P Use this one... int cx = GetSystemMetrics(SM_CXSCREEN); // return the width in pixels int cy = GetSystemMetrics(SM_CYSCREEN); // return the height in pixels Vikram Kashyap Sr. Software Engineer TechBooks International R&D Division

              A Offline
              A Offline
              anderslundsgard
              wrote on last edited by
              #6

              Tnx - My solution _____________________________ ...and justice for all APe

              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