Changing the resolution dynamically
-
We had some code, which mysticly worked on NT4
void 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 -
We had some code, which mysticly worked on NT4
void 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 TexasBernhard 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?
-
We had some code, which mysticly worked on NT4
void 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 TexasTry RecalcLayout(); to redraw the Framewnd which in your case a mainframe. Sonork 100.41263:Anthony_Yio
-
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?
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