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. How get net screen size?

How get net screen size?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 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.
  • I Offline
    I Offline
    IlanTal
    wrote on last edited by
    #1

    I've got an application which I want to fit into the y dimension of the screen. The function: cyMon = ::GetSystemMetrics( SM_CYSCREEN); gives me the screen dimension, but I want the net dimension not including the task bar, if the task bar isn't being auto-hidden. I see that if I hit the maximize button, the system is clever enough to take into consideration whether or not the task bar is displayed. If I could somehow get the system to tell me what its maximize size it, that would give me the answer. The GetSystemMetrics gives me the same answer, with and without the task bar. Does anyone know the appropriate call? Thanks, Ilan

    R stefanmihaimogaS A 3 Replies Last reply
    0
    • I IlanTal

      I've got an application which I want to fit into the y dimension of the screen. The function: cyMon = ::GetSystemMetrics( SM_CYSCREEN); gives me the screen dimension, but I want the net dimension not including the task bar, if the task bar isn't being auto-hidden. I see that if I hit the maximize button, the system is clever enough to take into consideration whether or not the task bar is displayed. If I could somehow get the system to tell me what its maximize size it, that would give me the answer. The GetSystemMetrics gives me the same answer, with and without the task bar. Does anyone know the appropriate call? Thanks, Ilan

      R Offline
      R Offline
      rod naR
      wrote on last edited by
      #2

      RECT rcWorkArea; SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, NULL)); http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp[^]

      1 Reply Last reply
      0
      • I IlanTal

        I've got an application which I want to fit into the y dimension of the screen. The function: cyMon = ::GetSystemMetrics( SM_CYSCREEN); gives me the screen dimension, but I want the net dimension not including the task bar, if the task bar isn't being auto-hidden. I see that if I hit the maximize button, the system is clever enough to take into consideration whether or not the task bar is displayed. If I could somehow get the system to tell me what its maximize size it, that would give me the answer. The GetSystemMetrics gives me the same answer, with and without the task bar. Does anyone know the appropriate call? Thanks, Ilan

        stefanmihaimogaS Offline
        stefanmihaimogaS Offline
        stefanmihaimoga
        wrote on last edited by
        #3

        You need to use SystemParametersInfo with the SPI_GETWORKAREA value: Retrieves the size of the work area on the primary display monitor. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars. The pvParam parameter must point to a RECT structure that receives the coordinates of the work area, expressed in virtual screen coordinates.

        1 Reply Last reply
        0
        • I IlanTal

          I've got an application which I want to fit into the y dimension of the screen. The function: cyMon = ::GetSystemMetrics( SM_CYSCREEN); gives me the screen dimension, but I want the net dimension not including the task bar, if the task bar isn't being auto-hidden. I see that if I hit the maximize button, the system is clever enough to take into consideration whether or not the task bar is displayed. If I could somehow get the system to tell me what its maximize size it, that would give me the answer. The GetSystemMetrics gives me the same answer, with and without the task bar. Does anyone know the appropriate call? Thanks, Ilan

          A Offline
          A Offline
          Abhi Lahare
          wrote on last edited by
          #4

          Check this http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/systemparametersinfo.asp[^] With SPI_GETWORKAREA flag. Hope these helps. Regards Abhishake Lahare

          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