|
#define WM_USR_MSG "Test"
int MSG1 = RegisterWindowMessage(WM_USR_MSG);
int MSG2 = RegisterWindowMessage(WM_USR_MSG);
위와 같이 사용하였을경우 성공했으면 xC000 through 0xFFFF 값을 리턴하고 실패했을경우 0을 리턴합니다.
If two different applications register the same message string, the applications return the same message value. The message remains registered until the Windows session ends.
Only use RegisterWindowMessage when more than one application must process the same message. For sending private messages within a window class, an application can use any integer in the range WM_USER through 0x7FFF. (Messages in this range are private to a window class, not to an application. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use values in this range.)
도움말에 나와 있는 내용입니다.
어떤 상황에서 사용하시려는 건지 모르겠군요.
그리고 구현 부분은 message나 WM_USER 로 검색해 보세요
김명구 님이 쓰신 글 :
: 사용자정의 메시지를 만들어서 그 메시지 핸들러에 원하는 기능을 구현하려고 합니다.
: 볼랜드포럼에서 검색을 해봤는데 RegisterWindowMessage를 사용하라는 말은 있지만
: SendMessage를 보내는 쪽과 이 메시지를 받는 쪽에서 구현되어야 할 기능들에 대한
: 설명이 자세하지 않아서 이해하기가 어렵군요.....
: 인터넷에서 검색해보았지만 VC++에서 구현된 기능만 있습니다.
: 고수님들 사용자정의 메시지구현에 대해서 자세한 설명좀 부탁합니다.
|