Common data types for Windows programming

Source: Internet
Author: User

Windows data type:

WORD:16-bit unsigned shaping data

dword:32 bit unsigned integer data (DWORD32)

dword64:64 bit unsigned integer data

INT:32-bit signed integer data type

INT_PTR: pointer type pointing to int data type

int32:32 bit symbol integral type

int64:64 bit symbol integral type

UINT: Unsigned int

PVOID: Normal Hands

long:32 bit symbol integral type (LONG32)

ULONG: unsigned long

longlong:64 bit symbol integral type (LONG64)

Short: unsigned shorter (16-bit)

LPARAM: L parameter of message

WPARAM: The W parameter of the message

HANDLE: The handle of the object, the most basic handle type

Hicon: Handle to Icon

HINSTANCE: Handle to a program instance

HKEY: Handle to registry key

HMODULE: Handle to Module

HWND: Handle to Window

LPSTR: A character pointer, which is a string variable

LPCSTR: String Constants

LPCTSTR: Depending on the environment configuration, if a Unicode macro is defined, it is the LPCWSTR type, otherwise the LPCSTR type

Lpcwstr:unicode string Constants

Lpdword: Pointer to DWORD type data

Char:8 bit bytes

TCHAR: WCHAR If Unicode is defined, otherwise char

UCHAR: unsigned char

WCHAR:16-bit Unicode characters

BOOL: Boolean variable

BYTE: Byte type (8 bit)

Const: constant

float: Floating-point data type

SIZE_T: Represents the memory size, in bytes, whose maximum is the maximum address range of the CPU

void: untyped, equivalent to void in the standard C language

-Windows data type naming laws

The basic data types are: BYTE, CHAR, WORD, short, int, and so on.

The command mode of a pointer type is typically "LP" or "P" before the type of data it points to, such as a pointer to a DWORD of type "Lpdword" and "Pdword"

The various handle types are typically named "H" in front of the object name, such as the corresponding handle type for the bitmap (BITMAP) is "Hbitmap".

Unsigned types typically start with "U", for example, "INT" is a symbol type, "UINT" is an unsigned type

According to these naming laws and their own experience to see some of the data types you have not seen, you can know the meaning of its representative

Windows data types-relationships between Windows data types and standard C data types

C data types are redefined by type. If the DWORD is essentially the unsigned long data type, the 32-bit unsigned integer.
The handle type that is often used is essentially an untyped pointer void,handle defined as:

Typedof PVOID HANDLE;

Handle is actually a pvoid, what is pvoid?

Typeof void *pvoid;

PVOID is a pointer to void.


Common data types for Windows programming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.