MessageProcessor.h 766 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef NULLSOFT_ML_WIRE_MESSAGEPROCESSOR_H
  2. #define NULLSOFT_ML_WIRE_MESSAGEPROCESSOR_H
  3. #include <api/application/api_messageprocessor.h>
  4. #include "main.h"
  5. #ifndef WM_FORWARDMSG
  6. #define WM_FORWARDMSG 0x037F
  7. #endif
  8. class MessageProcessor : public api_messageprocessor
  9. {
  10. public:
  11. bool ProcessMessage(MSG *msg)
  12. {
  13. if (msg->message < WM_KEYFIRST || msg->message > WM_KEYLAST)
  14. return false;
  15. HWND hWndCtl = ::GetFocus();
  16. if (IsChild(browserHWND, hWndCtl))
  17. {
  18. // find a direct child of the dialog from the window that has focus
  19. while(::GetParent(hWndCtl) != browserHWND)
  20. hWndCtl = ::GetParent(hWndCtl);
  21. if (activeBrowser->translateKey(*msg))
  22. return true;
  23. }
  24. return false;
  25. }
  26. protected:
  27. RECVS_DISPATCH;
  28. };
  29. #endif