~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to packages/extra/winunits/jwacpl.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{******************************************************************************}
2
 
{                                                                              }
3
 
{ Control Panel Applets Interface Unit for Object Pascal                       }
4
 
{                                                                              }
5
 
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
6
 
{ Corporation. All Rights Reserved.                                            }
7
 
{                                                                              }
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).               }
11
 
{                                                                              }
12
 
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
13
 
{ Marcel van Brakel. All Rights Reserved.                                      }
14
 
{                                                                              }
15
 
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
16
 
{                                                                              }
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              }
19
 
{                                                                              }
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                                      }
24
 
{                                                                              }
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.    }
28
 
{                                                                              }
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.          }
38
 
{                                                                              }
39
 
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
40
 
{                                                                              }
41
 
{******************************************************************************}
42
 
 
43
 
// $Id: jwacpl.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
44
 
 
45
 
unit JwaCpl;
46
 
 
47
 
{$WEAKPACKAGEUNIT}
48
 
 
49
 
{$HPPEMIT ''}
50
 
{$HPPEMIT '#include "cpl.h"'}
51
 
{$HPPEMIT ''}
52
 
 
53
 
{$I jediapilib.inc}
54
 
 
55
 
interface
56
 
 
57
 
uses
58
 
  JwaWinUser, JwaWinType;
59
 
 
60
 
//
61
 
// General rules for being installed in the Control Panel:
62
 
//
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:
69
 
//             ...
70
 
//             [MMCPL]
71
 
//             uniqueName=c:\mydir\myapplet.dll
72
 
//             ...
73
 
//
74
 
//
75
 
// The order applet DLL's are loaded by CONTROL.EXE is not guaranteed.
76
 
// Control panels may be sorted for display, etc.
77
 
//
78
 
//
79
 
 
80
 
// #include <pshpack1.h>   // Assume byte packing throughout
81
 
 
82
 
//
83
 
// CONTROL.EXE will answer this message and launch an applet
84
 
//
85
 
// WM_CPL_LAUNCH
86
 
//
87
 
//      wParam      - window handle of calling app
88
 
//      lParam      - LPTSTR of name of applet to launch
89
 
//
90
 
// WM_CPL_LAUNCHED
91
 
//
92
 
//      wParam      - TRUE/FALSE if applet was launched
93
 
//      lParam      - NULL
94
 
//
95
 
// CONTROL.EXE will post this message to the caller when the applet returns
96
 
// (ie., when wParam is a valid window handle)
97
 
//
98
 
//
99
 
 
100
 
const
101
 
  WM_CPL_LAUNCH   = WM_USER + 1000;
102
 
  {$EXTERNALSYM WM_CPL_LAUNCH}
103
 
  WM_CPL_LAUNCHED = WM_USER + 1001;
104
 
  {$EXTERNALSYM WM_CPL_LAUNCHED}
105
 
 
106
 
// A function prototype for CPlApplet()
107
 
 
108
 
type
109
 
  APPLET_PROC = function(hwndCpl: HWND; msg: UINT;
110
 
    lParam1, lParam2: LPARAM): LONG; stdcall;
111
 
  {$EXTERNALSYM APPLET_PROC}
112
 
  TCPLApplet = APPLET_PROC;
113
 
 
114
 
// The data structure CPlApplet() must fill in.
115
 
 
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
123
 
  end;
124
 
  {$EXTERNALSYM tagCPLINFO}
125
 
  CPLINFO = tagCPLINFO;
126
 
  {$EXTERNALSYM CPLINFO}
127
 
  TCplInfo = CPLINFO;
128
 
  PCplInfo = LPCPLINFO;
129
 
 
130
 
  LPNEWCPLINFOA = ^NEWCPLINFOA;
131
 
  {$EXTERNALSYM LPNEWCPLINFOA}
132
 
  tagNEWCPLINFOA = packed record
133
 
    dwSize: DWORD;                       // similar to the commdlg
134
 
    dwFlags: DWORD;
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
141
 
  end;
142
 
  {$EXTERNALSYM tagNEWCPLINFOA}
143
 
  NEWCPLINFOA = tagNEWCPLINFOA;
144
 
  {$EXTERNALSYM NEWCPLINFOA}
145
 
  TNewCplInfoA = NEWCPLINFOA;
146
 
  PNewCplInfoA = LPNEWCPLINFOA;
147
 
 
148
 
  LPNEWCPLINFOW = ^NEWCPLINFOW;
149
 
  {$EXTERNALSYM LPNEWCPLINFOW}
150
 
  tagNEWCPLINFOW = packed record
151
 
    dwSize: DWORD;                       // similar to the commdlg
152
 
    dwFlags: DWORD;
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
159
 
  end;
160
 
  {$EXTERNALSYM tagNEWCPLINFOW}
161
 
  NEWCPLINFOW = tagNEWCPLINFOW;
162
 
  {$EXTERNALSYM NEWCPLINFOW}
163
 
  TNewCplInfoW = NEWCPLINFOW;
164
 
  PNewCplInfoW = LPNEWCPLINFOW;
165
 
 
166
 
  {$IFDEF UNICODE}
167
 
  NEWCPLINFO = NEWCPLINFOW;
168
 
  {$EXTERNALSYM NEWCPLINFO}
169
 
  LPNEWCPLINFO = LPNEWCPLINFOW;
170
 
  {$EXTERNALSYM LPNEWCPLINFO}
171
 
  TNewCplInfo = TNewCplInfoW;
172
 
  PNewCplInfo = PNewCplInfoW;
173
 
  {$ELSE}
174
 
  NEWCPLINFO = NEWCPLINFOA;
175
 
  {$EXTERNALSYM NEWCPLINFO}
176
 
  LPNEWCPLINFO = LPNEWCPLINFOA;
177
 
  {$EXTERNALSYM LPNEWCPLINFO}
178
 
  TNewCplInfo = TNewCplInfoA;
179
 
  PNewCplInfo = PNewCplInfoA;
180
 
  {$ENDIF UNICODE}
181
 
 
182
 
const
183
 
  CPL_DYNAMIC_RES = 0;
184
 
  {$EXTERNALSYM CPL_DYNAMIC_RES}
185
 
 
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.
197
 
 
198
 
// The messages CPlApplet() must handle:
199
 
 
200
 
  CPL_INIT = 1;
201
 
  {$EXTERNALSYM CPL_INIT}
202
 
 
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.
206
 
 
207
 
  CPL_GETCOUNT = 2;
208
 
  {$EXTERNALSYM CPL_GETCOUNT}
209
 
 
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
213
 
//  panel window.
214
 
 
215
 
  CPL_INQUIRE = 3;
216
 
  {$EXTERNALSYM CPL_INQUIRE}
217
 
 
218
 
//  This message is sent for information about each applet.
219
 
 
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
222
 
//  of CPL inquiries.
223
 
 
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.
231
 
 
232
 
  CPL_SELECT = 4;
233
 
  {$EXTERNALSYM CPL_SELECT}
234
 
 
235
 
//  The CPL_SELECT message has been deleted.
236
 
 
237
 
  CPL_DBLCLK = 5;
238
 
  {$EXTERNALSYM CPL_DBLCLK}
239
 
 
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.
244
 
 
245
 
  CPL_STOP = 6;
246
 
  {$EXTERNALSYM CPL_STOP}
247
 
 
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.
251
 
 
252
 
  CPL_EXIT = 7;
253
 
  {$EXTERNALSYM CPL_EXIT}
254
 
 
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.
258
 
 
259
 
  CPL_NEWINQUIRE = 8;
260
 
  {$EXTERNALSYM CPL_NEWINQUIRE}
261
 
 
262
 
// Same as CPL_INQUIRE execpt lParam2 is a pointer to a NEWCPLINFO struct.
263
 
 
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
266
 
//  of CPL inquiries.
267
 
 
268
 
  CPL_STARTWPARMSA = 9;
269
 
  {$EXTERNALSYM CPL_STARTWPARMSA}
270
 
  CPL_STARTWPARMSW = 10;
271
 
  {$EXTERNALSYM CPL_STARTWPARMSW}
272
 
 
273
 
  {$IFDEF UNICODE}
274
 
  CPL_STARTWPARMS = CPL_STARTWPARMSW;
275
 
  {$EXTERNALSYM CPL_STARTWPARMS}
276
 
  {$ELSE}
277
 
  CPL_STARTWPARMS = CPL_STARTWPARMSA;
278
 
  {$EXTERNALSYM CPL_STARTWPARMS}
279
 
  {$ENDIF UNICODE}
280
 
 
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.
287
 
 
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.
291
 
 
292
 
  CPL_SETUP = 200;
293
 
  {$EXTERNALSYM CPL_SETUP}
294
 
 
295
 
implementation
296
 
 
297
 
end.
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ Control Panel Applets Interface Unit for Object Pascal                       }
 
4
{                                                                              }
 
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
 
6
{ Corporation. All Rights Reserved.                                            }
 
7
{                                                                              }
 
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).               }
 
11
{                                                                              }
 
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
 
13
{ Marcel van Brakel. All Rights Reserved.                                      }
 
14
{                                                                              }
 
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
 
16
{                                                                              }
 
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              }
 
19
{                                                                              }
 
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                                      }
 
24
{                                                                              }
 
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.    }
 
28
{                                                                              }
 
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.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
 
 
44
unit JwaCpl;
 
45
 
 
46
{$WEAKPACKAGEUNIT}
 
47
 
 
48
{$HPPEMIT ''}
 
49
{$HPPEMIT '#include "cpl.h"'}
 
50
{$HPPEMIT ''}
 
51
 
 
52
{$I jediapilib.inc}
 
53
 
 
54
interface
 
55
 
 
56
uses
 
57
  JwaWinUser, JwaWinType;
 
58
 
 
59
//
 
60
// General rules for being installed in the Control Panel:
 
61
//
 
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:
 
68
//             ...
 
69
//             [MMCPL]
 
70
//             uniqueName=c:\mydir\myapplet.dll
 
71
//             ...
 
72
//
 
73
//
 
74
// The order applet DLL's are loaded by CONTROL.EXE is not guaranteed.
 
75
// Control panels may be sorted for display, etc.
 
76
//
 
77
//
 
78
 
 
79
// #include <pshpack1.h>   // Assume byte packing throughout
 
80
 
 
81
//
 
82
// CONTROL.EXE will answer this message and launch an applet
 
83
//
 
84
// WM_CPL_LAUNCH
 
85
//
 
86
//      wParam      - window handle of calling app
 
87
//      lParam      - LPTSTR of name of applet to launch
 
88
//
 
89
// WM_CPL_LAUNCHED
 
90
//
 
91
//      wParam      - TRUE/FALSE if applet was launched
 
92
//      lParam      - NULL
 
93
//
 
94
// CONTROL.EXE will post this message to the caller when the applet returns
 
95
// (ie., when wParam is a valid window handle)
 
96
//
 
97
//
 
98
 
 
99
const
 
100
  WM_CPL_LAUNCH   = WM_USER + 1000;
 
101
  {$EXTERNALSYM WM_CPL_LAUNCH}
 
102
  WM_CPL_LAUNCHED = WM_USER + 1001;
 
103
  {$EXTERNALSYM WM_CPL_LAUNCHED}
 
104
 
 
105
// A function prototype for CPlApplet()
 
106
 
 
107
type
 
108
  APPLET_PROC = function(hwndCpl: HWND; msg: UINT;
 
109
    lParam1, lParam2: LPARAM): LONG; stdcall;
 
110
  {$EXTERNALSYM APPLET_PROC}
 
111
  TCPLApplet = APPLET_PROC;
 
112
 
 
113
// The data structure CPlApplet() must fill in.
 
114
 
 
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
 
122
  end;
 
123
  {$EXTERNALSYM tagCPLINFO}
 
124
  CPLINFO = tagCPLINFO;
 
125
  {$EXTERNALSYM CPLINFO}
 
126
  TCplInfo = CPLINFO;
 
127
  PCplInfo = LPCPLINFO;
 
128
 
 
129
  LPNEWCPLINFOA = ^NEWCPLINFOA;
 
130
  {$EXTERNALSYM LPNEWCPLINFOA}
 
131
  tagNEWCPLINFOA = packed record
 
132
    dwSize: DWORD;                       // similar to the commdlg
 
133
    dwFlags: DWORD;
 
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
 
140
  end;
 
141
  {$EXTERNALSYM tagNEWCPLINFOA}
 
142
  NEWCPLINFOA = tagNEWCPLINFOA;
 
143
  {$EXTERNALSYM NEWCPLINFOA}
 
144
  TNewCplInfoA = NEWCPLINFOA;
 
145
  PNewCplInfoA = LPNEWCPLINFOA;
 
146
 
 
147
  LPNEWCPLINFOW = ^NEWCPLINFOW;
 
148
  {$EXTERNALSYM LPNEWCPLINFOW}
 
149
  tagNEWCPLINFOW = packed record
 
150
    dwSize: DWORD;                       // similar to the commdlg
 
151
    dwFlags: DWORD;
 
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
 
158
  end;
 
159
  {$EXTERNALSYM tagNEWCPLINFOW}
 
160
  NEWCPLINFOW = tagNEWCPLINFOW;
 
161
  {$EXTERNALSYM NEWCPLINFOW}
 
162
  TNewCplInfoW = NEWCPLINFOW;
 
163
  PNewCplInfoW = LPNEWCPLINFOW;
 
164
 
 
165
  {$IFDEF UNICODE}
 
166
  NEWCPLINFO = NEWCPLINFOW;
 
167
  {$EXTERNALSYM NEWCPLINFO}
 
168
  LPNEWCPLINFO = LPNEWCPLINFOW;
 
169
  {$EXTERNALSYM LPNEWCPLINFO}
 
170
  TNewCplInfo = TNewCplInfoW;
 
171
  PNewCplInfo = PNewCplInfoW;
 
172
  {$ELSE}
 
173
  NEWCPLINFO = NEWCPLINFOA;
 
174
  {$EXTERNALSYM NEWCPLINFO}
 
175
  LPNEWCPLINFO = LPNEWCPLINFOA;
 
176
  {$EXTERNALSYM LPNEWCPLINFO}
 
177
  TNewCplInfo = TNewCplInfoA;
 
178
  PNewCplInfo = PNewCplInfoA;
 
179
  {$ENDIF UNICODE}
 
180
 
 
181
const
 
182
  CPL_DYNAMIC_RES = 0;
 
183
  {$EXTERNALSYM CPL_DYNAMIC_RES}
 
184
 
 
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.
 
196
 
 
197
// The messages CPlApplet() must handle:
 
198
 
 
199
  CPL_INIT = 1;
 
200
  {$EXTERNALSYM CPL_INIT}
 
201
 
 
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.
 
205
 
 
206
  CPL_GETCOUNT = 2;
 
207
  {$EXTERNALSYM CPL_GETCOUNT}
 
208
 
 
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
 
212
//  panel window.
 
213
 
 
214
  CPL_INQUIRE = 3;
 
215
  {$EXTERNALSYM CPL_INQUIRE}
 
216
 
 
217
//  This message is sent for information about each applet.
 
218
 
 
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
 
221
//  of CPL inquiries.
 
222
 
 
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.
 
230
 
 
231
  CPL_SELECT = 4;
 
232
  {$EXTERNALSYM CPL_SELECT}
 
233
 
 
234
//  The CPL_SELECT message has been deleted.
 
235
 
 
236
  CPL_DBLCLK = 5;
 
237
  {$EXTERNALSYM CPL_DBLCLK}
 
238
 
 
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.
 
243
 
 
244
  CPL_STOP = 6;
 
245
  {$EXTERNALSYM CPL_STOP}
 
246
 
 
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.
 
250
 
 
251
  CPL_EXIT = 7;
 
252
  {$EXTERNALSYM CPL_EXIT}
 
253
 
 
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.
 
257
 
 
258
  CPL_NEWINQUIRE = 8;
 
259
  {$EXTERNALSYM CPL_NEWINQUIRE}
 
260
 
 
261
// Same as CPL_INQUIRE execpt lParam2 is a pointer to a NEWCPLINFO struct.
 
262
 
 
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
 
265
//  of CPL inquiries.
 
266
 
 
267
  CPL_STARTWPARMSA = 9;
 
268
  {$EXTERNALSYM CPL_STARTWPARMSA}
 
269
  CPL_STARTWPARMSW = 10;
 
270
  {$EXTERNALSYM CPL_STARTWPARMSW}
 
271
 
 
272
  {$IFDEF UNICODE}
 
273
  CPL_STARTWPARMS = CPL_STARTWPARMSW;
 
274
  {$EXTERNALSYM CPL_STARTWPARMS}
 
275
  {$ELSE}
 
276
  CPL_STARTWPARMS = CPL_STARTWPARMSA;
 
277
  {$EXTERNALSYM CPL_STARTWPARMS}
 
278
  {$ENDIF UNICODE}
 
279
 
 
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.
 
286
 
 
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.
 
290
 
 
291
  CPL_SETUP = 200;
 
292
  {$EXTERNALSYM CPL_SETUP}
 
293
 
 
294
implementation
 
295
 
 
296
end.