SendMessage发送消息,不是发送到消息处理函数吗?//为啥不进下面消息处理函数,不退出消息循环?
LRESULTCALLBACKWindowproc(HWNDhWnd,UINTuMsg,WPARAMwParam,LPARAMlParam){switch(uMsg){c...
LRESULT CALLBACK Windowproc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch(uMsg)
{
case WM_CREATE:
SendMessage(hWnd,WM_MYMESSAGE,0,0);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_MYMESSAGE:
MessageBox(hWnd,"WM_MYMESSAGE","Infor",MB_OK);
break;
}
return DefWindowProc(hWnd,uMsg,wParam,lParam);
} 展开
{
switch(uMsg)
{
case WM_CREATE:
SendMessage(hWnd,WM_MYMESSAGE,0,0);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_MYMESSAGE:
MessageBox(hWnd,"WM_MYMESSAGE","Infor",MB_OK);
break;
}
return DefWindowProc(hWnd,uMsg,wParam,lParam);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询