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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Adapt window size

Adapt window size

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

    I'm trying to adapt the size of window so it can fit with different resolutions based on the monitor size?

    C 1 Reply Last reply
    0
    • G gmlnd

      I'm trying to adapt the size of window so it can fit with different resolutions based on the monitor size?

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      dc.GetDeviceCaps(HORZRES) dc.GetDeviceCaps(VERTRES) will tell you the size of the display -c

      Chris Losinger
      Smaller Animals Software

      A G 2 Replies Last reply
      0
      • C Chris Losinger

        dc.GetDeviceCaps(HORZRES) dc.GetDeviceCaps(VERTRES) will tell you the size of the display -c

        Chris Losinger
        Smaller Animals Software

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Can I do the following in the OnDraw function? CRect rc; SystemParametersInfo(SPI_GETWORKAREA,0,rc,0);

        C 1 Reply Last reply
        0
        • A Anonymous

          Can I do the following in the OnDraw function? CRect rc; SystemParametersInfo(SPI_GETWORKAREA,0,rc,0);

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          yes, but don't. OnDraw is called pretty much all the time, and you don't want to do things in the OnDraw function that will cause drawing to be required (such as resizing the window) - that leads to trouble. -c

          Chris Losinger
          Smaller Animals Software

          1 Reply Last reply
          0
          • C Chris Losinger

            dc.GetDeviceCaps(HORZRES) dc.GetDeviceCaps(VERTRES) will tell you the size of the display -c

            Chris Losinger
            Smaller Animals Software

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

            If I use this method, will it matter which function I put this in? dc.GetDeviceCaps(HORZRES) dc.GetDeviceCaps(VERTRES) All I need to adapt to different resolutions is to GetDeviceCaps? What is dc? Thank's.

            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