Windows data types explore - thousands of times to do you? (1)

zhaozj2021-02-16  39

Windows Data Types

Windows data type

The various data types supported by the Microsoft Windows operating system are used to define the return values, functions, and messages of the function and the structural members (because the Win32 program is written in C language, so there is no "class" concept) . These data types define the size of the above elements (in memory, that is, the number of bytes of memory) and meanings. The author has never pays too much attention to these things, and the results can be described as difficult in programming. Different types of regular / variables are far from the role of the program, understand these types, which is very useful for the working principle of the profile program. Today is the weekend, I will listed these types, then put them "original shape" - is it very similar to "immersing mirror".

The following table includes these types: character type (Integer), integer type (Integer), logical value (Boolean, brothers on the strait like "cloth type", boolean, pointer type (Pointer) , Handle type (HANDLE). Among them, the character type, integer type, and logical value (Boolean) type are common in C language compiler, which is the same as the standard C language. Most pointer types begin with P (Pointer) or LONTER. "Handle" refers to a resource that is loaded into memory (essentially refers to a unique number within a certain range).

Below this table is what I combined with the information in MSDN, because I am also a beginner, but I'm still rough, please correct more :)

Windows Data Type Essential Type Number Direction Process (Card) Meaning AtomunSigned Short2unSigned Short → Word → Atom In the Atom table, one key (16-bit integer) a value (a string) is an Atom. Boolint * int → BOOL logic variable, Boolean value (value true or false) Booleanunsigned char1unsigned char → BYTE → Boolean logic variable, Boolean (value true or false) ByteunSigned char1unsigned char → Byte byte type, 8 bits.

CALLBACK__stdcall call __stdcall → CALLBACK callback function calling convention CHARchar1char → CHAR8 bit Windows character (ANSI) COLORREFunsigned long4unsigned long → DWORD → COLORREF red, green and blue (RGB) values ​​CONSTconst keyword const → CONST constant CRITICAL_SECTIONRTL_CRITICAL_SECTION structure? RTL_CRITICAL_SECTION (structure ) → CRITICAL_SECTIONCritical-section objects DWORDunsigned long4unsigned long → DWORD32 bit unsigned integer DWORD_PTRunsigned long4unsigned long → ULONG_PTR → DWORD_PTR (there is an alternative path) slightly ...... (use big, but too long) DWORD32unsigned int * unsigned int → DWORD3232 median unsigned integer DWORD64unsigned __int648unsigned __int64 → DWORD6464 bit unsigned integer to floating-point variables HACCELHACCEL__ FLOATfloat4float → fLOAT handle structure pointer pointed to by the pointer structure HACCEL__ shortcut DECLARE_HANDLE (name) macro definition list HANDLEvoid * (address) void * → HBitmaphbitmap__ structural pointer is defined by the declare_handle (name) macro, the HBrushhbrush__ structure pointer is defined by the DECLARE_HANDLE (Name) macro ...... Handle HCONVHCONV__ structure The body pointer is defined by the declare_handle (name) macro ... Dynamic Data Exchange (DDE) Session Handle HConvlisthconvlist__ Structure Pointer> Declare_HAME (Name) Macro Definition ... Dynamic Data Exchange (DDE) Handle HcURSorhicon__ Structure Pointer Hicon__ * → HICON → HCURSOR cursor handle HDCHDC__ structural pointer is defined by declare_handle (name) macro ... Device context (DC) handle HDDedataHDDedata__ structure The pointer is defined by declare_handle (name) macro ... Dynamic data exchange data Handle HDeskHDesk__ structure pointer is defined by declare_handle (name) macro ... Desktop (Desktop) HDROPHDROP__ structure pointer is defined by Declare_HAME (Name) macro ... handle to an internal drop structure.HDWPvoid ​​* (address) void * → hANDLE → HDWPHandle to a deferred window position structure.HENHMETAFILEHENHMETAFILE__ structure pointer DECLARE_HANDLE (name) is defined by the macro ...... enhanced metafile handle HFILEint * int → Hfile The handle of the file opened by OpenFile. HFONTHFONT__ Structure pointer is defined by declare_handle (name) macro ... The handle of the font handle HgDiobjvoid Near * Void Near * → HgDiobjGDi Object handle HGLOBALVOID * (an address)

转载请注明原文地址:https://www.9cbs.com/read-22060.html

New Post(0)