Windows programming notes 7

Source: Internet
Author: User

1. When a Windows programmer starts, he always copies a piece of code and makes corresponding modifications.
2. Constant prefix note:
CS -- class stye CW -- create window DT -- draw text

IDI -- id of icon IDC -- id of cursor MB -- MessageBox
SND -- sound WM -- window message ws -- window style
Wparam -- wcharparam (16bit) lparam -- longparam (32bit) is a 16-bit system by default, while in 32-bit systems, both are 32bit, W is meaningless
Lresult -- longresult
# Define callback _ stdcall
Hinstance -- handle of instance hwnd -- handle of window HDC -- handle of device content 32bit

3. registerclass and then createwindow Based on the classname in wndclass. The classname attribute at the end of wndclass reduces its importance and makes it easy to forget, at least at the beginning.
4.32bit systems do not need to judge hprevinstance, while 16 bit systems need to save memory.
5. Do you understand that all windows are subwindows or indirect subwindows of desktop windows?
6. updatewindow (hwnd) sends the wm_paint message to hwnd.
7. wm_quit causes getmessage to return 0 and the message loop ends. Postquitmessage is usually used to send wm_quit messages to the message queue in response to wm_destroy. Why not send wm_quit messages directly? In this case, you cannot perform any other operations before the program is closed. The wm_destroy response function can be used for program cleanup.
8. traslatemsg performs keyboard conversion, dispatchmsg delivers the message to the window, and the window delivers it to the appropriate message processing function.
9. What the windows program does is to process the messages sent to the window in response.
10. Windows will send the wm_create message to the window after creation, rather than the response function of the wm_create message that has been subconsciously misunderstood before to create windows.
11. Message loops and window processes are not performed concurrently.
12. defwndproc is also part of your window.

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.