我想做一个类似画图工具条的功能,即:鼠标在工具条上点击按钮,按钮保持按下的状态,鼠标在工作区上再点击一下,就能动态的创建出一个控件的窗口,我就想问一下,在工作区中动态的创建控件窗口是如何实现的,所用到的类和相关函数有哪些啊(最好能提供一本书)

解决方案 »

  1.   

    CreateWindow
    格式定义
    HWND WINAPI CreateWindow(PCSTR pszClassName,
    PCSTR pszWindowName, DWORD dwStyle,
    int x, int y, int nWidth, int nHeight,
    HWND hwndParent, HMENU hMenu,
    HINSTANCE hInstance, PVOID pParam);
    功能说明
    创建一个指定窗口类、窗口标题、窗口格式、窗口初始位置和大小的弹出
    式窗口或子窗口。同时,本函数还指定窗口的父窗口和菜单(如果有的话)。
    参数说明
    pszClassName 指定要创建的窗口类名,该类名可以是调用
    RegisterClass 函数注册的任何类名,或是预先定
    义好的控件类名。预先定义好的控件类的说明详
    见补充说明部分。pszWindowName 如果参数dwStyle 指定的窗口格式中指定了窗口
    具有标题条(WS_CAPTION),本参数指定的内
    容在窗口的标题条中显示。当创建的窗口是按钮、
    编辑框、静态文本等控件时,本参数指定控件中
    的文字。
    dwStyle 指定所建窗口的格式。它可以是补充说明部分窗
    口格式表中给出的任何格式的组合或控件格式表
    中给出的控件格式的组合。
    x 指定窗口左上角初始的x 坐标。对于弹出式窗口,
    坐标相对于屏幕的左上角;对于客户区子窗口,
    坐标相对于父窗口的客户区的左上角;对于非客
    户区子窗口,坐标相对于父窗口的非客户区的左
    上角。
    y 指定窗口左上角初始的y 坐标。对于弹出式窗口,
    坐标相对于屏幕的左上角;对于客户区子窗口,
    坐标相对于父窗口的客户区的左上角;对于非客
    户区子窗口,坐标相对于父窗口的非客户区的左
    上角。
    width 指定窗口的宽度。
    height 指定窗口的高度。
    hwndParent 指定要创建窗口的父窗口或拥有者窗口。对于弹
    出式窗口,指定该窗口的拥有者窗口,当拥有者
    窗口被删除时,该窗口也将被删除;对于子窗口,
    指定该子窗口的父窗口,子窗口只能在父窗口的
    相应区域内活动,并随父窗口的删除而删除。如
    果窗口没有父窗口或拥有者窗口,则本参数应设
    置为NULL。
    hMenu 指定菜单或子窗口标识ID,这取决于要创建窗口
    的类型。对于弹出式窗口,本参数指定窗口的菜
    Hopen 图形用户界面API 参考手册106
    单。对于子窗口,本参数指定窗口的标识ID。
    hInstance 该窗口所属的应用程序实例的句柄。
    pParam 指向一个传递给要创建窗口的结构,这个传递过
    程是通过WM_NCCREATE 和WM_CREATE 消
    息的lParam 参数引用的CREATESTRUCT结构来
    完成的。
    返回值
    若创建成功,返回新窗口的句柄,否则,返回NULL。
    补充说明
    参数pszClassName 可以是预定义的控件类,预定义的控件类的描述如下:
    类名描述
    BUTTON 用户能通过鼠标左键或笔来点击该控件,以产生
    WM_COMMAND 消息。该控件被点击时,通常会
    改变它的显示外观。
    普通按钮该控件是一个小的矩形子窗口,窗口中可以显示文
    本或位图。
    复选框该控件由一组可选中的小矩形组成,小矩形的右边
    可以有文字说明小矩形的意义。当用户选中其中的
    小矩形时,小矩形内部的显示外观将会相应变化以
    表示处于选中状态或处于非选中状态。
    单选框一组能选中的小按钮,右边可以有文字表示该按钮
    的意义,用来表示互斥的一组选择项,在任何时候
    只能在该组中选中一个按钮。当用户选择其中一个
    按钮时,其外观相应变化以表示选中。
    组框一个带有标题的矩形框,用于将其它控件组织成一
    组。
    COMBOBOX 该控件由一个编辑控件与一个同列表框类似的选择区
    域组成。列表框可以直接在编辑控件的下方显示,也
    Hopen 图形用户界面API 参考手册107
    可以由用户选择弹出。编辑选择域中的内容是否可选,
    取决于组合框的格式。如果列表框是可见的,则键入
    的编辑框中的内容将使列表框中与输入内容匹配的第
    一个匹配项变成高亮显示。相反,在列表框中选择一
    项以后,编辑框中将显示这个选择项。
    EDIT 该控件是一个矩形子窗口,用户能在这个窗口中通过
    键盘输入文字。用户选择控件后,输入焦点将赋给此
    控件。当控件显示一个闪烁的插入记号时,就可以输
    入文字。鼠标或笔可以用于移动光标和选择替换的字
    符或者在插入字符处定位光标。
    LISTBOX 指定一个字符串表。应用程序任何时候需要一个名字
    列表(例如:用户查看和选择的文件名)时,可以使
    用这个控件。用户可通过指向某个串点击来选择它。
    当选择了一个串时,此串被高亮度显示,并且发送一
    个通知消息给父窗口。在列表框控件中,可使用垂直
    或水平滚动条,以便在控件窗口中滚动表项。列表框
    将根据需要,自动显示或隐藏滚动条。
    SCROLLBAR 滚动条窗口。此窗口两头有方向箭头,中间有滑块。
    当用户在滚动条上点击时,滚动条就发送一个通知消
    息给它的父窗口。如果需要的话,父窗口负责修改滑
    块。
    STATIC 一个简单的正文控件,可在一个矩形区域显示文本。
    该控件无输入,也不提供输出。
    下面列出了窗口风格和所有的控件风格:
    窗口风格
    风格含义
    WS_BORDER 创建一个有边框的窗口。
    WS_CAPTION 创建一个有标题条的窗口。
    Hopen 图形用户界面API 参考手册108
    WS_CHILD 创建一个子窗口。
    WS_CHILDWINDOW 同WS_CHILD。
    WS_CLIPCHILDREN 当在父窗口中画图时,排除子窗口占
    据的区域。
    WS_CLIPSIBLINGS 当一个子窗口接收到绘图消息时,
    WS_CLIPSIBLINGS 风格剪裁所有
    其它覆盖在要修改的子窗口区域的
    子窗口。
    WS_DISABLED 创建一个开始时被屏蔽的窗口。
    WS_DLGFRAME 用于对话框的窗口。
    WS_GROUP 指定一组控件中的第一个控件,用户
    在这组控件中,通过使用方向键可从
    一个控件移动到下一个控件。所有在
    第一个控件之后用此风格定义的控
    件属于同一组。具有此风格的下一个
    控件终止具有此风格的控制组,并且
    开始下一个控件组。只有对话框使用
    这个风格。
    WS_HSCROLL 创建一个具有水平滚动条的窗口。
    WS_MAXIMIZE 创建一个最大尺寸的窗口。暂未实
    现。
    WS_MAXIMIZEBOX 创建一个带有最大化框的窗口。暂未
    实现。
    WS_MINIMIZE 创建一个最小尺寸的窗口。
    WS_MINIMIZEBOX 创建一个带有最小框的窗口。暂未实
    现。
    WS_NCCHILD 创建一个窗口非客户区的子窗口。
    WS_OEVERLAPPED 创建一个重叠式的窗口。重叠式的窗
    口带有标题和边框。
    Hopen 图形用户界面API 参考手册109
    WS_OVERLAPPEDWINDOW 等同于风格WS_POPUP 、
    WS_CAPTION 、WS_SYSMENU 、
    WS_THICKFRAME 、
    WS_MINIMIZEBOX 、
    WS_MAXIMIZEBOX 的组合。
    WS_POPUP 创建一个弹出式窗口。
    WS_POPUPWINDOW 等同于风格WS_POPUP 、
    WS_BORDER、WS_SYSMENU 的组
    合。
    WS_SYSMENU 创建一个带有标题条中具有系统菜
    单框的窗口。暂未实现。
    WS_TABSTOP 指定任何一个控件,该控件能由用户
    通过TAB 键的移动来选择。TAB 键
    使用户能选择具有WS_TABSTOP
    风格的下一个控件。仅在对话框中使
    用这个风格。
    WS_THICKFRAME 创建一个带有粗边框的窗口,该边框
    可用于改变窗口的大小。
    WS_TOPMOST 使用该风格创建的窗口处于所有窗
    口的最顶层。
    WS_VISIBLE 创建一个初始可见的窗口。此风格适
    用于重叠式窗口和弹出式窗口。
    WS_VSCROLL 创建一个具有垂直滚动条的窗口。
    控件风格
    BUTTON 类
    风格含义
    BS_AUTOCHECKBOX 当用户按动按钮时自动切换状态
    外,与BS_CHECKBOX 相同。
      

  2.   


    BS_AUTORADIOBUTTON 当按钮被选中时,自动移走其它
    按钮上的选中标记。
    BS_AUTO3STATE 除了用户按动按钮时自动切换状
    态外,与BS_3STATE 相同。暂
    未实现。
    BS_CHECKBOX 创建一个带有文本的小矩形。
    BS_DEFPUSHBUTTON 创建一个带粗边框的按钮,该按
    钮标识缺省的用户响应。
    BS_GROUPBOX 创建一个其上方带有标题的矩形
    框,可以用来组合其它控件。
    BS_LEFTTEXT 使文字出现在单选或复选按钮的
    左边,应与BS_CHECKBOX、
    BS_RADIOBUTTON 等组合使
    用。
    BS_OWNERDRAW 创建一个用户自画的按钮。暂未
    实现。
    BS_PUSHBUTTON 创建一个包含给定文字的矩形按
    钮。
    BS_RADIOBUTTON 创建一个小圆形按钮,当用户选
    中按钮时,将在按钮中央显示一
    个圆点来表示按钮的选中。两个
    或多个此按钮组合起来标识互斥
    的选择项,即在任何时候,只能
    选中其中的一个按钮。
    BS_3STATE 除了按钮能被选中又能变灰显示
    之外,与BS_CHECKBOX 相同。
    变灰的状态常用于标识禁止选
    中。
    COMBOBOX 类
    Hopen 图形用户界面API 参考手册111
    风格含义
    CBS_ADDNEWSTRINGS 当组合框中的编辑控件失去焦点或
    键入了回车键时,将自动把编辑控
    件中的文本插入到组合框的列表框
    中。
    CBS_AUTOHSCROLL 当用户在一行的末尾浆入字符时,
    自动将编辑控件中文字向右滚动。
    CBS_HASSTRINGS 一个拥有自画的组合框。暂未支持。
    CBS_DROPDOWN 此风格说明当选中了组合框中编辑
    框右侧的箭头按钮时才显示其列表
    框。
    CBS_DROPDOWNLIST 与CBS_DROPDOWN 相似,并且
    组合框的编辑框中的文本由列表框
    的当前选择项替代。
    CBS_SIMPLE 组合框的列表框一直显示,列表框
    中当前选项显示在组合框的编辑框
    中。
    CBS_SORT 输入列表框的字符串被自动排序。
    CBS_USERSTRINGS 用CB_ADDSTRING 、
    CB_INSERTSTRING 添加字符串
    时,所加入的字串经常是从只读文
    件读出的串或直接定义的常量字符
    串,也可能是应用程序申请的串,
    在ComboBox 删除之前,此串的地
    址一直有效。为了节省内存,并提
    高速度可应用此风格。
    EDIT 类
    风格含义
    Hopen 图形用户界面API 参考手册112
    ES_AUTOHSCROLL 当用户在一行尾部键入一个字符
    时,将自动地向左滚动。用户按下
    ENTER,该控件滚动所有正文回到
    零位置。
    ES_AUTOVSCROLL 用户在最后一行按下ENTER,正文
    将自动地向上滚动一行。
    ES_CENTER 在多行编辑框控件中,文本内容居
    中。
    ES_LEFT 正文左对齐。
    ES_LOWERCASE 将键入编辑框控件中的所有字符转
    换成小写。暂未支持。
    ES_MULTILINE 规定多行编辑框控件(缺省值为单
    行)。
    ES_NOHIDESEL 当控件失去输入焦点时,编辑框控
    件将隐藏选择,当得到输入焦点时,
    反转该选择。
    ES_PASSWORD 当在编辑框控件中输入任何字符
    时,都显示一个’*’(缺省)。可以
    通过EM_SETPASSWORDCHAR
    消息来改变显示的字符。
    ES_READONLY 说明编辑框控件是只读的。
    ES_RIGHT 正文右对齐。
    ES_UNDERLINE 在文本下方带有下划线。
    ES_UPPERCASE 当字符输入到编辑框控件中时,将
    它们转换成大写字母。暂未支持。
    Hopen 图形用户界面API 参考手册113
    ES_WANTRETURN 此风格说明当在对话框的多行编辑
    框控件中输入ENTER 键时,插入
    回车符,否则将与在对话框中按下
    缺省按钮效果相同。此风格仅适用
    与多行编辑框。
    LISTBOX 类
    风格含义
    LBS_BITMAP 此风格将允许在列表框中某项的
    左边显示一个位图。
    LBS_DISABLENOSCROLL 此风格使得当列表框中没有足以
    使得它滚动的列表项时,显示禁
    止的滚动条。如果未设置此风格,
    将隐藏滚动条。
    LBS_HASSTRINGS 指定用户自画的列表框。暂未支
    持。
    LBS_ICON 此风格将允许在列表框中某项的
    左边显示一个图标。暂未支持。
    LBS_MULTICOLUMN 指定一个水平滚动的多栏列表
    框。暂未支持。
    LBS_MULTIPLESEL 允许选择多个列表项。
    LBS_NOREDRAW 当发生变化时,不重新显示列表
    框。暂未支持。
    LBS_NOTIFY 任何时候用户在一个字符串上按
    下鼠标键,父窗口都将接收一个
    输入消息。暂未支持。
    LBS_OWNERDRAWFIXED 由用户自画列表框的内容,列表
    框中的项是等高的。暂未支持。
    LBS_OWNERDRAWVARI
    ABLE
    由用户自画列表框的内容,列表
    框中的项可以不等高。暂未支持。
    Hopen 图形用户界面API 参考手册114
    LBS_SORT 列表框中的项按字母顺序排序。
    LBS_STANDARD 同时具有LBS_NOTIFY 、
    LBS_SORT 风格。
    LBS_USERSTRINGS 同CBS_USERSTRINGS 说明。
    SCROLLBAR 类
    风格含义
    SBS_HORZ 规定一个水平滚动条。
    SBS_VERT 规定一个垂直滚动条。
    STATIC 类
    风格含义
    SS_BITMAP 此风格指出该静态框是位图。
    SS_BLACKFRAME 指定一个带边框的方框,颜色为黑
    色。
    SS_BLACKRECT 指定一个矩形,背景为黑色。
    SS_CENTER 规定一个简单矩形,将给定文字在
    矩形中居中显示。
    SS_GRAYFRAME 指定一个带边框的方框,颜色为灰
    色。
    SS_GRAYRECT 指定一个矩形,背景为灰色。
    SS_ICON 此风格指出该静态框是图标。暂未
    支持。
    SS_LEFT 规定一个简单矩形,将给定文字在
    矩形中居左显示。
    SS_LEFTNOWORDWRAP 规定一个简单矩形,并且在矩形中
    将给定正文左对齐显示。扩展
    TAB 符。暂未支持。
    SS_RIGHT 规定一个简单矩形,将给定文字在
    矩形中居右显示。
    Hopen 图形用户界面API 参考手册115
    SS_SIMPLE 规定一个简单矩形,并且在矩形中
    将给定文本左对齐。正文行不能任
    何方式缩短或者改变。
    SS_WHITEFRAME 指定一个带边框的方框,颜色为白
    色。
    SS_WHITERECT 指定一个矩形,背景为白色。
    CreateWindowEx
    格式定义
    HWND WINAPI CreateWindowEx(DWORD dwExStyle,
    PCSTR pszClassName, PCSTR pszWindowName,
    DWORD dwStyle, int x, int y, int width, int height,
    HWND hwndParent, HMENU hMenu,
    HINSTANCE hInstance, PVOID pParam);
    功能说明
    使用扩展风格创建窗口。
    参数说明
    dwExStyle 指定扩展风格。暂未支持。
    pszClassName 指定要创建的窗口类名,该类名可以是调用
    RegisterClass 函数注册的任何类名,或是预先定
    义好的控件类名。预先定义好的控件类的说明详
    见补充说明部分。
    pszWindowName 如果参数dwStyle 指定的窗口格式中指定了窗口
    具有标题条(WS_CAPTION),本参数指定的内
    容在窗口的标题条中显示。当创建的窗口是按纽、
    编辑框、静态文本等控件时,本参数指定控件中
    的文字。
    Hopen 图形用户界面API 参考手册116
    dwStyle 指定所建窗口的格式。它可以是补充说明部分窗
    口格式表中给出的任何格式的组合或控件格式表
    中给出的控件格式的组合。
    x 指定窗口左上角初始的x 坐标。对于弹出式窗口,
    坐标相对于屏幕的左上角;对于客户区子窗口,
    坐标相对于父窗口的客户区的左上角;对于非客
    户区子窗口,坐标相对于父窗口的非客户区的左
    上角。
    y 指定窗口左上角初始的y 坐标。对于弹出式窗口,
    坐标相对于屏幕的左上角;对于客户区子窗口,
    坐标相对于父窗口的客户区的左上角;对于非客
    户区子窗口,坐标相对于父窗口的非客户区的左
    上角。
    width 指定窗口的宽度。
    height 指定窗口的高度。
    hwndParent 指定要创建窗口的父窗口或拥有者窗口。对于弹
    出式窗口,指定该窗口的拥有者窗口,当拥有者
    窗口被删除时,该窗口也将被删除;对于子窗口,
    指定该子窗口的父窗口,子窗口只能在父窗口的
    相应区域内活动,并随父窗口的删除而删除。如
    果窗口没有父窗口或拥有者窗口,则本参数应设
    置为NULL。
    hMenu 指定菜单或子窗口标识ID,这取决于要创建窗口
    的类型。对于弹出式窗口,本参数指定窗口的菜
    单。对于子窗口,本参数指定窗口的标识ID。
    hInstance 该窗口所属的应用程序实例的句柄。
    pParam 指向一个传递给要创建窗口的结构,这个传递过
    程是通过WM_NCCREATE 和WM_CREATE 消
    息的lParam 参数引用的CREATESTRUCT结构来
    Hopen 图形用户界面API 参考手册117
    完成的。
    返回值
    若创建成功,返回新窗口的句柄,否则,返回NULL。
    功能说明
    返回值
      

  3.   

    CreateWindow
    The CreateWindow function creates an overlapped, pop-up, or child window. It specifies the window class, window title, window style, and (optionally) the initial position and size of the window. The function also specifies the window's parent or owner, if any, and the window's menu. To use extended window styles in addition to the styles supported by CreateWindow, use the CreateWindowEx function. 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
    );
    Parameters
    lpClassName 
    [in] Pointer to a null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. 
    If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names. For a list of system class names, see the Res section. lpWindowName 
    [in] Pointer to a null-terminated string that specifies the window name. 
    If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num". dwStyle 
    [in] Specifies the style of the window being created. This parameter can be a combination of window styles, plus the control styles indicated in the Res section. 

    [in] Specifies the initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner of the parent window's client area. 
    If this parameter is set to CW_USEDEFAULT, the system selects the default position for the window's upper-left corner and ignores the y parameter. CW_USEDEFAULT is valid only for overlapped windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. y 
    [in] Specifies the initial vertical position of the window. For an overlapped or pop-up window, the y parameter is the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left corner of the parent window's client area. For a list box, y is the initial y-coordinate of the upper-left corner of the list box's client area relative to the upper-left corner of the parent window's client area. 
    If an overlapped window is created with the WS_VISIBLE style bit set and the x parameter is set to CW_USEDEFAULT, the system ignores the y parameter. nWidth 
    [in] Specifies the width, in device units, of the window. For overlapped windows, nWidth is either the window's width, in screen coordinates, or CW_USEDEFAULT. If nWidth is CW_USEDEFAULT, the system selects a default width and height for the window; the default width extends from the initial x-coordinate to the right edge of the screen, and the default height extends from the initial y-coordinate to the top of the icon area. CW_USEDEFAULT is valid only for overlapped windows; if CW_USEDEFAULT is specified for a pop-up or child window, nWidth and nHeight are set to zero. 
    nHeight 
    [in] Specifies the height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If nWidth is set to CW_USEDEFAULT, the system ignores nHeight. 
    hWndParent 
    [in] Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows. 
    Windows 2000: To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window. hMenu 
    [in] Handle to a menu, or specifies a child-window identifier depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. 
    hInstance 
    Windows 95/98: [in] Handle to the instance of the module to be associated with the window. 
    Windows NT/2000: This value is ignored. lpParam 
    [in] Pointer to a value to be passed to the window through the CREATESTRUCT structure passed in the lParam parameter the WM_CREATE message. If an application calls CreateWindow to create a multiple document interface (MDI) client window, lpParam must point to a CLIENTCREATESTRUCT structure. 
    Return Values
    If the function succeeds, the return value is a handle to the new window.If the function fails, the return value is NULL. To get extended error information, call GetLastError. This function typically fails for one of the following reasons: 
      

  4.   

    an invalid parameter value 
    the system class was registered by a different module 
    the WH_CBT hook is installed and returns a failure code 
    the window procedure fails for WM_CREATE or WM_NCCREATE 
    Res
    Before returning, CreateWindow sends a WM_CREATE message to the window procedure. For overlapped, pop-up, and child windows, CreateWindow sends WM_CREATE, WM_GETMINMAXINFO, and WM_NCCREATE messages to the window. The lParam parameter of the WM_CREATE message contains a pointer to a CREATESTRUCT structure. If the WS_VISIBLE style is specified, CreateWindow sends the window all the messages required to activate and show the window. For information on controlling whether the Taskbar displays a button for the created window, see Visibility of Taskbar Buttons. The following predefined system classes can be specified in the lpClassName parameter. Note the corresponding control styles you can use in the dwStyle parameter. System class Meaning 
    BUTTON Designates a small rectangular child window that represents a button the user can click to turn it on or off. Button controls can be used alone or in groups, and they can either be labeled or appear without text. Button controls typically change appearance when the user clicks them. For more information, see Buttons. 
    For a table of the button styles you can specify in the dwStyle parameter, see Button Styles.
     
    COMBOBOX Designates a control consisting of a list box and a selection field similar to an edit control. When using this style, an application should either display the list box at all times or enable a drop-down list box. If the list box is visible, typing characters into the selection field highlights the first list box entry that matches the characters typed. Conversely, selecting an item in the list box displays the selected text in the selection field. For more information, see Combo Boxes. 
    For a table of the combo box styles you can specify in the dwStyle parameter, see Combo Box Styles. 
     
    EDIT Designates a rectangular child window into which the user can type text from the keyboard. The user selects the control and gives it the keyboard focus by clicking it or moving to it by pressing the TAB key. The user can type text when the edit control displays a flashing caret; use the mouse to move the cursor, select characters to be replaced, or position the cursor for inserting characters; or use the BACKSPACE key to delete characters. For more information, see Edit Controls. 
    For a table of the edit control styles you can specify in the dwStyle parameter, see Edit Control Styles. 
     
    LISTBOX Designates a list of character strings. Specify this control whenever an application must present a list of names, such as file names, from which the user can choose. The user can select a string by clicking it. A selected string is highlighted, and a notification message is passed to the parent window. For more information, see List Boxes. 
    For a table of the list box styles you can specify in the dwStyle parameter, see List Box Styles. 
     
    MDICLIENT Designates an MDI client window. This window receives messages that control the MDI application's child windows. The recommended style bits are WS_CLIPCHILDREN and WS_CHILD. Specify the WS_HSCROLL and WS_VSCROLL styles to create an MDI client window that allows the user to scroll MDI child windows into view. For more information, see Multiple Document Interface.  
    RichEdit Designates a Rich Edit version 1.0 control. This window lets the user view and edit text with character and paragraph formatting, and can include embedded COM objects. For more information, see Rich Edit Controls. 
    For a table of the rich edit control styles you can specify in the dwStyle parameter, see Rich Edit Control Styles. 
     
    RICHEDIT_CLASS Designates a Rich Edit version 2.0 control. This controls let the user view and edit text with character and paragraph formatting, and can include embedded COM objects. For more information, see Rich Edit Controls. 
    For a table of the rich edit control styles you can specify in the dwStyle parameter, see Rich Edit Control Styles. 
     
    SCROLLBAR Designates a rectangle that contains a scroll box and has direction arrows at both ends. The scroll bar sends a notification message to its parent window whenever the user clicks the control. The parent window is responsible for updating the position of the scroll box, if necessary. For more information, see Scroll Bars. 
    For a table of the scroll bar control styles you can specify in the dwStyle parameter, see Scroll Bar Control Styles. 
     
    STATIC Designates a simple text field, box, or rectangle used to label, box, or separate other controls. Static controls take no input and provide no output. For more information, see Static Controls. 
    For a table of the static control styles you can specify in the dwStyle parameter, see Static Control Styles.
     
    Windows 95: The system can support a maximum of 16,364 window handles.Note  If you specify Windows version 4.x when linking your application, its windows cannot have caption buttons unless they also have window menus. This is not a requirement if you specify Windows version 3.x when linking your application. Requirements 
      Windows NT/2000: Requires Windows NT 3.1 or later.
      Windows 95/98: Requires Windows 95 or later.
      Header: Declared in Winuser.h; include Windows.h.
      Library: Use User32.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.See Also
    Windows Overview, Window Functions, CreateWindowEx, EnableWindow, RegisterClass, RegisterClassEx, ShowWindow, WM_COMMAND, WM_CREATE, WM_GETMINMAXINFO, WM_NCCREATE, WM_PAINT 
      

  5.   

    中文的是一个类似于Window平台的CreateWindow介绍,基本没什么问题,下面的是MSDN
      

  6.   

    哈哈!!我最近刚好正在研究这个问题
    有两本书:VC++应用实战演练,VC6.0类库大全
      

  7.   

    用CreateWindow创建就行了呗,再用vector之类的容器维护一个控件句柄的集合
      

  8.   

    CreateWindowEx()
    跟CreateWindow()差不多
      

  9.   

    CreateWindow()
     bluebohe(薄荷) (MVP) 已经说得很明白了,自己试着用一下吧:)
      

  10.   

    bluebohe(薄荷) (MVP)为什么可以连续回复?