如果需要添加一些风格,可以是 | 即或运算;举例:style = CS_VREDRAW | CS_HREDRAW ;
如果要去掉某个风格,则需要 先取反~,然后再与&,举例: style & ~CS_NOCLOSE; 更常用的是 style & = ~ CS_CLOSE;
举例:
HWND hwnd;
hwnd = CreateWindow("xxj","XXXCompany",WS_OVERLAPPEDWINDOW & ~WS_MAXMIZEBOX, CW_USERDEFAULT,CW_USERDEFAULT,
CW_USERDEFAULT,CW)USERDEFAULT,NULL,NULL,hInstance,NULL);
HWND CreateWindow(
LPCTSTR lpClassName, //registered class name
LPCTSTR lpWindowName, //window name
DWORD dwStyle, // window style
int x, //horizontal positon of window
int y, // vertical position of window
int iWidth, // window width
int iHeight, // window height
HWND hWndParent,//handle to parent or owner window//如果没有父窗口,传递参数设置为NULL
HMENU hMenu, // menu handle or identifier//如果没有菜单,传递参数设置为NULL
HINSTANCE hInstane , //handle to application instance
LPVOID lpParam); //window-creation data 意思是创建窗口的时候不是发送一个消息嘛,这是那个消息中的附加参数。
//注意:CW是CreateWindow的意思。