首先是考虑全屏处理的时机,是在创建窗口时还是显示窗口时进行,若是前者,则可以:
BOOL InitInstance(HINSTANCE hInstance,
int
nCmdShow)
{
HWND hWnd;
hInst = hInstance; // 将实例句柄存储在全局变量中
UINT width = GetSystemMetrics(SM_CXSCREEN);
UINT height = GetSystemMetrics(SM_CYSCREEN);
//创建窗口
hWnd=CreateWindow(
szWindowClass,
szTitle,
WS_POPUP,
0,0,
width,height,
NULL,NULL,
hInstance,
NULL);
if (!hWnd)
{
HWND hWnd;
hInst = hInstance; // 将实例句柄存储在全局变量中
UINT width = GetSystemMetrics(SM_CXSCREEN);
UINT height = GetSystemMetrics(SM_CYSCREEN);
//创建窗口
hWnd=CreateWindow(
szWindowClass,
szTitle,
WS_POPUP,
0,0,
width,height,
NULL,NULL,
hInstance,
NULL);
if (!hWnd)