才鸟问题:这些都是哪里的?

SPT 2001-08-18 01:19:01
我最近在看一本书,里面有一些我看不明白,比如一些“HANDLE”,“DWORD”,“BOOL”,“HWND”等等。在这本书上也找不到对这些的说明,请问这些东西都是哪里的?哪里可以找到对他们的介绍?谢谢!
...全文
120 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
SPT 2001-08-21
  • 打赏
  • 举报
回复
gf
SPT 2001-08-19
  • 打赏
  • 举报
回复
MSDN还不太会用,不好意思:)
sanjiang 2001-08-18
  • 打赏
  • 举报
回复
MSDN有详细说明。
SPT 2001-08-18
  • 打赏
  • 举报
回复
非常感谢!
prog_st 2001-08-18
  • 打赏
  • 举报
回复
Data Types
This topic lists the data types most commonly used in the Microsoft Foundation Class Library. Most of the data types are exactly the same as those in the Windows Software Development Kit (SDK), while others are unique to MFC.

Commonly used Windows SDK and MFC data types are as follows:

BOOL A Boolean value.


BSTR A 32-bit character pointer.


BYTE An 8-bit integer that is not signed.


COLORREF A 32-bit value used as a color value.


DWORD A 32-bit unsigned integer or the address of a segment and its associated offset.


LONG A 32-bit signed integer.


LPARAM A 32-bit value passed as a parameter to a window procedure or callback function.


LPCSTR A 32-bit pointer to a constant character string.


LPSTR A 32-bit pointer to a character string.


LPCTSTR A 32-bit pointer to a constant character string that is portable for Unicode and DBCS.


LPTSTR A 32-bit pointer to a character string that is portable for Unicode and DBCS.


LPVOID A 32-bit pointer to an unspecified type.


LRESULT A 32-bit value returned from a window procedure or callback function.


UINT A 16-bit unsigned integer on Windows versions 3.0 and 3.1; a 32-bit unsigned integer on Win32.


WNDPROC A 32-bit pointer to a window procedure.


WORD A 16-bit unsigned integer.


WPARAM A value passed as a parameter to a window procedure or callback function: 16 bits on Windows versions 3.0 and 3.1; 32 bits on Win32.
Data types unique to the Microsoft Foundation Class Library include the following:

POSITION A value used to denote the position of an element in a collection; used by MFC collection classes.


LPCRECT A 32-bit pointer to a constant (nonmodifiable) RECT structure.

--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.


Platform SDK: Win32 API
Data Types
The data types supported by the Microsoft® Win32® API are used to define function return values, function and message parameters, and structure members. They define the size and meaning of these elements

The following table contains the following types: character, integer, Boolean, pointer, and handle. The character, integer, and Boolean types are common to most C compilers. Most of the pointer-type names begin with a prefix of P or LP. Handles refer to a resource that has been loaded into memory.

Type Definition
ATOM Atom (a reference to a character string in an atom table).
BOOL Boolean variable (should be TRUE or FALSE).
BOOLEAN Boolean variable (should be TRUE or FALSE).
BYTE Byte (8 bits).
CALLBACK Calling convention for callback functions.
CHAR 8-bit Windows (ANSI) character. For more information, see Character Sets Used By Fonts.
COLORREF Red, green, blue (RGB) color value (32 bits). See COLORREF for information on this type.
CONST Variable whose value is to remain constant during execution.
CRITICAL_SECTION Critical-section object.
CTRYID Country/region identifier.
DWORD 32-bit unsigned integer.
DWORD_PTR Unsigned long type for pointer precision. Use when casting a pointer to a long type to perform pointer arithmetic.
DWORD32 32-bit unsigned integer.
DWORD64 64-bit unsigned integer.
FLOAT Floating-point variable.
FILE_SEGMENT_ELEMENT 64-bit pointer to a buffer.
HACCEL Handle to an accelerator table.
HANDLE Handle to an object.
HBITMAP Handle to a bitmap.
HBRUSH Handle to a brush.
HCOLORSPACE Handle to a logical color space.
HCONV Handle to a dynamic data exchange (DDE) conversation.
HCONVLIST Handle to a DDE conversation list.
HCURSOR Handle to a cursor.
HDC Handle to a device context (DC).
HDDEDATA Handle to DDE data.
HDESK Handle to a desktop.
HDROP Handle to an internal drop structure.
HDWP Handle to a deferred window position structure.
HENHMETAFILE Handle to an enhanced metafile.
HFILE Handle to a file opened by OpenFile, not CreateFile.
HFONT Handle to a font.
HGDIOBJ Handle to a GDI object.
HGLOBAL Handle to a global memory block.
HHOOK Handle to a hook.
HICON Handle to an icon.
HIMAGELIST Handle to an image list.
HIMC Handle to input context.
HINSTANCE Handle to an instance.
HKEY Handle to a registry key.
HKL Input locale identifier.
HLOCAL Handle to a local memory block.
HMENU Handle to a menu.
HMETAFILE Handle to a metafile.
HMODULE Handle to a module.
HMONITOR Handle to a display monitor.
HPALETTE Handle to a palette.
HPEN Handle to a pen.
HRGN Handle to a region.
HRSRC Handle to a resource.
HSZ Handle to a DDE string.
HWINSTA Handle to a window station.
HWND Handle to a window.
INT 32-bit signed integer.
INT_PTR Signed integral type for pointer precision. Use when casting a pointer to an integer to perform pointer arithmetic.
INT32 32-bit signed integer.
INT64 64-bit signed integer.
IPADDR IP address. To convert this value to the "a.b.c.d" string form of an IP address, map the high-order byte to a, the low-order byte to d, and so on.
IPMASK Subnet mask. Uses the same format as IPADDR.
LANGID Language identifier. For more information, see Locales.
LCID Locale identifier. For more information, see Locales.
LCSCSTYPE Color space type.
LCSGAMUTMATCH Gamut-matching method.
LCTYPE Locale information type. For a list, see Locale and Language Information
LONG 32-bit signed integer.
LONG_PTR Signed long type for pointer precision. Use when casting a pointer to a long to perform pointer arithmetic.
LONG32 32-bit signed integer.
LONG64 64-bit signed integer.
LONGLONG 64-bit signed integer.
LPARAM Message parameter.
LPBOOL Pointer to a BOOL.
LPBYTE Pointer to a BYTE.
LPCOLORREF Pointer to a COLORREF value.
LPCRITICAL_SECTION Pointer to a CRITICAL_SECTION.
LPCSTR Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
LPCTSTR An LPCWSTR if UNICODE is defined, an LPCSTR otherwise.
LPCVOID Pointer to a constant of any type.
LPCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
LPDWORD Pointer to a DWORD.
LPHANDLE Pointer to a HANDLE.
LPINT Pointer to an INT.
LPLONG Pointer to a LONG.
LPSTR Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
LPTSTR An LPWSTR if UNICODE is defined, an LPSTR otherwise.
LPVOID Pointer to any type.
LPWORD Pointer to a WORD.
LPWSTR Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
LRESULT Signed result of message processing.
LUID Locally unique identifier.
PBOOL Pointer to a BOOL.
PBOOLEAN Pointer to a BOOL.
PBYTE Pointer to a BYTE.
PCHAR Pointer to a CHAR.
PCRITICAL_SECTION Pointer to a CRITICAL_SECTION.
PCSTR Pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
PCTSTR A PCWSTR if UNICODE is defined, a PCSTR otherwise.
PCWCH Pointer to a constant WCHAR.
PCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
PDWORD Pointer to a DWORD.
PFLOAT Pointer to a FLOAT.
PHANDLE Pointer to a HANDLE.
PHKEY Pointer to an HKEY.
PINT Pointer to an INT.
PLCID Pointer to an LCID.
PLONG Pointer to a LONG.
PLUID Pointer to a LUID.
POINTER_32 32-bit pointer. On a 32-bit system, this is a native pointer. On a 64-bit system, this is a truncated 64-bit pointer.
POINTER_64 64-bit pointer. On a 64-bit system, this is a native pointer. On a 32-bit system, this is a sign-extended 32-bit pointer.
PSHORT Pointer to a SHORT.
PSTR Pointer to a null-terminated string of 8-bit Windows (ANSI) characters. For more information, see Character Sets Used By Fonts.
PTBYTE Pointer to a TBYTE.
PTCHAR Pointer to a TCHAR.
PTSTR A PWSTR if UNICODE is defined, a PSTR otherwise.
PUCHAR Pointer to a UCHAR.
PUINT Pointer to a UINT.
PULONG Pointer to a ULONG.
PUSHORT Pointer to a USHORT.
PVOID Pointer to any type.
PWCHAR Pointer to a WCHAR.
PWORD Pointer to a WORD.
PWSTR Pointer to a null-terminated string of 16-bit Unicode characters. For more information, see Character Sets Used By Fonts.
REGSAM Security access mask for registry key.
SC_HANDLE Handle to a service control manager database.
SC_LOCK Handle to a service control manager database lock.
SERVICE_STATUS_HANDLE Handle to a service status value.
SHORT Short integer (16 bits).
SIZE_T The maximum number of bytes to which a pointer can point. Use for a count that must span the full range of a pointer.
SSIZE_T Signed SIZE_T.
TBYTE A WCHAR if UNICODE is defined, a CHAR otherwise.
TCHAR A WCHAR if UNICODE is defined, a CHAR otherwise.
UCHAR Unsigned CHAR.
UINT Unsigned INT.
UINT_PTR Unsigned INT_PTR.
UINT32 Unsigned INT32.
UINT64 Unsigned INT64.
ULONG Unsigned LONG.
ULONG_PTR Unsigned LONG_PTR.
ULONG32 Unsigned LONG32.
ULONG64 Unsigned LONG64.
ULONGLONG 64-bit unsigned integer.
UNSIGNED Unsigned attribute.
USHORT Unsigned SHORT.
VOID Any type.
WCHAR 16-bit Unicode character. For more information, see Character Sets Used By Fonts.
WINAPI Calling convention for the Win32 API.
WORD 16-bit unsigned integer.
WPARAM Message parameter.



Platform SDK Release: February 2001 Contact Platform SDK Order a Platform SDK CD Online


tryibest 2001-08-18
  • 打赏
  • 举报
回复
gz
SPT 2001-08-18
  • 打赏
  • 举报
回复
有关于这方面的电子书籍吗?查找起来比较方便一些。
SPT 2001-08-18
  • 打赏
  • 举报
回复
C++里有介绍吗?
yyz_xyz 2001-08-18
  • 打赏
  • 举报
回复
“HANDLE”,“DWORD”,“BOOL”,“HWND”这些都东西都是用typedef来定义过的,一般都是int 或long型的。 在windef.h里都会有它们的定义的。
这样吧,你在可以在先定义它们的类型,然后选到"DWORD"用右键选择"goto definition DWORD",然后VC会就要你重新编译,编译完后你可以看到它们是什么类型的了
newsoftman 2001-08-18
  • 打赏
  • 举报
回复
变量类型
claider 2001-08-18
  • 打赏
  • 举报
回复
《windwos程序设计》
SPT 2001-08-18
  • 打赏
  • 举报
回复
怎么没人理我?:(

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧