-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVCLFixPackHint.pas
53 lines (43 loc) · 1.01 KB
/
VCLFixPackHint.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
{$DEFINE AppHintFix}
unit VCLFixPackHint;
interface
implementation
uses
Controls, Types, VclFixPack;
{$IFDEF AppHintFix}
// QC15408
function FindDragTargetAlt(const Pos: TPoint; AllowDisabled: Boolean): TControl;
var
Window: TWinControl;
Control: TControl;
begin
Result := nil;
Window := FindVCLWindow(Pos);
if Window <> nil then
begin
Result := Window;
Control := Window.ControlAtPos(Window.ScreenToClient(Pos), AllowDisabled, AllowDisabled);
if Control <> nil then Result := Control;
end;
end;
var
FindDragTargetHook: TXRedirCode;
//Reg1: TXRedirCode;
procedure InitAppHintFix;
begin
HookProc(@Controls.FindDragTarget, @FindDragTargetAlt, FindDragTargetHook);
end;
procedure FiniAppHintFix;
begin
UnhookProc(@Controls.FindDragTarget, FindDragTargetHook);
end;
{$ENDIF AppHintFix}
initialization
{$IFDEF AppHintFix}
InitAppHintFix;
{$ENDIF AppHintFix}
finalization
{$IFDEF AppHintFix}
FiniAppHintFix;
{$ENDIF AppHintFix}
end.