typedef struct tagCREATESTRUCT { // cs
LPVOID lpCreateParams;
HINSTANCE hInstance;
HMENU hMenu;
HWND hwndParent;
int cy; //窗口的高度
int cx; //窗口的宽度
int y; //窗口左上角的y值
int x; //窗口左上角的x值
LONG style; //窗口的样式
LPCTSTR lpszName;
LPCTSTR lpszClass;
DWORD dwExStyle;
} CREATESTRUCT;
style的可取值
• WS_BORDER Creates a window that has a border.
创建带有边界线的窗口
• WS_CAPTION Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style.
创建带有标题栏的窗口
• WS_CHILD Creates a child window. Cannot be used with the WS_POPUP style.
创建一个子窗口
• WS_CLIPCHILDREN Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window.
当在父窗口上绘图时,禁止程序在子窗口上绘图。
• WS_CLIPSIBLINGS Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGS style clips all other overlapped child windows out of the region of the child window to be updated. (If WS_CLIPSIBLINGS is not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with the WS_CHILD style only.
当在其他子窗口上绘图时,禁止程序在子窗口上绘图。
• WS_DISABLED Creates a window that is initially disabled.
创建一个没有功能的窗口。
• WS_DLGFRAME Creates a window with a double border but no title.
创建一个带有双线边界而没有标题栏的窗口。
• WS_GROUP Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All controls defined with the WS_GROUP style FALSE after the first control belong to the same group. The next control with the WS_GROUP style starts the next group (that is, one group ends where the next begins).
指定控制组中的第一个控制
• WS_HSCROLL Creates a window that has a horizontal scroll bar.
创建带有水平流动条的窗口。
• WS_MAXIMIZE Creates a window of maximum size.
创建最大化的窗口。
• WS_MAXIMIZEBOX Creates a window that has a Maximize button.
创建带有最大化按钮的窗口。
• WS_MINIMIZE Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only.
创建一个带有最小化的窗口。
• WS_MINIMIZEBOX Creates a window that has a Minimize button.
创建一个带有最小化按钮的窗口。
• WS_OVERLAPPED Creates an overlapped window. An overlapped window usually has a caption and a border.
创建带有标题栏和边界线的窗口。
• WS_OVERLAPPEDWINDOW Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles.
组合了WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, 和 WS_MAXIMIZEBOX。
• WS_POPUP Creates a pop-up window. Cannot be used with the WS_CHILD style.
创建一个弹出式窗口。
• WS_POPUPWINDOW Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.
组合了WS_BORDER, WS_POPUP,和 WS_SYSMENU
• WS_SYSMENU Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars.
创建带有控制菜单的窗口。
• WS_TABSTOP Specifies one of any number of controls through which the user can move by using the TAB key. The TAB key moves the user to the next control specified by the WS_TABSTOP style.
指定可通知制表键选择的控件。
• WS_THICKFRAME Creates a window with a thick frame that can be used to size the window.
创建带有可伸缩框架的窗口。
• WS_VISIBLE Creates a window that is initially visible.
创建可见的窗口
• WS_VSCROLL Creates a window that has a vertical scroll bar.
创建带有垂直滑动条的窗口。