Windows game Programming Master reading notes

Source: Internet
Author: User

1. Automatically display the identifier of the window: ws_visible. If this identifier is not present, the created window needs to be manually displayed by ShowWindow ().

2, UpdateWindow () produces a WM_PAINT message.

3. The parameter HWND in the message handler function WinProc () only works when multiple windows created with the same window class are used, which indicates which window the message is from.

4. Wm_destroy is generated when the window is closed, this message does not terminate the application, just closes the window. A WM_CLOSE message is generated before this.

5, after each processing of a message, with return (0), to exit WinProc (), and the notification system has processed the message.

6. All parameters passed to WinProc () are included in the MSG struct, and the struct can be captured by getmessage () or PeekMessage () in the message loop.

7. <windowsx.h> contains some useful macros and constants. WIN32_LEAN_AND_MEAN macro hint system does not contain MFC's related things.

8. When a string is loaded as a resource, the length of each line cannot exceed 255 characters (including the constant itself).

9, in addition to the escape sequence "\ n" cannot be placed in the string form, other characters can be, for example:%d, octal code sequence "\015" and so on.

10, int LoadString () loads the string resource, returning the loaded string length.

11, the mouse position is relative to the customer area, excluding boundaries and controls, the mouse is relative to the upper left corner (0,0) coordinates; the mouse key encoding (beginning with mk_) is processed in Wm_mousemove.

12, the function of sending messages by themselves:

LRESULT SendMessage (): Passes a message to the window that requires immediate processing after the receive window finishes processing the message, and the WinProc () function of the receiving window is returned with a return value of WinProc ();

BOOL PostMessage (): Inserts a message sequentially into the message queue, executes when the message is on, that is, there is a delay in the processing of the message that is passed by the function, and if this short delay is not the case, the function can be used to pass the message, and the function is not prone to the message chaos.

...... Keep updating ...

Windows game Programming Master reading notes

Related Article

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.