比较有用的设置:
(1)
WS_POPUP:弹出式窗体,没有标题栏!
WS_BORDER:细的黑边框
WS_OVERLAPPED:一般的有标题栏的窗体,见多了。
WS_CHILD:子窗体,一般用于Frame里面的窗体
(2)
WS_CAPTION:标题栏
WS_SYSMENU:系统菜单(只有设置后才有最小化、最大化、关闭)
WS_MINIMIZEBOX :最小化按钮
WS_MAXIMIZEBOX:最大化按钮
WS_MINIMIZE:启动时最小化
WS_MAXIMIZE:启动时最大化
(3)
WS_EX_TOOLWINDOW:不在任务栏里显示条目
WS_EX_WINDOWEDGE:
WS_EX_CLIENTEDGE:具有凹陷感
[参考]
在winuser.h中定义:
/*
* Window Styles
*/
#define WS_OVERLAPPED 0x00000000L
#define WS_POPUP 0x80000000L
#define WS_CHILD 0x40000000L
#define WS_MINIMIZE 0x20000000L
#define WS_VISIBLE 0x10000000L
#define WS_DISABLED 0x08000000L
#define WS_CLIPSIBLINGS 0x04000000L
#define WS_CLIPCHILDREN 0x02000000L
#define WS_MAXIMIZE 0x01000000L
#define WS_CAPTION 0x00C00000L /* WS_BORDER | WS_DLGFRAME */
#define WS_BORDER 0x00800000L
#define WS_DLGFRAME 0x00400000L
#define WS_VSCROLL 0x00200000L
#define WS_HSCROLL 0x00100000L
#define WS_SYSMENU 0x00080000L
#define WS_THICKFRAME 0x00040000L
#define WS_GROUP 0x00020000L
#define WS_TABSTOP 0x00010000L
#define WS_MINIMIZEBOX 0x00020000L
#define WS_MAXIMIZEBOX 0x00010000L
#define WS_TILED WS_OVERLAPPED
#define WS_ICONIC WS_MINIMIZE
#define WS_SIZEBOX WS_THICKFRAME
#define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
/*
* Common Window Styles
*/
#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | \
WS_CAPTION | \
WS_SYSMENU | \
WS_THICKFRAME | \
WS_MINIMIZEBOX | \
WS_MAXIMIZEBOX)
#define WS_POPUPWINDOW (WS_POPUP | \
WS_BORDER | \
WS_SYSMENU)
#define WS_CHILDWINDOW (WS_CHILD)
/*
* Extended Window Styles
*/
#define WS_EX_DLGMODALFRAME 0x00000001L
#define WS_EX_NOPARENTNOTIFY 0x00000004L
#define WS_EX_TOPMOST 0x00000008L
#define WS_EX_ACCEPTFILES 0x00000010L
#define WS_EX_TRANSPARENT 0x00000020L
#if(WINVER >= 0x0400)
#define WS_EX_MDICHILD 0x00000040L
#define WS_EX_TOOLWINDOW 0x00000080L
#define WS_EX_WINDOWEDGE 0x00000100L
#define WS_EX_CLIENTEDGE 0x00000200L
#define WS_EX_CONTEXTHELP 0x00000400L
#endif /* WINVER >= 0x0400 */
#if(WINVER >= 0x0400)
#define WS_EX_RIGHT 0x00001000L
#define WS_EX_LEFT 0x00000000L
#define WS_EX_RTLREADING 0x00002000L
#define WS_EX_LTRREADING 0x00000000L
#define WS_EX_LEFTSCROLLBAR 0x00004000L
#define WS_EX_RIGHTSCROLLBAR 0x00000000L
#define WS_EX_CONTROLPARENT 0x00010000L
#define WS_EX_STATICEDGE 0x00020000L
#define WS_EX_APPWINDOW 0x00040000L
#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
#define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST)
#endif /* WINVER >= 0x0400 */
#if(_WIN32_WINNT >= 0x0500)
#define WS_EX_LAYERED 0x00080000
#endif /* _WIN32_WINNT >= 0x0500 */
#if(WINVER >= 0x0500)
#define WS_EX_NOINHERITLAYOUT 0x00100000L // Disable inheritence of mirroring by children
#define WS_EX_LAYOUTRTL 0x00400000L // Right to left mirroring
#endif /* WINVER >= 0x0500 */
#if(_WIN32_WINNT >= 0x0500)
#define WS_EX_COMPOSITED 0x02000000L
#define WS_EX_NOACTIVATE 0x08000000L
#endif /* _WIN32_WINNT >= 0x0500 */