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
|
{WATrack global datas}
unit Global;
interface
uses windows,messages,wat_api;
const
hwndTooltip:HWND=0;
var
UserCP:dword;
const
DLGED_INIT = $1000; // dialog init, not activate Apply button
const
dsWait = -1;
dsEnabled = 0;
dsTemporary = 1;
dsPermanent = 2;
// --- type definition ---
type
pwModule = ^twModule;
twModule = record
Next :pwModule;
Init :function(aGetStatus:boolean=false):integer;
DeInit :procedure(aSetDisable:boolean);
AddOption :function(var tmpl:pAnsiChar;var proc:pointer;var name:pAnsiChar):integer;
Check :function(load:boolean):boolean;
ModuleName:pWideChar;
ModuleStat:integer; // filling by the way
Button :HWND; // checkboxes for switch on/off
// AddOption:function(parent:HWND;var Dlg:integer;var name:pWideChar):integer;
end;
const
PluginName = 'Winamp Track';
PluginShort:PAnsiChar = 'WATrack';
const
ModuleLink:pwModule=nil;
const
DisablePlugin :integer=0;
hHookWATStatus:THANDLE=0;
// --- global functions ---
procedure MakeHint (wnd:HWND;id:integer;txt:pAnsiChar);
procedure MakeHintW(wnd:HWND;id:integer;txt:pWideChar);
implementation
uses common,commctrl,mirutils,m_api;//,templates;
procedure MakeHint(wnd:HWND;id:integer;txt:pAnsiChar);
var
ti:TTOOLINFOW;
begin
// FillChar(ti,SizeOf(ti),0);
ti.cbSize :=sizeof(TTOOLINFOW);
ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
ti.hwnd :=wnd;
ti.hinst :=hInstance;
ti.uId :=GetDlgItem(wnd,id);
ti.lpszText:=TranslateA2W(txt);
SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
mFreeMem(ti.lpszText);
end;
procedure MakeHintW(wnd:HWND;id:integer;txt:pWideChar);
var
ti:TTOOLINFOW;
begin
// FillChar(ti,SizeOf(ti),0);
ti.cbSize :=sizeof(TTOOLINFOW);
ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
ti.hwnd :=wnd;
ti.hinst :=hInstance;
ti.uId :=GetDlgItem(wnd,id);
ti.lpszText:=TranslateW(txt);
SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
end;
end.
|