1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| class CWin
{
public:
static const UINT MSG_GET_ME;
protected:
HWND m_hWnd;
virtual LRESULT WindowProc(UINT msg, WPARAM wParam, LPARAM lParam);
};
const UINT CWin::MSG_GET_ME = RegisterWindowMessage(TEXT("CWin_Message_Get_Me"));
LRESULT CWin::WindowProc(UINT msg, WPARAM wParam, LPARAM lParam);
{
LRESULT lr = 0;
switch(msg)
{
case ... :
break;
...
default:
//Messages "Registered"
if(msg==MSG_GET_ME)
{
lr = GetWindowLongPtr(m_hWnd, GWL_USERDATA);
} else if (msg == ... ) {
... /*Autres messages Registered s'il y a*/
} else {
lr = DefWindowProc(m_hWnd, msg, wParam, lParam);
}
}
} |
Partager