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. FullScrean listbox

FullScrean listbox

Scheduled Pinned Locked Moved C / C++ / MFC
question
13 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.
  • M Mohan Ramachandra

    Resize the ListBox using MoveWindow API while changing from full screen to regular mode and vice versa.

    A Offline
    A Offline
    aangerma
    wrote on last edited by
    #4

    but how can I get the screan size?

    M 1 Reply Last reply
    0
    • N Niklas L

      All you have to do is SetWindowPos[^] and use some kind of accelerator key combination to switch back and forth. You might have to handle WM_MINMAXINFO[^] to allow the control to be larger than the actual screen if you want to hide borders. Alternatively, you could modify the window style to achieve the same. The GetSystemMetrics[^] API will give you the size of the screen using the SM_CXFULLSCREEN and SM_CYFULLSCREEN parameters. Disclaimer: there might be another way get the screen size to support multiple monitor systems.

      home

      A Offline
      A Offline
      aangerma
      wrote on last edited by
      #5

      thank you, I tried it but I can't get the handle to the window i.e. the first parameter of GetSystemMetrics is CWnd* and I don't know how to get it. can you please help me with this?

      N 1 Reply Last reply
      0
      • A aangerma

        but how can I get the screan size?

        M Offline
        M Offline
        Mohan Ramachandra
        wrote on last edited by
        #6

        Adding to the Niklas Lindquist suggestions in the below post GetClientRect API helps to obtain the client area of the Window. Get the parent window's client area and resize listbox according to it or the way you want.

        1 Reply Last reply
        0
        • A aangerma

          thank you, I tried it but I can't get the handle to the window i.e. the first parameter of GetSystemMetrics is CWnd* and I don't know how to get it. can you please help me with this?

          N Offline
          N Offline
          Niklas L
          wrote on last edited by
          #7

          GetSystemMetrics has only one parameter which is an int. GetSystemMetrics(SM_CXFULLSCREEN) and GetSystemMetrics(SM_CYFULLSCREEN) should work. Which version of the API accepts a CWnd*?

          home

          A 1 Reply Last reply
          0
          • N Niklas L

            GetSystemMetrics has only one parameter which is an int. GetSystemMetrics(SM_CXFULLSCREEN) and GetSystemMetrics(SM_CYFULLSCREEN) should work. Which version of the API accepts a CWnd*?

            home

            A Offline
            A Offline
            aangerma
            wrote on last edited by
            #8

            sorry I had a mistake I ment that SetWindowPos accepts a CWnd* as parameter.

            N 1 Reply Last reply
            0
            • A aangerma

              sorry I had a mistake I ment that SetWindowPos accepts a CWnd* as parameter.

              N Offline
              N Offline
              Niklas L
              wrote on last edited by
              #9

              Use NULL (or nullptr) and add the flag SWP_NOZORDER at the end.

              home

              A 1 Reply Last reply
              0
              • N Niklas L

                Use NULL (or nullptr) and add the flag SWP_NOZORDER at the end.

                home

                A Offline
                A Offline
                aangerma
                wrote on last edited by
                #10

                I insert this on the constructor of the dialog: int x=GetSystemMetrics(SM_CXFULLSCREEN); int y=GetSystemMetrics(SM_CYFULLSCREEN); SetWindowPos(NULL,0,0,x,y,SWP_NOZORDER ); and its give me Debug Assertion Failed. do you know what can be the resone? thanks again

                N 1 Reply Last reply
                0
                • A aangerma

                  I insert this on the constructor of the dialog: int x=GetSystemMetrics(SM_CXFULLSCREEN); int y=GetSystemMetrics(SM_CYFULLSCREEN); SetWindowPos(NULL,0,0,x,y,SWP_NOZORDER ); and its give me Debug Assertion Failed. do you know what can be the resone? thanks again

                  N Offline
                  N Offline
                  Niklas L
                  wrote on last edited by
                  #11

                  In your constructor the underlying window has not yet been created, and that's why the call fails. Put it in your OnInitDialog handler instead.

                  home

                  A 1 Reply Last reply
                  0
                  • A aangerma

                    Hello, Doe's anyone know how can I make a FullScrean listbox. I need to have the option that the list box will be somtimes at fullscrean and somtimes at regular mode. thanks in advence

                    M Offline
                    M Offline
                    Member 4194593
                    wrote on last edited by
                    #12

                    For some reason I read the mis-spelling as FillScreaM, and I thought the OP wanted something to get immediate attention!

                    1 Reply Last reply
                    0
                    • N Niklas L

                      In your constructor the underlying window has not yet been created, and that's why the call fails. Put it in your OnInitDialog handler instead.

                      home

                      A Offline
                      A Offline
                      aangerma
                      wrote on last edited by
                      #13

                      Thank you it's work wall!

                      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