5. Additional data for window classes and windows

Source: Internet
Author: User

The role of additional data:

When registering a window, setting the size of these two data can provide the window class and the window to store their own data space.

1. Window class additional data

int Cbclsextra//window class additional data buff size

(1) Usage:

A. Application buffer

The Window object. Cbclsextra = 200; Multiples of 4 are generally assigned

B. Writing data

DWORD Setclasslong (

HWND hwnd; Window handle

int nIndex; BYTE index number (from which byte to save)

LONG Dwnewlong; The data deposited

);

C. Reading data

DWORD Getclasslong (

HWND hwnd; Window handle

int nIndex; BYTE index number (from which byte to begin reading)

)///return value gets the read data

2. Window Append Data buffer

int Cbwndextra//window additional data buff size

(1) Usage:

A. Application buffer

The Window object. Cbwndextra = 200; It's usually a multiple of 4.

A. Writing data

LONG SetWindowLong (

HWND hwnd; Window handle

int nIndex; BYTE index number (from which byte to save)

LONG Dwnewlong; Data being written

);

C. Reading data

LONG GetWindowLong (

HWND hwnd; Window handle

int nIndex; BYTE index number (from which byte to begin reading)

);//The return value is the read data

3. Differences

Window class Append Data buffer: is a buffer that is shared by all windows that are created based on the window class.

Window Append Data buffer: Is the window's own private buffer, even if it is based on the same window class created by the window, do not share with each other.

5. Additional data for window classes and windows

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.