所以我试图让我的窗口类全屏,但它不工作,它只是闪烁黑色然后它不会变成全屏这里是源代码: -
void InitEngine::Init(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd, DesktopScreenInfo * ScreenInfo, LPSTR WindowName)
{
mWindoClass = new WNDCLASSEX();
ZeroMemory(mWindoClass,sizeof(WNDCLASSEX));
if(ScreenInfo) mScreenInfo = ScreenInfo;
else mScreenInfo = &DesktopScreen::GetScreenInfo();
mWindoClass->cbSize = sizeof(WNDCLASSEX);// window size
mWindoClass->style = CS_HREDRAW | CS_VREDRAW; // so it draw when Horizontal or Vertical change
mWindoClass->lpfnWndProc = WindowProc;
mWindoClass->hInstance = hInstance;
mWindoClass->hCursor = LoadCursor(NULL, IDC_ARROW); //load normal cursor
mWindoClass->hbrBackground = (HBRUSH)COLOR_WINDOW;
mWindoClass->lpszClassName = "PoPEngineClass";
DEVMODE screen;
memset(&screen,0,sizeof(screen));
screen.dmSize = sizeof(screen);
screen.dmPelsWidth = mScreenInfo->Width;
screen.dmPelsHeight = mScreenInfo->Height;
screen.dmBitsPerPel = mScreenInfo->ScreenDepth;
screen.dmDisplayFrequency = mScreenInfo->FrameRate;
screen.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
ChangeDisplaySettings(&screen, CDS_FULLSCREEN);
RegisterClassEx(mWindoClass);
WindowHandel = CreateWindowEx(NULL , mWindoClass->lpszClassName , WindowName , WS_POPUP, 0 , 0, mScreenInfo->Width, mScreenInfo->Height, NULL, NULL, hInstance, NULL);
ShowWindow(WindowHandel, nShowCmd);
UpdateWindow(WindowHandel);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}