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 many pixels thick are the frame of my window (Win32)

How many pixels thick are the frame of my window (Win32)

Scheduled Pinned Locked Moved C / C++ / MFC
questionwpfgame-devtutorial
9 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.
  • H Offline
    H Offline
    Hanan888
    wrote on last edited by
    #1

    I'm developing an animated-game on Win32. It runs only in windowed mode. I'm creating my window with the styles WS_OVERLAPPED | WS_SYSMENU so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user. We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that. The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ?

    G CPalliniC 2 Replies Last reply
    0
    • H Hanan888

      I'm developing an animated-game on Win32. It runs only in windowed mode. I'm creating my window with the styles WS_OVERLAPPED | WS_SYSMENU so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user. We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that. The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ?

      G Offline
      G Offline
      Graham Bradshaw
      wrote on last edited by
      #2

      Take a look at the SystemParametersInfo API function.

      H 1 Reply Last reply
      0
      • H Hanan888

        I'm developing an animated-game on Win32. It runs only in windowed mode. I'm creating my window with the styles WS_OVERLAPPED | WS_SYSMENU so that it has a blue frame, with a blue title on top, much like the window you have right now if you're a Windows user. We decided we want to support users with 800X600 screen (is there any of those left?), by means we want the window to fit into a 800X600 screen. If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified, it will be like 810X625 or something like that. The question is how do I know the exact size in pixels of the frame ? or what might be considered the maximal size so I could just do for example 740X550 window and it will always fit ?

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Hanan888 wrote:

        If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified

        AFAIK the above is wrong. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        In testa che avete, signor di Ceprano?

        H 1 Reply Last reply
        0
        • G Graham Bradshaw

          Take a look at the SystemParametersInfo API function.

          H Offline
          H Offline
          Hanan888
          wrote on last edited by
          #4

          Thanks.

          1 Reply Last reply
          0
          • CPalliniC CPallini

            Hanan888 wrote:

            If I create the window in size 800X600, it won't fit, since the frame is not included in the 800X600 I specified

            AFAIK the above is wrong. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

            H Offline
            H Offline
            Hanan888
            wrote on last edited by
            #5

            As i said, the entire size is more than 800X600, so how can it fit into 800X600 screen ? some parts will be 'out of the screen'. I tried it now, don't look that horrible, actually. Maybe we'll just say, If you got a 800X600, it's your own problem... (in the About dialog) :)

            CPalliniC 1 Reply Last reply
            0
            • H Hanan888

              As i said, the entire size is more than 800X600, so how can it fit into 800X600 screen ? some parts will be 'out of the screen'. I tried it now, don't look that horrible, actually. Maybe we'll just say, If you got a 800X600, it's your own problem... (in the About dialog) :)

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              If you set 800x600 on CreateWindow, then the overall size of the window (including borders) will be 800x600.

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

              In testa che avete, signor di Ceprano?

              H 1 Reply Last reply
              0
              • CPalliniC CPallini

                If you set 800x600 on CreateWindow, then the overall size of the window (including borders) will be 800x600.

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                H Offline
                H Offline
                Hanan888
                wrote on last edited by
                #7

                I now realized thats correct. My Question should have actually been what should be the size of my background image so that it will fit. So I guess I'll figure out what the dimensions of the border and I'll reduce the dimensions of the background image by that. Thanks.

                CPalliniC 1 Reply Last reply
                0
                • H Hanan888

                  I now realized thats correct. My Question should have actually been what should be the size of my background image so that it will fit. So I guess I'll figure out what the dimensions of the border and I'll reduce the dimensions of the background image by that. Thanks.

                  CPalliniC Offline
                  CPalliniC Offline
                  CPallini
                  wrote on last edited by
                  #8

                  GetClientRect [^]. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                  In testa che avete, signor di Ceprano?

                  H 1 Reply Last reply
                  0
                  • CPalliniC CPallini

                    GetClientRect [^]. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                    H Offline
                    H Offline
                    Hanan888
                    wrote on last edited by
                    #9

                    Thanks again, I'll try that.

                    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