-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathESoft.Launcher.PopupList.pas
54 lines (43 loc) · 1.07 KB
/
ESoft.Launcher.PopupList.pas
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
unit ESoft.Launcher.PopupList;
Interface
Uses
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Winapi.Messages,
System.Classes,
System.StrUtils,
Vcl.Menus;
Const
CM_MENUCLOSED = CM_BASE - 1;
CM_ENTERMENULOOP = CM_BASE - 2;
CM_EXITMENULOOP = CM_BASE - 3;
Type
TExPopupList = Class(TPopupList)
Protected
procedure WndProc(var aMessage: TMessage); override;
End;
Implementation
{ TExPopupList }
procedure TExPopupList.WndProc(var aMessage: TMessage);
Procedure _Send(aMsg: Integer);
Begin
If Assigned(Screen.Activeform) Then
Screen.ActiveForm.Perform(aMsg, aMessage.WParam, aMessage.LParam);
End;
Begin
Case aMessage.Msg Of
WM_ENTERMENULOOP: _Send(CM_ENTERMENULOOP);
WM_EXITMENULOOP: _Send(CM_EXITMENULOOP);
WM_MENUSELECT:
Begin
With TWMMenuSelect(aMessage) Do
Begin
If (Menuflag = $FFFF) and (Menu = 0) Then
_Send(CM_MENUCLOSED);
End;
End;
End;
Inherited;
End;
End.