1. WNDCLASS属性style取值:
  2. CS_GLOBALCLASS--应用程序全局窗口类
  3. CS_BYTEALIGNCLIENT--窗口客户区的水平位置8倍数对齐
  4. CS_BYTEALIGNWINDOW--窗口的水平位置8倍数对齐
  5. CS_HREDRAW--当窗口水平变化时,窗口重新绘制
  6. CS_VREDRAW--当窗口垂直变化时,窗口重新绘制
  7. CS_CLASSDC--该类型的窗口,都是有同一个绘图(DC)设备
  8. CS_PARENTDC--该类型的窗口,使用他的父窗口的绘图(DC)设备
  9. CS_OWNDC--该类型的窗口,每个窗口都使用自己的绘图(DC)设备
  10. CS_SAVEBITS--允许窗口保存成图(位图),提高窗口的绘图效率,但是耗费内存资源
  11. CS_DBLCLKS--允许窗口接收鼠标左键双击
  12. CS_NOCLOSE--窗口没有关闭按钮
  1. CreateWindow实现原理
  2. .系统根据传入的窗口类名称,在应用程序局部窗口类中查找,如果找到执行步骤2,如果未找到,执行步骤3
  3. .比较局部窗口类与创建窗口时传入的HINSTANCE变量,如果发现相等,创建和注册窗口类在同一模块,创建窗口返回,如果不相等,继续执行步骤3
  4. .在应用程序全局窗口类,如果找到,执行步骤4,如果未找到执行步骤5
  5. .使用找到的窗口类的信息,创建窗口返回。
  6. .在系统窗口类中查找,如果找到创建窗口返回,否则创建窗口失败。
  1. HWND CreateWindowEx(
  2. DWORD dwExStyle,//窗口的扩展风格
  3. LPCTSTR lpClassName,//已经注册的窗口类名称
  4. LPCTSTR lpWindowName,//窗口标题栏名字
  5. DWORD dwStyle,//窗口的基本风格
  6. int x,//窗口左上角水平坐标位置
  7. int y,//窗口左上角垂直坐标位置
  8. int nWidth,//窗口的宽度
  9. int nHeight,//窗口的高度
  10. HWND hWndParent,//窗口的父窗口句柄
  11. HMENU hMenu,//窗口菜单句柄
  12. HINSTANCE hInstance,//应用程序实例句柄
  13. LPVOID lpParam//窗口创建时附加参数
  14. );创建成功返回窗口句柄
  1. WS_BORDER--The window has a thin-line border.(主体与边框间存在黑色边界线)
  2.  
  3. WS_CAPTION--The window has a title bar (includes the WS_BORDER style).(标题栏风格)
  4.  
  5. WS_CHILD--The window is a child window. A window with this style cannot have a menu bar.
    This style cannot be used with the WS_POPUP style.(子窗口风格-子窗口必须使用该风格,并且父窗口句柄必须有值)
  6.  
  7. WS_CHILDWINDOW--Same as the WS_CHILD style.
  8.  
  9. WS_CLIPCHILDREN--Excludes the area occupied by child windows when drawing occurs within the parent window.
    This style is used when creating the parent window.(切割窗口)
  10.  
  11. WS_CLIPSIBLINGS--Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message,
    the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.
    If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window,
    to draw within the client area of a neighboring child window.(切割窗口)
  12.  
  13. WS_DISABLED--The window is initially disabled. A disabled window cannot receive input from the user.
    To change this after a window has been created, use the EnableWindow function.(窗口不可用)
  14.  
  15. WS_DLGFRAME--The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.(对话框)
  16.  
  17. WS_GROUP--The window is the first control of a group of controls. The group consists of this first control and all controls defined after it,
    up to the next control with the WS_GROUP style.
    The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group.
    The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.
  18. You can turn this style on and off to change dialog box navigation.
    To change this style after a window has been created, use the SetWindowLong function.(分组风格,两窗口互斥,类似于单选框)
  19.  
  20. WS_HSCROLL--The window has a horizontal scroll bar.(水平滚动条)
  21.  
  22. WS_ICONIC--The window is initially minimized. Same as the WS_MINIMIZE style.(窗口创建出来,处于最小化状态)
  23.  
  24. WS_MAXIMIZE--The window is initially maximized.(窗口创建出来,处于最大化状态)
  25.  
  26. WS_MAXIMIZEBOX--The window has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style.
    The WS_SYSMENU style must also be specified.(窗口有最大化按钮)
  27.  
  28. WS_MINIMIZE--The window is initially minimized. Same as the WS_ICONIC style.
  29.  
  30. WS_MINIMIZEBOX--The window has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style.
    The WS_SYSMENU style must also be specified.(窗口有最小化按钮)
  31.  
  32. WS_OVERLAPPED--The window is an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.(交叠窗口)
  33.  
  34. WS_OVERLAPPEDWINDOW
  35. (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
  36. The window is an overlapped window. Same as the WS_TILEDWINDOW style.
  37.  
  38. WS_POPUP--The windows is a pop-up window. This style cannot be used with the WS_CHILD style.(弹出对话框风格)
  39.  
  40. WS_POPUPWINDOW
  41. (WS_POPUP | WS_BORDER | WS_SYSMENU)
  42. The window is a pop-up window. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.(弹出对话框风格)
  43.  
  44. WS_SIZEBOX--The window has a sizing border. Same as the WS_THICKFRAME style.(可改变窗口大小的边框)
  45.  
  46. WS_SYSMENU--The window has a window menu on its title bar. The WS_CAPTION style must also be specified.(系统菜单)
  47.  
  48. WS_TABSTOP
  49. The window is a control that can receive the keyboard focus when the user presses the TAB key.
    Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
  50. You can turn this style on and off to change dialog box navigation.
    To change this style after a window has been created, use the SetWindowLong function.
    For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function.(可以用tab键切换)
  51.  
  52. WS_THICKFRAME--The window has a sizing border. Same as the WS_SIZEBOX style.
  53.  
  54. WS_TILED--The window is an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.
  55.  
  56. WS_TILEDWINDOW
  57. (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)
  58. The window is an overlapped window. Same as the WS_OVERLAPPEDWINDOW style.
  59.  
  60. WS_VISIBLE
  61. The window is initially visible.
  62. This style can be turned on and off by using the ShowWindow or SetWindowPos function.(显示窗口,一般应用于子窗口)
  63.  
  64. WS_VSCROLL--The window has a vertical scroll bar.(垂直滚动条窗口)

Windoows窗口程序二的更多相关文章

  1. Windoows窗口程序五

    程序执行机制 过程驱动-程序的执行过程是按照预订好的顺序执行. 事件驱动-程序的执行是无序,用户可以根据需要随机触发相应的事件. Win32窗口程序就是采用事件驱动方式执行,也就是消息机制. 当系统通 ...

  2. Windoows窗口程序一

    编写窗口程序的步骤: .定义WinMain入口函数 .定义窗口处理函数(处理消息)WindowProc .注册窗口类RegisterClass .创建窗口(在内存中创建窗口)CreateWindow ...

  3. Windoows窗口程序七

    WM_QUIT--用于结束消息循环处理 wParam - PostQuitMessage函数传递的参数 lParam - 不使用 当GetMessage收到这个消息后,会返回false,结束while ...

  4. Windoows窗口程序六

    #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stri ...

  5. Windoows窗口程序四

    子窗口的创建 .创建时要设置父窗口句柄 .创建风格要增加WS_CHILD|WS_VISIBLE HWND CreateChild(LPSTR lpClassName,LPSTR lpWndName,H ...

  6. Windoows窗口程序三

    #include <stdio.h> #include <stdlib.h> #include <string.h> #include <windows.h& ...

  7. Windows程序设计笔记(二) 关于编写简单窗口程序中的几点疑惑

    在编写窗口程序时主要是5个步骤,创建窗口类.注册窗口类.创建窗口.显示窗口.消息环的编写.对于这5个步骤为何要这样写,当初我不是太理解,学习到现在有些问题我基本上已经找到了答案,同时对于Windows ...

  8. QT源码解析(一) QT创建窗口程序、消息循环和WinMain函数

    QT源码解析(一) QT创建窗口程序.消息循环和WinMain函数 分类: QT2009-10-28 13:33 17695人阅读 评论(13) 收藏 举报 qtapplicationwindowse ...

  9. 32位汇编第二讲,编写窗口程序,加载资源,响应消息,以及调用C库函数

    32位汇编第二讲,编写窗口程序,加载资源,响应消息,以及调用C库函数 (如果想看所有代码,请下载课堂资料,里面有所有代码,这里会讲解怎么生成一个窗口程序) 一丶32位汇编编写Windows窗口程序 首 ...

随机推荐

  1. python练习笔记——求三位的水仙花数

    百位数的立方 + 十位数的立方 +个位数的立方 = 原数 for m in range(1,10): for n in range(0,10): for i in range(0,10): a = m ...

  2. PLSQL_统计信息系列03_统计信息的收集

    20150506 Created By Baoxinjian

  3. Python 字典 keys() 方法

    描述 Python 字典 keys() 方法以列表形式(并非直接的列表,若要返回列表值还需调用list函数)返回字典中的所有的键. 语法 keys() 方法语法: D.keys() 参数 无. 返回值 ...

  4. DevExpress控件之"XtraForm——窗体"

    1.AutoScaleMode:确定当屏幕分辨率或字体更改时窗体或控件将如何缩放. Dpi:根据显示分辨率控制缩放.常用分辨率为96和120Dpi: Font:根据类使用的字体(通常为系统字体)的维度 ...

  5. ps减去图层混合模式

    ps减去图层混合模式 CMYK 1.1.青色作为基色,品红作为混合色(减去混合模式) 红反即青色(绿色+蓝色) - 绿反即品红色(红色+蓝色)= 绿色   公式简化: 绿色 + 蓝色 - 红色 - 蓝 ...

  6. 大数问题:求n的阶乘

    题目:求100! 这看起来是一个非常简答的问题,递归解之毫无压力 int func(int n){ if(n <= 1) return 1; else return n*func(n-1); } ...

  7. Sqlite 常用函数推荐

    Sqlite 常用函数 1 .打开数据库: 说明:打开一个数据库,文件名不一定要存在,如果此文件不存在, sqlite 会自动创建.第一个参数指文件名,第二个参数则是定义的 sqlite3 ** 结构 ...

  8. U3D-LookAt插值动画

    var qua = Quaternion.FromToRotation(Vector3.forward, target.transform.position - transform.position) ...

  9. Oracle PLSQL Demo - 19.管道function[查询整表组成list管道返回]

    create or replace function function_demo RETURN emp PIPELINED as Type ref_cur_emp IS REF CURSOR RETU ...

  10. flask celery 使用方法

    一.安装 由于celery4.0不支持window,如果在window上安装celery4.0将会出现下面的错误flask_clery 你现在只能安装pip install celery==3.1 二 ...