Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > C/C++: Системное программирование и WinAPI > Hook. Какое сообщение перехвачено?


Автор: User008 29.10.2010, 16:58
Добавил функцию обработки перехваченных сообщений мыши
Код

LRESULT CALLBACK MouseProc(
                    __in  int nCode,
                    __in  WPARAM wParam,
                    __in  LPARAM lParam
                    );

Как определить какое сообщение перехвачено?

Автор: Earnest 30.10.2010, 15:14
Посмотреть в MSDN:
Цитата

Parameters

nCode
[in] Specifies a code the hook procedure uses to determine how to process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx. This parameter can be one of the following values. 
HC_ACTION
The wParam and lParam parameters contain information about a mouse message.
HC_NOREMOVE
The wParam and lParam parameters contain information about a mouse message, and the mouse message has not been removed from the message queue. (An application called the PeekMessage function, specifying the PM_NOREMOVE flag.)
wParam
[in] Specifies the identifier of the mouse message. 
lParam
[in] Pointer to a MOUSEHOOKSTRUCT structure. 


Автор: bass 9.11.2010, 11:36
    CWPSTRUCT* cw  = reinterpret_cast<CWPSTRUCT*>(lParam);

    if (cw->message == WM_CLOSE)

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)