-
Notifications
You must be signed in to change notification settings - Fork 56
/
dll_Main.pas
88 lines (64 loc) · 2.12 KB
/
dll_Main.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
unit dll_Main;
(****** LICENSE INFORMATION **************************************************
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
------------------------------------------------------------------------------
(c) 2000-2005 Marek Jedlinski <[email protected]> (Poland)
(c) 2007-2015 Daniel Prado Velasco <[email protected]> (Spain) [^]
[^]: Changes since v. 1.7.0. Fore more information, please see 'README.md'
and 'doc/README_SourceCode.txt' in https://github.com/dpradov/keynote-nf
*****************************************************************************)
interface
uses
Winapi.Windows,
System.Classes,
System.SysUtils,
System.Variants,
Vcl.Forms,
Vcl.Controls,
Vcl.Dialogs,
Vcl.OleServer,
WordXP,
MSOfficeConverters,
dll_KBD,
dll_Keyboard;
function DlgCustomizeKeyboard(
AppHandle : HWND;
KBD_FN : PChar;
KeyList : TList;
ActivationHotkey : TShortCut ) : boolean;
implementation
function DlgCustomizeKeyboard(
AppHandle : HWND;
KBD_FN : PChar;
KeyList : TList;
ActivationHotkey : TShortCut ) : boolean;
var
Form_KBD: TForm_KBD;
begin
result := false;
if (AppHandle = 0) then
AppHandle := GetActiveWindow;
Application.Handle := AppHandle;
Application.Helpfile := changefileext( application.exename, '.hlp' );
Form_KBD := TForm_KBD.Create( Application );
try
try
Form_KBD.myKeyList := KeyList;
Form_KBD.myKBD_FN := KBD_FN;
Form_KBD.KeyNoteActivationHotkey:= ActivationHotkey;
if ( Form_KBD.ShowModal = mrOK ) then begin
result := true;
SaveKeyboardList( KBD_FN, KeyList );
end;
except
on E : Exception do
messagedlg( 'Error in keyboard customization procedure: ' + E.Message, mtError, [mbOK], 0 );
end;
finally
Application.Handle := 0;
Form_KBD.Free;
end;
end; // DlgCustomizeKeyboard
end.