BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hwnd;
hInst = hInstance; // Store instance handle in our global variable
MyRegisterClass(hInstance, szWindowClass);
LoadString(hInstance, IDC_GSNAKE, szWindowClass, MAX_LOADSTRING);
int iWidth = GetSystemMetrics (SM_CXSCREEN);
int iHeight = GetSystemMetrics(SM_CYSCREEN);
hwnd = CreateWindow(szWindowClass, szTitle, /*WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU |*/ WS_MAXIMIZEBOX ,
0, 0, iWidth , iHeight, NULL, NULL, hInstance, NULL);
if (!hwnd)
{
return FALSE;
}
ShowWindow(hwnd, nCmdShow);//这个地方原来是 hWnd
/* //实现窗口全屏
HWND hDesk;
RECT rc;
hDesk = GetDesktopWindow();
GetWindowRect(hDesk,&rc);
SetWindowLong(hwnd,GWL_STYLE,WS_BORDER );
SetWindowPos(hwnd,HWND_TOPMOST, 0, 0, rc.right,rc.bottom, SWP_NOMOVE|SWP_NOSIZE|SWP_SHOWWINDOW);
*/
UpdateWindow(hwnd);//这个地方原来是 hWnd
return TRUE;
}
5 个解决方案
#1
怎么没有人回答啊?
#2
Create(NULL,"gfhfd",WS_POPUP|WS_VISIBLE,CRect(0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN)));//创建窗口
//上面代码为全屏程序
//上面代码为全屏程序
#3
或者先把任务栏隐藏,再全屏
FindWindow("Shell_TrayWnd",NULL) -> ShowWindow(SW_HIDE);//隐藏任务栏
FindWindow("Shell_TrayWnd",NULL) -> ShowWindow(SW_HIDE);//隐藏任务栏
#4
ShowWindow(hwnd,SW_MAXIMIZE);
#5
我是用WIN32写的啊。只有CreateWindow 没有Create啊
#1
怎么没有人回答啊?
#2
Create(NULL,"gfhfd",WS_POPUP|WS_VISIBLE,CRect(0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN)));//创建窗口
//上面代码为全屏程序
//上面代码为全屏程序
#3
或者先把任务栏隐藏,再全屏
FindWindow("Shell_TrayWnd",NULL) -> ShowWindow(SW_HIDE);//隐藏任务栏
FindWindow("Shell_TrayWnd",NULL) -> ShowWindow(SW_HIDE);//隐藏任务栏
#4
ShowWindow(hwnd,SW_MAXIMIZE);
#5
我是用WIN32写的啊。只有CreateWindow 没有Create啊