windows sdk编程隐藏窗体标题栏

时间:2023-08-06 16:58:20
#include <windows.h>

/*消息处理函数声明*/
HRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{ HWND hwnd;
MSG message;
WNDCLASS wndClass; char szClassName[] = "MainWindonClass";//窗体类名 DWORD dwStyle = WS_POPUP | WS_BORDER | WS_THICKFRAME; //设置窗体样式 ,隐藏标题栏 /*窗口类设置*/
wndClass.style = CS_DBLCLKS;
wndClass.lpfnWndProc=WindowProc;
wndClass.cbClsExtra=;
wndClass.cbWndExtra=;
wndClass.hInstance=hInstance;
wndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndClass.hCursor=LoadCursor (NULL, IDC_ARROW);
wndClass.hbrBackground=(HBRUSH) GetStockObject (WHITE_BRUSH);
wndClass.lpszMenuName=NULL;
wndClass.lpszClassName=szClassName; /*窗口类注册*/
if( RegisterClass(&wndClass) == )
return ;//表示注册失败 /*创建窗体*/
hwnd = CreateWindow(szClassName,
"隐藏标题栏",
dwStyle,//设置窗体样式
,
,
,
,
NULL,
NULL,
hInstance,
NULL
);
if(hwnd == )
{
MessageBox(NULL,"窗体创建失败!","失败",MB_OK);
return ;
} /* 显示窗体 */
ShowWindow(hwnd,nCmdShow); while (GetMessage (&message, NULL, , ))
{
TranslateMessage(&message);//翻译
DispatchMessage(&message);//发送消息
} return message.wParam;
} /*消息处理*/
LRESULT CALLBACK WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_DESTROY:
PostQuitMessage ();
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
} return ;
}

windows sdk编程隐藏窗体标题栏