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. Changing the resolution dynamically

Changing the resolution dynamically

Scheduled Pinned Locked Moved C / C++ / MFC
questionannouncement
4 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.
  • B Offline
    B Offline
    Bernhard
    wrote on last edited by
    #1

    We had some code, which mysticly worked on NT4void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { CFrameWnd::OnActivate(nState, pWndOther, bMinimized); // TODO: Add your message handler code here if(nState == WA_INACTIVE) ChangeDisplaySettings(NULL, 0); if(nState != WA_INACTIVE){ DEVMODE* pDevMode; pDevMode = new DEVMODE; pDevMode->dmSize = sizeof(DEVMODE); // dm.dmDriverExtra = 800; if(EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS, pDevMode )){ DWORD dw_width = pDevMode->dmPelsWidth; DWORD dw_height= pDevMode->dmPelsHeight; if(dw_width < 1024){ pDevMode->dmPelsWidth = 1024; pDevMode->dmPelsHeight = 768; ChangeDisplaySettings(pDevMode, 0); } } delete pDevMode; } }//if(!WA_INACTIVE }
    if i am changing my resolution to 800x600 and starting the application the resolution is set to 1024x768 (like i expected...) but the start bar is floating around (when it is set to "stay in foreground".. sorry bad translation... but i have got the german version installed) i've tried out some parameters for ChangeDisplaySettings.. but it didn't work in the way it did in WinNT.. any ideas ?


    "I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
    U.S. Secretary of State Colin Powell at George Bush's ranch in Texas

    D A 2 Replies Last reply
    0
    • B Bernhard

      We had some code, which mysticly worked on NT4void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { CFrameWnd::OnActivate(nState, pWndOther, bMinimized); // TODO: Add your message handler code here if(nState == WA_INACTIVE) ChangeDisplaySettings(NULL, 0); if(nState != WA_INACTIVE){ DEVMODE* pDevMode; pDevMode = new DEVMODE; pDevMode->dmSize = sizeof(DEVMODE); // dm.dmDriverExtra = 800; if(EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS, pDevMode )){ DWORD dw_width = pDevMode->dmPelsWidth; DWORD dw_height= pDevMode->dmPelsHeight; if(dw_width < 1024){ pDevMode->dmPelsWidth = 1024; pDevMode->dmPelsHeight = 768; ChangeDisplaySettings(pDevMode, 0); } } delete pDevMode; } }//if(!WA_INACTIVE }
      if i am changing my resolution to 800x600 and starting the application the resolution is set to 1024x768 (like i expected...) but the start bar is floating around (when it is set to "stay in foreground".. sorry bad translation... but i have got the german version installed) i've tried out some parameters for ChangeDisplaySettings.. but it didn't work in the way it did in WinNT.. any ideas ?


      "I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
      U.S. Secretary of State Colin Powell at George Bush's ranch in Texas

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Bernhard wrote: any ideas ? Well, I'm not quite sure what you are asking. The subject is about changing the resolution dynamically, which you appear to have working. Yes? However, the post itself mentions a floating start bar, at which point I got lost. What exactly are you after?


      Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

      B 1 Reply Last reply
      0
      • B Bernhard

        We had some code, which mysticly worked on NT4void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { CFrameWnd::OnActivate(nState, pWndOther, bMinimized); // TODO: Add your message handler code here if(nState == WA_INACTIVE) ChangeDisplaySettings(NULL, 0); if(nState != WA_INACTIVE){ DEVMODE* pDevMode; pDevMode = new DEVMODE; pDevMode->dmSize = sizeof(DEVMODE); // dm.dmDriverExtra = 800; if(EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS, pDevMode )){ DWORD dw_width = pDevMode->dmPelsWidth; DWORD dw_height= pDevMode->dmPelsHeight; if(dw_width < 1024){ pDevMode->dmPelsWidth = 1024; pDevMode->dmPelsHeight = 768; ChangeDisplaySettings(pDevMode, 0); } } delete pDevMode; } }//if(!WA_INACTIVE }
        if i am changing my resolution to 800x600 and starting the application the resolution is set to 1024x768 (like i expected...) but the start bar is floating around (when it is set to "stay in foreground".. sorry bad translation... but i have got the german version installed) i've tried out some parameters for ChangeDisplaySettings.. but it didn't work in the way it did in WinNT.. any ideas ?


        "I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
        U.S. Secretary of State Colin Powell at George Bush's ranch in Texas

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

        Try RecalcLayout(); to redraw the Framewnd which in your case a mainframe. Sonork 100.41263:Anthony_Yio

        1 Reply Last reply
        0
        • D David Crow

          Bernhard wrote: any ideas ? Well, I'm not quite sure what you are asking. The subject is about changing the resolution dynamically, which you appear to have working. Yes? However, the post itself mentions a floating start bar, at which point I got lost. What exactly are you after?


          Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

          B Offline
          B Offline
          Bernhard
          wrote on last edited by
          #4

          the resolution change works.. but the bar (with the start - button.. i don't know the word for this bar).. doesn't seem to recognise the change.. and so it shows up at the old position (in the middle of the screen)


          "I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
          U.S. Secretary of State Colin Powell at George Bush's ranch in Texas

          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