Original Post
Quote:I got this code from my tutor for borland C++ builder, But When I use it in Visual C++ win32 application. and use SDL library, its not working, Can you tell me whats wrong with that..? This is the error when im compiling it : c:\program files\microsoft visual studio\vc98\include\winuser.h(39) : error C2146: syntax error : missing ';' before identifier 'HDWP' c:\program files\microsoft visual studio\vc98\include\winuser.h(39) : fatal error C1004: unexpected end of file found Error executing cl.exe.
void ChangeRes() { // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_7gz7.asp // #include // get the current devices display settings DEVMODE lpDevMode; ZeroMemory(&lpDevMode, sizeof(DEVMODE)); lpDevMode.dmSize = sizeof(DEVMODE); lpDevMode.dmDriverExtra = 0; if (!EnumDisplaySettings(NULL/* current device */,ENUM_CURRENT_SETTINGS, &lpDevMode)) ExitProcess(1); if (lpDevMode.dmPelsWidth == 800 && lpDevMode.dmPelsHeight == 600) return; // no need to change // set settings lpDevMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY; lpDevMode.dmPelsWidth = 800; lpDevMode.dmPelsHeight = 600; lpDevMode.dmDisplayFrequency = 85; // change settings long status; do { status = ChangeDisplaySettings(&lpDevMode, CDS_FULLSCREEN /* temporary, till program exits*/); lpDevMode.dmDisplayFrequency -= 5; } while (status != DISP_CHANGE_SUCCESSFUL && lpDevMode.dmDisplayFrequency >= 60); if (status != DISP_CHANGE_SUCCESSFUL) { lpDevMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT ; status = ChangeDisplaySettings(&lpDevMode, CDS_FULLSCREEN /* temporary, till program exits*/); if (status != DISP_CHANGE_SUCCESSFUL) ExitProcess(1); } }