aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_downloads/MessageProcessor.h
blob: c48e4b8a033f6af18e94d7a862a54483f8b0d940 (plain) (blame)
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
34
35
#ifndef NULLSOFT_ML_WIRE_MESSAGEPROCESSOR_H
#define NULLSOFT_ML_WIRE_MESSAGEPROCESSOR_H

#include <api/application/api_messageprocessor.h>
#include "main.h"
#ifndef WM_FORWARDMSG 
#define WM_FORWARDMSG 0x037F
#endif

class MessageProcessor : public api_messageprocessor
{
public:
	bool ProcessMessage(MSG *msg)
	{

    if (msg->message < WM_KEYFIRST || msg->message > WM_KEYLAST)
        return false;

		HWND hWndCtl = ::GetFocus();

    if (IsChild(browserHWND, hWndCtl))
    {
      // find a direct child of the dialog from the window that has focus
      while(::GetParent(hWndCtl) != browserHWND)
         hWndCtl = ::GetParent(hWndCtl);

			if (activeBrowser->translateKey(*msg))
				return true;
    }
		return false;
	}
protected:
	RECVS_DISPATCH;
};
#endif