WM_PARENTNOTIFY消息

当子窗口被建立,销毁或用户单击鼠标键时,WM_PARENTNOTIFY被发送
使用如下:

LRESULT WINAPI xxx_WndProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
switch(uMsg)
{ HANDLE_MSG(hwnd,WM_PARENTNOTIFY, xxxx_OnParentNotify); }
return( DefWindowProc(hwnd,uMsg,wParam,lParam)); } void xxx_OnParentNotify(HWND hwnd, UINT msg, HWND hwndChild, int idChild) { switch(msg)
{
case WM_RBUTTONDOWN: //when the user clicks the right mouse button over the eidt window, //the system notifies the parent window by sending the //WM_PARENTNOTIFY message.once here ,we enter "peer" mode. break; }
}

更多: http://msdn.microsoft.com/en-us/library/ms632638(v=vs.85).aspx

posted @ 2012-04-28 14:44  likebeta  阅读(6788)  评论(0编辑  收藏  举报