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; } }