blob: e85d382becb8b4997a51e00e8a2d90d37199c46c (
plain)
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
|
{$IFNDEF M_YAPP}
{$DEFINE M_YAPP}
////////////////////////////////////////////////
// YAPP API
///////////////////////////////////////////////
type
TPopupData = record
cbSize :int;
flags :int; // OR of PDF_* flags below
hContact :HANDLE;
hIcon :HICON;
szTitle :TChar;
szText :TChar;
colorBack :COLORREF; // if colorBack and colorText are equal, defaults will be used
colorText :COLORREF;
windowProc:WNDPROC; // optional custom window procedure
timeout :int; // -1 == infinite, 0 == default, otherwise timeout in seconds
opaque :pointer;
end;
const
PDF_UNICODE = $0001;
// windowProc messages
PM_INIT = WM_USER+$0202; // message sent to your windowProc after the window has been initialized
PM_DIENOTIFY = WM_USER+$0200; // message sent to your windowProc just before the window is destroyed (can be used e.g. to free your opaque data)
PM_DESTROY = WM_USER+$0201; // send to the popup hWnd (use PostMessage generally, or SendMessage inside your windowProc) to kill it
// Show a popup
//wParam = &PopupData
//lParam = 0
// returns -1 if popups disabled
MS_YAPP_SHOWPOPUP = 'YAPP/ShowPopup';
// get hContact from PopupData
// wParam = hWnd
// lParam = 0
// return hContact
MS_YAPP_GETCONTACT = 'YAPP/GetContact';
// get opaque from PopupData
// wParam = hWnd
// lParam = 0
// returns opaque
MS_YAPP_GETOPAQUE = 'YAPP/GetOpaque';
//------------- Class API ----------------//
type
TPopupClass = record
cbSize :int;
flags :int;
pszName :PAnsiChar;
szDescription:TChar;
hIcon :HICON;
colorBack :COLORREF;
colorText :COLORREF;
windowProc :WNDPROC;
timeout :int;
end;
const
PCF_UNICODE = $0001;
// wParam = 0
// lParam = (POPUPCLASS *)&pc
MS_POPUP_REGISTERCLASS = 'PopUp/RegisterClass';
type
TPopupClassInstance = record
cbSize :int;
pszClassName:PAnsiChar;
szTitle :TChar;
szText :TChar;
opaque :pointer;
hContact :HANDLE;
end;
const
// wParam = 0
// lParam = (POPUPDATACLASS *)&pdc
MS_POPUP_ADDPOPUPCLASS = 'PopUp/AddPopupClass';
{$ENDIF}
|