码迷,mamicode.com
首页 > 其他好文 > 详细

窗口回调函数

时间:2018-03-02 23:11:36      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:proc   传参   amp   dep   point   ram   指定   mes   color   

1.传参

/*
WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
和
typedef struct tagMSG {
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
} MSG, *PMSG;

前四个参数一致

操作系统直接使用msg前四位作为参数传入窗口回调函数
*/

2.返回值(必须返回,会被作为dispatchmessage函数的返回值)

The return value specifies the result of the message processing and depends on the message sent. 

返回值指定消息处理的结果,并取决于所发送的消息。

     //此处分发消息,调用消息回调函数,
        //同时消息回调函数的返回值作为DIspatchMessage的返回值返回,
        //一般讲这个返回值忽略
        DispatchMessage(&msg);
        /*
        The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored. 
        返回值指定窗口过程返回的值。尽管它的含义依赖于发送的消息,但是返回值通常被忽略。
        */

所以说在窗口过程函数中的返回值必须要有

 

窗口回调函数

标签:proc   传参   amp   dep   point   ram   指定   mes   color   

原文地址:https://www.cnblogs.com/ssyfj/p/8495295.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!