摘抄

1、Windows maintains a "message queue" for each Windows program currently running under Windows. When an input event occurs, Windows translates the event into a "message" that it places in the program's message queue.

         A program retrieves these messages from the message queue bu executing a block of code known as the "message loop".

 

2、A Windows program can contain more than one window procedure. A window procedure is always associates with a particular window class that you register bu calling RegisterClass.

 

3、Programs generally don't call window procedures didectly. The window procedure is almost always called from Windows itself. A program can indirectly call its own window procedure by calling a function named SendMessage.

 

4、The every first message that a window procedure receives is WM_CREATE. WndProc receives this messges while Windows is processing the CreateWindow function in WinMain.

 

5、The second message that WndProc processed is WM_PAINT. This messafe is extremely im[ortant in Windows programming. It informs a program when part or all of the window's client area is "invalid" and must be "updated", which means that it must be redrawn or "painted".

 

6、Whenever the client area becomes invalid, WndProc receives a new WM_PAINT message.

 

7、Remember that one window procedure could be handling messages for multiple Windows that were created based on the same window class. The hwnd parameter lets the window procedure knows which window is receive the message.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值