1
{******************************************************************************}
3
{ Control Panel Applets Interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: cpl.h, released June 2000. The original Pascal }
9
{ code is: Cpl.pas, released December 2000. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
43
// $Id: jwacpl.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
50
{$HPPEMIT '#include "cpl.h"'}
58
JwaWinUser, JwaWinType;
61
// General rules for being installed in the Control Panel:
63
// 1) The DLL must export a function named CPlApplet which will handle
64
// the messages discussed below.
65
// 2) If the applet needs to save information in CONTROL.INI minimize
66
// clutter by using the application name [MMCPL.appletname].
67
// 2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
68
// the following form:
71
// uniqueName=c:\mydir\myapplet.dll
75
// The order applet DLL's are loaded by CONTROL.EXE is not guaranteed.
76
// Control panels may be sorted for display, etc.
80
// #include <pshpack1.h> // Assume byte packing throughout
83
// CONTROL.EXE will answer this message and launch an applet
87
// wParam - window handle of calling app
88
// lParam - LPTSTR of name of applet to launch
92
// wParam - TRUE/FALSE if applet was launched
95
// CONTROL.EXE will post this message to the caller when the applet returns
96
// (ie., when wParam is a valid window handle)
101
WM_CPL_LAUNCH = WM_USER + 1000;
102
{$EXTERNALSYM WM_CPL_LAUNCH}
103
WM_CPL_LAUNCHED = WM_USER + 1001;
104
{$EXTERNALSYM WM_CPL_LAUNCHED}
106
// A function prototype for CPlApplet()
109
APPLET_PROC = function(hwndCpl: HWND; msg: UINT;
110
lParam1, lParam2: LPARAM): LONG; stdcall;
111
{$EXTERNALSYM APPLET_PROC}
112
TCPLApplet = APPLET_PROC;
114
// The data structure CPlApplet() must fill in.
116
LPCPLINFO = ^CPLINFO;
117
{$EXTERNALSYM LPCPLINFO}
118
tagCPLINFO = packed record
119
idIcon: Integer; // icon resource id, provided by CPlApplet()
120
idName: Integer; // name string res. id, provided by CPlApplet()
121
idInfo: Integer; // info string res. id, provided by CPlApplet()
122
lData: LONG_PTR; // user defined data
124
{$EXTERNALSYM tagCPLINFO}
125
CPLINFO = tagCPLINFO;
126
{$EXTERNALSYM CPLINFO}
128
PCplInfo = LPCPLINFO;
130
LPNEWCPLINFOA = ^NEWCPLINFOA;
131
{$EXTERNALSYM LPNEWCPLINFOA}
132
tagNEWCPLINFOA = packed record
133
dwSize: DWORD; // similar to the commdlg
135
dwHelpContext: DWORD; // help context to use
136
lData: LONG_PTR; // user defined data
137
hIcon: HICON; // icon to use, this is owned by CONTROL.EXE (may be deleted)
138
szName: array [0..31] of CHAR; // short name
139
szInfo: array [0..63] of CHAR; // long name (status line)
140
szHelpFile: array [0..127] of CHAR; // path to help file to use
142
{$EXTERNALSYM tagNEWCPLINFOA}
143
NEWCPLINFOA = tagNEWCPLINFOA;
144
{$EXTERNALSYM NEWCPLINFOA}
145
TNewCplInfoA = NEWCPLINFOA;
146
PNewCplInfoA = LPNEWCPLINFOA;
148
LPNEWCPLINFOW = ^NEWCPLINFOW;
149
{$EXTERNALSYM LPNEWCPLINFOW}
150
tagNEWCPLINFOW = packed record
151
dwSize: DWORD; // similar to the commdlg
153
dwHelpContext: DWORD; // help context to use
154
lData: LONG_PTR; // user defined data
155
hIcon: HICON; // icon to use, this is owned by CONTROL.EXE (may be deleted)
156
szName: array [0..31] of WCHAR; // short name
157
szInfo: array [0..63] of WCHAR; // long name (status line)
158
szHelpFile: array [0..127] of WCHAR; // path to help file to use
160
{$EXTERNALSYM tagNEWCPLINFOW}
161
NEWCPLINFOW = tagNEWCPLINFOW;
162
{$EXTERNALSYM NEWCPLINFOW}
163
TNewCplInfoW = NEWCPLINFOW;
164
PNewCplInfoW = LPNEWCPLINFOW;
167
NEWCPLINFO = NEWCPLINFOW;
168
{$EXTERNALSYM NEWCPLINFO}
169
LPNEWCPLINFO = LPNEWCPLINFOW;
170
{$EXTERNALSYM LPNEWCPLINFO}
171
TNewCplInfo = TNewCplInfoW;
172
PNewCplInfo = PNewCplInfoW;
174
NEWCPLINFO = NEWCPLINFOA;
175
{$EXTERNALSYM NEWCPLINFO}
176
LPNEWCPLINFO = LPNEWCPLINFOA;
177
{$EXTERNALSYM LPNEWCPLINFO}
178
TNewCplInfo = TNewCplInfoA;
179
PNewCplInfo = PNewCplInfoA;
184
{$EXTERNALSYM CPL_DYNAMIC_RES}
186
// This constant may be used in place of real resource IDs for the idIcon,
187
// idName or idInfo members of the CPLINFO structure. Normally, the system
188
// uses these values to extract copies of the resources and store them in a
189
// cache. Once the resource information is in the cache, the system does not
190
// need to load a CPL unless the user actually tries to use it.
191
// CPL_DYNAMIC_RES tells the system not to cache the resource, but instead to
192
// load the CPL every time it needs to display information about an item. This
193
// allows a CPL to dynamically decide what information will be displayed, but
194
// is SIGNIFICANTLY SLOWER than displaying information from a cache.
195
// Typically, CPL_DYNAMIC_RES is used when a control panel must inspect the
196
// runtime status of some device in order to provide text or icons to display.
198
// The messages CPlApplet() must handle:
201
{$EXTERNALSYM CPL_INIT}
203
// This message is sent to indicate CPlApplet() was found.
204
// lParam1 and lParam2 are not defined.
205
// Return TRUE or FALSE indicating whether the control panel should proceed.
208
{$EXTERNALSYM CPL_GETCOUNT}
210
// This message is sent to determine the number of applets to be displayed.
211
// lParam1 and lParam2 are not defined.
212
// Return the number of applets you wish to display in the control
216
{$EXTERNALSYM CPL_INQUIRE}
218
// This message is sent for information about each applet.
220
// A CPL SHOULD HANDLE BOTH THE CPL_INQUIRE AND CPL_NEWINQUIRE MESSAGES.
221
// The developer must not make any assumptions about the order or dependance
224
// lParam1 is the applet number to register, a value from 0 to
225
// (CPL_GETCOUNT - 1). lParam2 is a far ptr to a CPLINFO structure.
226
// Fill in CPLINFO's idIcon, idName, idInfo and lData fields with
227
// the resource id for an icon to display, name and description string ids,
228
// and a long data item associated with applet #lParam1. This information
229
// may be cached by the caller at runtime and/or across sessions.
230
// To prevent caching, see CPL_DYNAMIC_RES, above.
233
{$EXTERNALSYM CPL_SELECT}
235
// The CPL_SELECT message has been deleted.
238
{$EXTERNALSYM CPL_DBLCLK}
240
// This message is sent when the applet's icon has been double-clicked
241
// upon. lParam1 is the applet number which was selected. lParam2 is the
242
// applet's lData value.
243
// This message should initiate the applet's dialog box.
246
{$EXTERNALSYM CPL_STOP}
248
// This message is sent for each applet when the control panel is exiting.
249
// lParam1 is the applet number. lParam2 is the applet's lData value.
250
// Do applet specific cleaning up here.
253
{$EXTERNALSYM CPL_EXIT}
255
// This message is sent just before the control panel calls FreeLibrary.
256
// lParam1 and lParam2 are not defined.
257
// Do non-applet specific cleaning up here.
260
{$EXTERNALSYM CPL_NEWINQUIRE}
262
// Same as CPL_INQUIRE execpt lParam2 is a pointer to a NEWCPLINFO struct.
264
// A CPL SHOULD HANDLE BOTH THE CPL_INQUIRE AND CPL_NEWINQUIRE MESSAGES.
265
// The developer must not make any assumptions about the order or dependance
268
CPL_STARTWPARMSA = 9;
269
{$EXTERNALSYM CPL_STARTWPARMSA}
270
CPL_STARTWPARMSW = 10;
271
{$EXTERNALSYM CPL_STARTWPARMSW}
274
CPL_STARTWPARMS = CPL_STARTWPARMSW;
275
{$EXTERNALSYM CPL_STARTWPARMS}
277
CPL_STARTWPARMS = CPL_STARTWPARMSA;
278
{$EXTERNALSYM CPL_STARTWPARMS}
281
// this message parallels CPL_DBLCLK in that the applet should initiate
282
// its dialog box. where it differs is that this invocation is coming
283
// out of RUNDLL, and there may be some extra directions for execution.
284
// lParam1: the applet number.
285
// lParam2: an LPSTR to any extra directions that might exist.
286
// returns: TRUE if the message was handled; FALSE if not.
288
// This message is internal to the Control Panel and MAIN applets.
289
// It is only sent when an applet is invoked from the Command line
290
// during system installation.
293
{$EXTERNALSYM CPL_SETUP}
1
{******************************************************************************}
3
{ Control Panel Applets Interface Unit for Object Pascal }
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
6
{ Corporation. All Rights Reserved. }
8
{ The original file is: cpl.h, released June 2000. The original Pascal }
9
{ code is: Cpl.pas, released December 2000. The initial developer of the }
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
13
{ Marcel van Brakel. All Rights Reserved. }
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
17
{ You may retrieve the latest version of this file at the Project JEDI }
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net }
20
{ The contents of this file are used with permission, subject to the Mozilla }
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
22
{ in compliance with the License. You may obtain a copy of the License at }
23
{ http://www.mozilla.org/MPL/MPL-1.1.html }
25
{ Software distributed under the License is distributed on an "AS IS" basis, }
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
27
{ the specific language governing rights and limitations under the License. }
29
{ Alternatively, the contents of this file may be used under the terms of the }
30
{ GNU Lesser General Public License (the "LGPL License"), in which case the }
31
{ provisions of the LGPL License are applicable instead of those above. }
32
{ If you wish to allow use of your version of this file only under the terms }
33
{ of the LGPL License and not to allow others to use your version of this file }
34
{ under the MPL, indicate your decision by deleting the provisions above and }
35
{ replace them with the notice and other provisions required by the LGPL }
36
{ License. If you do not delete the provisions above, a recipient may use }
37
{ your version of this file under either the MPL or the LGPL License. }
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
41
{******************************************************************************}
49
{$HPPEMIT '#include "cpl.h"'}
57
JwaWinUser, JwaWinType;
60
// General rules for being installed in the Control Panel:
62
// 1) The DLL must export a function named CPlApplet which will handle
63
// the messages discussed below.
64
// 2) If the applet needs to save information in CONTROL.INI minimize
65
// clutter by using the application name [MMCPL.appletname].
66
// 2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
67
// the following form:
70
// uniqueName=c:\mydir\myapplet.dll
74
// The order applet DLL's are loaded by CONTROL.EXE is not guaranteed.
75
// Control panels may be sorted for display, etc.
79
// #include <pshpack1.h> // Assume byte packing throughout
82
// CONTROL.EXE will answer this message and launch an applet
86
// wParam - window handle of calling app
87
// lParam - LPTSTR of name of applet to launch
91
// wParam - TRUE/FALSE if applet was launched
94
// CONTROL.EXE will post this message to the caller when the applet returns
95
// (ie., when wParam is a valid window handle)
100
WM_CPL_LAUNCH = WM_USER + 1000;
101
{$EXTERNALSYM WM_CPL_LAUNCH}
102
WM_CPL_LAUNCHED = WM_USER + 1001;
103
{$EXTERNALSYM WM_CPL_LAUNCHED}
105
// A function prototype for CPlApplet()
108
APPLET_PROC = function(hwndCpl: HWND; msg: UINT;
109
lParam1, lParam2: LPARAM): LONG; stdcall;
110
{$EXTERNALSYM APPLET_PROC}
111
TCPLApplet = APPLET_PROC;
113
// The data structure CPlApplet() must fill in.
115
LPCPLINFO = ^CPLINFO;
116
{$EXTERNALSYM LPCPLINFO}
117
tagCPLINFO = packed record
118
idIcon: Integer; // icon resource id, provided by CPlApplet()
119
idName: Integer; // name string res. id, provided by CPlApplet()
120
idInfo: Integer; // info string res. id, provided by CPlApplet()
121
lData: LONG_PTR; // user defined data
123
{$EXTERNALSYM tagCPLINFO}
124
CPLINFO = tagCPLINFO;
125
{$EXTERNALSYM CPLINFO}
127
PCplInfo = LPCPLINFO;
129
LPNEWCPLINFOA = ^NEWCPLINFOA;
130
{$EXTERNALSYM LPNEWCPLINFOA}
131
tagNEWCPLINFOA = packed record
132
dwSize: DWORD; // similar to the commdlg
134
dwHelpContext: DWORD; // help context to use
135
lData: LONG_PTR; // user defined data
136
hIcon: HICON; // icon to use, this is owned by CONTROL.EXE (may be deleted)
137
szName: array [0..31] of CHAR; // short name
138
szInfo: array [0..63] of CHAR; // long name (status line)
139
szHelpFile: array [0..127] of CHAR; // path to help file to use
141
{$EXTERNALSYM tagNEWCPLINFOA}
142
NEWCPLINFOA = tagNEWCPLINFOA;
143
{$EXTERNALSYM NEWCPLINFOA}
144
TNewCplInfoA = NEWCPLINFOA;
145
PNewCplInfoA = LPNEWCPLINFOA;
147
LPNEWCPLINFOW = ^NEWCPLINFOW;
148
{$EXTERNALSYM LPNEWCPLINFOW}
149
tagNEWCPLINFOW = packed record
150
dwSize: DWORD; // similar to the commdlg
152
dwHelpContext: DWORD; // help context to use
153
lData: LONG_PTR; // user defined data
154
hIcon: HICON; // icon to use, this is owned by CONTROL.EXE (may be deleted)
155
szName: array [0..31] of WCHAR; // short name
156
szInfo: array [0..63] of WCHAR; // long name (status line)
157
szHelpFile: array [0..127] of WCHAR; // path to help file to use
159
{$EXTERNALSYM tagNEWCPLINFOW}
160
NEWCPLINFOW = tagNEWCPLINFOW;
161
{$EXTERNALSYM NEWCPLINFOW}
162
TNewCplInfoW = NEWCPLINFOW;
163
PNewCplInfoW = LPNEWCPLINFOW;
166
NEWCPLINFO = NEWCPLINFOW;
167
{$EXTERNALSYM NEWCPLINFO}
168
LPNEWCPLINFO = LPNEWCPLINFOW;
169
{$EXTERNALSYM LPNEWCPLINFO}
170
TNewCplInfo = TNewCplInfoW;
171
PNewCplInfo = PNewCplInfoW;
173
NEWCPLINFO = NEWCPLINFOA;
174
{$EXTERNALSYM NEWCPLINFO}
175
LPNEWCPLINFO = LPNEWCPLINFOA;
176
{$EXTERNALSYM LPNEWCPLINFO}
177
TNewCplInfo = TNewCplInfoA;
178
PNewCplInfo = PNewCplInfoA;
183
{$EXTERNALSYM CPL_DYNAMIC_RES}
185
// This constant may be used in place of real resource IDs for the idIcon,
186
// idName or idInfo members of the CPLINFO structure. Normally, the system
187
// uses these values to extract copies of the resources and store them in a
188
// cache. Once the resource information is in the cache, the system does not
189
// need to load a CPL unless the user actually tries to use it.
190
// CPL_DYNAMIC_RES tells the system not to cache the resource, but instead to
191
// load the CPL every time it needs to display information about an item. This
192
// allows a CPL to dynamically decide what information will be displayed, but
193
// is SIGNIFICANTLY SLOWER than displaying information from a cache.
194
// Typically, CPL_DYNAMIC_RES is used when a control panel must inspect the
195
// runtime status of some device in order to provide text or icons to display.
197
// The messages CPlApplet() must handle:
200
{$EXTERNALSYM CPL_INIT}
202
// This message is sent to indicate CPlApplet() was found.
203
// lParam1 and lParam2 are not defined.
204
// Return TRUE or FALSE indicating whether the control panel should proceed.
207
{$EXTERNALSYM CPL_GETCOUNT}
209
// This message is sent to determine the number of applets to be displayed.
210
// lParam1 and lParam2 are not defined.
211
// Return the number of applets you wish to display in the control
215
{$EXTERNALSYM CPL_INQUIRE}
217
// This message is sent for information about each applet.
219
// A CPL SHOULD HANDLE BOTH THE CPL_INQUIRE AND CPL_NEWINQUIRE MESSAGES.
220
// The developer must not make any assumptions about the order or dependance
223
// lParam1 is the applet number to register, a value from 0 to
224
// (CPL_GETCOUNT - 1). lParam2 is a far ptr to a CPLINFO structure.
225
// Fill in CPLINFO's idIcon, idName, idInfo and lData fields with
226
// the resource id for an icon to display, name and description string ids,
227
// and a long data item associated with applet #lParam1. This information
228
// may be cached by the caller at runtime and/or across sessions.
229
// To prevent caching, see CPL_DYNAMIC_RES, above.
232
{$EXTERNALSYM CPL_SELECT}
234
// The CPL_SELECT message has been deleted.
237
{$EXTERNALSYM CPL_DBLCLK}
239
// This message is sent when the applet's icon has been double-clicked
240
// upon. lParam1 is the applet number which was selected. lParam2 is the
241
// applet's lData value.
242
// This message should initiate the applet's dialog box.
245
{$EXTERNALSYM CPL_STOP}
247
// This message is sent for each applet when the control panel is exiting.
248
// lParam1 is the applet number. lParam2 is the applet's lData value.
249
// Do applet specific cleaning up here.
252
{$EXTERNALSYM CPL_EXIT}
254
// This message is sent just before the control panel calls FreeLibrary.
255
// lParam1 and lParam2 are not defined.
256
// Do non-applet specific cleaning up here.
259
{$EXTERNALSYM CPL_NEWINQUIRE}
261
// Same as CPL_INQUIRE execpt lParam2 is a pointer to a NEWCPLINFO struct.
263
// A CPL SHOULD HANDLE BOTH THE CPL_INQUIRE AND CPL_NEWINQUIRE MESSAGES.
264
// The developer must not make any assumptions about the order or dependance
267
CPL_STARTWPARMSA = 9;
268
{$EXTERNALSYM CPL_STARTWPARMSA}
269
CPL_STARTWPARMSW = 10;
270
{$EXTERNALSYM CPL_STARTWPARMSW}
273
CPL_STARTWPARMS = CPL_STARTWPARMSW;
274
{$EXTERNALSYM CPL_STARTWPARMS}
276
CPL_STARTWPARMS = CPL_STARTWPARMSA;
277
{$EXTERNALSYM CPL_STARTWPARMS}
280
// this message parallels CPL_DBLCLK in that the applet should initiate
281
// its dialog box. where it differs is that this invocation is coming
282
// out of RUNDLL, and there may be some extra directions for execution.
283
// lParam1: the applet number.
284
// lParam2: an LPSTR to any extra directions that might exist.
285
// returns: TRUE if the message was handled; FALSE if not.
287
// This message is internal to the Control Panel and MAIN applets.
288
// It is only sent when an applet is invoked from the Command line
289
// during system installation.
292
{$EXTERNALSYM CPL_SETUP}