窗口回调函数

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. 
        返回值指定窗口过程返回的值。尽管它的含义依赖于发送的消息,但是返回值通常被忽略。
        */

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

 

转载于:https://www.cnblogs.com/ssyfj/p/8495295.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值