65,210
社区成员
发帖
与我相关
我的任务
分享CreateWindowEx(NULL,"大哥","谁说不可以啊?",
codeWS_OVERLAPPEDWINDOW|~WS_THICKFRAME ,0,0,width,height,NULL,NULL,hInstance,NULL);//大哥谁告诉你用CreateWindow是没有办法固定大小的?
CreateWindowEx(NULL,"大哥","谁说不可以啊?",
codeWS_OVERLAPPEDWINDOW|~WS_THICKFRAME ,0,0,width,height,NULL,NULL,hInstance,NULL);
//你想多大就设置多大width,height
//大哥谁告诉你用CreateWindow是没有办法固定大小的?
CreateWindowEx(NULL,"大哥","谁说不可以啊?",
C/C++ codeWS_OVERLAPPEDWINDOW|~WS_THICKFRAME ,0,0,width,height,NULL,NULL,hInstance,NULL);
//你想多大就设置多大width,height
WS_OVERLAPPEDWINDOW|~WS_THICKFRAME ,0,0,width,height,NULL,NULL,hInstance,NULL);
//你想多大就设置多大width,height
int width = 200;
int height = 200;
hWnd = CreateWindow(
szWindowClass,
szTitle,
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,
CW_USEDEFAULT,
width,
CW_USEDEFAULT,
height,
NULL,
NULL,
hInstance,
NULL);
窗口大小固定?也就是不让用户通过拖动来改变窗口大小了?
那就在PreCreateWindow中添加:
cs.style=WS_OVERLAPPED | WS_SYSMENU |WS_MINIMIZEBOX ;
如果可以改变大小,把如上改为:
cs.style=WS_OVERLAPPED | WS_SYSMENU |WS_MINIMIZEBOX | WS_THICKFRAME;
这样的窗口MaxBox为disabled..
int nWidth, // window width
int nHeight, // window height
HWND CreateWindow(
LPCTSTR lpClassName, // registered class name
LPCTSTR lpWindowName, // window name
DWORD dwStyle, // window style
int x, // horizontal position of window
int y, // vertical position of window
int nWidth, // window width
int nHeight, // window height
HWND hWndParent, // handle to parent or owner window
HMENU hMenu, // menu handle or child identifier
HINSTANCE hInstance, // handle to application instance
LPVOID lpParam // window-creation data
);