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 to Get Desk Top rectangle (RECT)

How to Get Desk Top rectangle (RECT)

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
5 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.
  • Z Offline
    Z Offline
    zahid_ash
    wrote on last edited by
    #1

    HI, How can i Get DeskTop RECT ..... as i do to get RECT of dialogs using GetWindowRect(); actualy i want to draw mine application Window equals to the desktop coordiantes excluding TaskBar area. any sample. or help .. thanx Regards.

    M A 2 Replies Last reply
    0
    • Z zahid_ash

      HI, How can i Get DeskTop RECT ..... as i do to get RECT of dialogs using GetWindowRect(); actualy i want to draw mine application Window equals to the desktop coordiantes excluding TaskBar area. any sample. or help .. thanx Regards.

      M Offline
      M Offline
      mahade1
      wrote on last edited by
      #2

      Try using GetSystemMetrics(SM_CXFULLSCREEN) Regards, Mahadevan.

      A Z 2 Replies Last reply
      0
      • M mahade1

        Try using GetSystemMetrics(SM_CXFULLSCREEN) Regards, Mahadevan.

        A Offline
        A Offline
        Antony M Kancidrowski
        wrote on last edited by
        #3

        You missed SM_CYFULLSCREEN in order to get the y. Ant. I'm hard, yet soft.
        I'm coloured, yet clear.
        I'm fruity and sweet.
        I'm jelly, what am I? Muse on it further, I shall return!
        - David Williams (Little Britain)

        1 Reply Last reply
        0
        • Z zahid_ash

          HI, How can i Get DeskTop RECT ..... as i do to get RECT of dialogs using GetWindowRect(); actualy i want to draw mine application Window equals to the desktop coordiantes excluding TaskBar area. any sample. or help .. thanx Regards.

          A Offline
          A Offline
          Antony M Kancidrowski
          wrote on last edited by
          #4

          Additionally to what has already been stated. If you have multiple monitors (or want multiple monitor support) us SM_CXVIRTUALSCREEN to get the x SM_CYVIRTUALSCREEN to get the y As the parameter to GetSystemMetrics NOTE: the rect will be (0, 0, x, y) Ant. I'm hard, yet soft.
          I'm coloured, yet clear.
          I'm fruity and sweet.
          I'm jelly, what am I? Muse on it further, I shall return!
          - David Williams (Little Britain)

          1 Reply Last reply
          0
          • M mahade1

            Try using GetSystemMetrics(SM_CXFULLSCREEN) Regards, Mahadevan.

            Z Offline
            Z Offline
            zahid_ash
            wrote on last edited by
            #5

            if i will try like this then is it right way CWnd * wnd = GetDesktopWindow(); RECT rect; wnd->GetWindowRect(&rect); MoveWindow(rect.left,rect.top ,rect.right ,rect.bottom -35 , TRUE); RECT rec; this->GetWindowRect (&rec); GetDlgItem(IDC_BUTTON1)->MoveWindow(rec.left,rec.top+70, rec.right ,rec.bottom ); is it right tell me how i use GetSystemMetrics(SM_CXFULLSCREEN) thanx Regards.

            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