Basic Windows Data Types (Part 1)

Source: Internet
Author: User

Data types used by Windows

Corresponding Basic Data Type

Description

Bool

Bool

Boolean Value

BSTR

Unsigned short *

32-bit character pointer

Byte

Unsigned char

8-bit unsigned integer

Colorref

Unsigned long

Used as a 32-bit color value

DWORD

Unsigned long

32-bit unsigned integer, segment address and related offset

Long

Long

32-bit signed integer

Lparam

Long

The 32-bit value passed as a parameter to the window process or callback function.

Lpcstr

Const char *

32-bit pointer to a String constant

Lpstr

Char *

32-bit pointer to a string

Lpvoid

Void *

Point to a 32-bit pointer of undefined type

Lresult

Long

32-bit return values from window procedures or callback Functions

Uint

Unsigned int

32-bit unsigned integer

Word

Unsigned short

16-bit unsigned integer

Wparam

Unsigned int

The 32-bit value passed to the window process or callback function as a parameter.

Note:

1. These data types are represented by uppercase letters, which are different from the general C ++ basic data types.

2. If the data type prefix is P or lp, it indicates that the data type is a pointer or long pointer. If the prefix is u, the data type is unsigned, and so on.

3. Windows also provides some macros to process the above basic data types. For example, lobyte and hibyte are used to obtain the low-byte and high-byte values in 16-bit values, and loword and hiword are respectively used to obtain the low-byte and high-byte values in 32-bit values; makeword combines two 16 unsigned values into a 32-bit unsigned value.

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.