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. Making MFC go fullscreen

Making MFC go fullscreen

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++graphicsgame-devtutorial
6 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    At first I thought this wasn't a problem at all. But now that I started an OpenGL-MFC based solution, all of a sudden I fail at even attempting to make this MFC app go full screen. I searched allot of sites over this 'issue', but I was really amazed by not finding any info on this. I only run into this problem using MFC. My rather silly simple problem is, how to make an MFC app go full screen? And I really mean fullscreen. Thanks for any help.

    H R T 3 Replies Last reply
    0
    • L Lost User

      At first I thought this wasn't a problem at all. But now that I started an OpenGL-MFC based solution, all of a sudden I fail at even attempting to make this MFC app go full screen. I searched allot of sites over this 'issue', but I was really amazed by not finding any info on this. I only run into this problem using MFC. My rather silly simple problem is, how to make an MFC app go full screen? And I really mean fullscreen. Thanks for any help.

      H Offline
      H Offline
      Hadi Rezaee
      wrote on last edited by
      #2

      I don't know OpenGL, and i think OpenGL have a function for screen ! Anyway, you can use GetDeviceCaps for getting display coordinate and resize your program window to full screen ! :-D My month article: Game programming by DirectX by Lan Mader. Please visit in: www.geocities.com/hadi_rezaie/index.html Hadi Rezaie

      1 Reply Last reply
      0
      • L Lost User

        At first I thought this wasn't a problem at all. But now that I started an OpenGL-MFC based solution, all of a sudden I fail at even attempting to make this MFC app go full screen. I searched allot of sites over this 'issue', but I was really amazed by not finding any info on this. I only run into this problem using MFC. My rather silly simple problem is, how to make an MFC app go full screen? And I really mean fullscreen. Thanks for any help.

        R Offline
        R Offline
        Rick York
        wrote on last edited by
        #3

        Have a look at Q164162 in the knowledge base. It works for me. :cool:

        L 1 Reply Last reply
        0
        • L Lost User

          At first I thought this wasn't a problem at all. But now that I started an OpenGL-MFC based solution, all of a sudden I fail at even attempting to make this MFC app go full screen. I searched allot of sites over this 'issue', but I was really amazed by not finding any info on this. I only run into this problem using MFC. My rather silly simple problem is, how to make an MFC app go full screen? And I really mean fullscreen. Thanks for any help.

          T Offline
          T Offline
          Todd Harvey
          wrote on last edited by
          #4

          I've been doing either this (in InitDialog) [ccode] BOOL returnCode = SetWindowPos( this->GetActiveWindow(), 0, 0, ::GetSystemMetrics(SM_CXMAXIMIZED), ::GetSystemMetrics(SM_CYMAXIMIZED), SWP_SHOWWINDOW); [/ccode] or this: [ccode] CRect rect; rect.top = 0; rect.left = 0; rect.right = ::GetSystemMetrics(SM_CXMAXIMIZED); rect.bottom = ::GetSystemMetrics(SM_CXMAXIMIZED); this->GetActiveWindow()->MoveWindow(rect,TRUE); [/ccode] If you do anything with OnSize, remember that it is called twice - once before InitDialog, and then again after InitDialog, and you can't move controls until InitDialog runs because they don't exit yet. (you didn't ask this, and I think I'm telling it correctly. You might also be interested in the EasySize class for moving dialog controls around as you resize a dialog - it is very helpful. (search this site if you are interested)

          L 1 Reply Last reply
          0
          • R Rick York

            Have a look at Q164162 in the knowledge base. It works for me. :cool:

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Yes this does work. Although... it's not exactly a common known solution (if there is one) :) But it does work. Only problem left is that in XP I still have the window borders showing up. I 'solved' this by making the 'rectDesktop' 2 pixels larger. Hopefully that works on any desktop theme. Else I need to know a way to get the current border width. Thanks for your help, it helped allot.:)

            1 Reply Last reply
            0
            • T Todd Harvey

              I've been doing either this (in InitDialog) [ccode] BOOL returnCode = SetWindowPos( this->GetActiveWindow(), 0, 0, ::GetSystemMetrics(SM_CXMAXIMIZED), ::GetSystemMetrics(SM_CYMAXIMIZED), SWP_SHOWWINDOW); [/ccode] or this: [ccode] CRect rect; rect.top = 0; rect.left = 0; rect.right = ::GetSystemMetrics(SM_CXMAXIMIZED); rect.bottom = ::GetSystemMetrics(SM_CXMAXIMIZED); this->GetActiveWindow()->MoveWindow(rect,TRUE); [/ccode] If you do anything with OnSize, remember that it is called twice - once before InitDialog, and then again after InitDialog, and you can't move controls until InitDialog runs because they don't exit yet. (you didn't ask this, and I think I'm telling it correctly. You might also be interested in the EasySize class for moving dialog controls around as you resize a dialog - it is very helpful. (search this site if you are interested)

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Still, using both this and the solution 2 posts back, I get thin borders around the screen. A simple way to get the current border width would solve this. ...and this post got me to look up 'GetSystemMetrics' again, and ::GetSystemMetrics(SM_CXBORDER), ::GetSystemMetrics(SM_CYBORDER) both do the trick I needed. i.e. it all works now! thanks :) Long live..... MFC?

              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