WM_PARENTNOTIFY

来源:互联网 发布:java 日志分析框架 编辑:程序博客网 时间:2024/05/17 01:16

当子窗口被建立,销毁或用户单击鼠标键时,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;   
 }

}

原创粉丝点击