各位高手,小弟是一个刚接触Windows编程的新手,从DOS到Windows的转变我个人认为没有人帮助是一件非常困难的事,以前学过Borland C++,其中只有3种基本数据类型,常见的系统定义的数据结构也非常有限,相关资料解释也比较详细,所以学起来比较轻松,但进入Windows编程以后,里面的很多东西都搞不清了,一段简单的程序也很难看懂,在这里想请各位大侠帮助解释一下Windows编程中的基本数据类型有哪些,常用的数据结构有哪些?比如HWND,我很想知道这究竟是一个什么东西,在哪里定义的?再例如,用Creat函数创建窗口时的风格,究竟有哪些选项,都是什么意思?
对于一个新手来说,基本的东西没有掌握是很难钻研下去的,请大家进来帮忙!
对于一个新手来说,基本的东西没有掌握是很难钻研下去的,请大家进来帮忙!
在Windows中定义了许多的常量,例如窗口风格,应该是一个整数值吧,可不知道是多少位的,另外每一位的名称和作用是什么呢?请多指点!
不管是HANDLE也好,HWND也好,其实只不过是一些基本的数据类型的另外一种定义而已
以HANDLE
是一个刚接触Windows编程的新手,从DOS到Windows的转变我个人认为没有人帮助是一件非常困难的事,以前学过Borland C++,其中只有3种基本数据类型,常见的系统定义的数据结构也非常有限,相关资料解释也比较详细,所以学起来比较轻松,但进入Windows编程以后,里面的很多东西都搞不清了,一段简单的程序也很难看懂,在这里想请各位大侠帮助解释一下Windows编程中的基本数据类型有哪些,常用的数据结构有哪些?比如HWND,我很想知道这究竟是一个什么东西,在哪里定义的?再例如,用Creat函数创建窗口时的风格,究竟有哪些选项,都是什么意思?
对于一个新手来说,基本的东西没有掌握是很难钻研下去的,请大家进来帮忙!
基本的数据类型和C语言都是相同的
不管是HANDLE也好,HWND也好,其实只不过是一些基本的数据类型的另外一种定义而已
以HANDLE为例:
typedef void __RPC_FAR* HANDLE
不管FAR还是_FAR,在Win32下都可以忽略不计
为你的VC安装一个Visual Assist,可以很容易找到它们的定义,工具需要熟悉才行
关键是要掌握一些基础的东西,学习一定要系统
对于Windows窗口风格之类的东西也是需要积累的,功到自然成
MFC Library Reference Window StylesSee Also
Styles Used by MFC | CWnd::Create | CWnd::CreateEx | CreateWindow in the Platform SDK
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_CHILDWINDOW Same as the WS_CHILD 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_ICONIC Creates a window that is initially minimized. Same as the WS_MINIMIZE style.
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_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_SIZEBOX Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
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_TILED Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.
WS_TILEDWINDOW Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_OVERLAPPEDWINDOW style.
WS_VISIBLE Creates a window that is initially visible.
WS_VSCROLL Creates a window that has a vertical scroll bar.
See Also
Styles Used by MFC | CWnd::Create | CWnd::CreateEx | CreateWindow in the Platform SDK--------------------------------------------------------------------------------Send feedback on this topic to Microsoft© Microsoft Corporation. All rights reserved.
也就是一种类型的别名
如
HWND 其实就是一个dword
建议看看windows程序设计