int WINAPI WinMain(HINSTANCE hCurrentInst,HINSTANCE hPrevInstance,PSTR lpszCmdLine,int nCmdShow)
{
WNDCLASS wndClass;
HWND hWnd;
MSG msg;
UINT width;
UINT height;
ScreenW=GetSystemMetrics(SM_CXSCREEN);
ScreenH=GetSystemMetrics(SM_CYSCREEN);
PicInst();
RoomInst();
wndClass.style=CS_HREDRAW|CS_VREDRAW;
wndClass.lpfnWndProc=WndProc;
wndClass.cbClsExtra=0;
wndClass.cbWndExtra=0;
wndClass.hInstance=hCurrentInst;
wndClass.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_MAIN));
wndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName=NULL;
wndClass.lpszClassName=”BasicApp”;
RegisterClass(&wndClass);
width=GetSystemMetrics(SM_CXSCREEN);
height=GetSystemMetrics(SM_CYSCREEN);
hWnd=CreateWindow(
“BasicApp”,
“Basic Applicaton”,
WS_POPUP|WS_MAXIMIZE,
0,0,
width,height,
NULL,NULL,
hCurrentInst,NULL);
ShowWindow(hWnd,nCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&msg,NULL,0,0))
{
nowTick=GetTickCount();
if(nowTick-showTick>33&&!IsOver)
{
Show(bufferDC);
BitBlt(windowDC,0,0,ScreenW,ScreenH,bufferDC,0,0,SRCCOPY);
showTick=nowTick;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
{
WNDCLASS wndClass;
HWND hWnd;
MSG msg;
UINT width;
UINT height;
ScreenW=GetSystemMetrics(SM_CXSCREEN);
ScreenH=GetSystemMetrics(SM_CYSCREEN);
PicInst();
RoomInst();
wndClass.style=CS_HREDRAW|CS_VREDRAW;
wndClass.lpfnWndProc=WndProc;
wndClass.cbClsExtra=0;
wndClass.cbWndExtra=0;
wndClass.hInstance=hCurrentInst;
wndClass.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_MAIN));
wndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName=NULL;
wndClass.lpszClassName=”BasicApp”;
RegisterClass(&wndClass);
width=GetSystemMetrics(SM_CXSCREEN);
height=GetSystemMetrics(SM_CYSCREEN);
hWnd=CreateWindow(
“BasicApp”,
“Basic Applicaton”,
WS_POPUP|WS_MAXIMIZE,
0,0,
width,height,
NULL,NULL,
hCurrentInst,NULL);
ShowWindow(hWnd,nCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&msg,NULL,0,0))
{
nowTick=GetTickCount();
if(nowTick-showTick>33&&!IsOver)
{
Show(bufferDC);
BitBlt(windowDC,0,0,ScreenW,ScreenH,bufferDC,0,0,SRCCOPY);
showTick=nowTick;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
解决方案
20
WS_POPUP|WS_MAXIMIZE 可以改成 WS_OVERLAPPEDWINDOW ,窗口样式参数很多,具体要查MSDN
20