오후 9:42 00-02-03
조경민 bro@shinbiro.com
=========================================================

메세지 큐를통해서 사용자 메세지 전달하기

ON_MESSAGE를 이용하면 된다.

#define WM_MYMSG        (WM_USER+1) 을 한후

...h...
LRESULT OnMyMsg( WPARAM wparam, LPARAM lparam );
하고

...cpp...

ON_MESSAGE( WM_MYMSG, OnMyMsg )
를 한후

LRESULT CMyWnd::OnMyMsg( WPARAM wparam, LPARAM lparam )
{
CString* pStr = (CString*)wparam;
        : 메세지 처리
delete pStr;
}

.. 사용시 ...

CString* pStr =new String;
pStr = _T("메세지");
pMyWnd->PostMessage( (WPARAM)pStr, 0 );
하면 메세지 큐로 들어가서 메세지를 처리할수 있다.

+ Recent posts