Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
8.1 KiB

  1. /*****************************************************************************\
  2. * *
  3. * cpl.h - Control panel extension DLL definitions *
  4. * *
  5. * Version 3.10 *
  6. * *
  7. * Copyright (c) Microsoft Corporation. All rights reserved. *
  8. * *
  9. ******************************************************************************/
  10. /*
  11. * General rules for being installed in the Control Panel:
  12. *
  13. * 1) The DLL must export a function named CPlApplet which will handle
  14. * the messages discussed below.
  15. * 2) If the applet needs to save information in CONTROL.INI minimize
  16. * clutter by using the application name [MMCPL.appletname].
  17. * 2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
  18. * the following form:
  19. * ...
  20. * [MMCPL]
  21. * uniqueName=c:\mydir\myapplet.dll
  22. * ...
  23. *
  24. *
  25. * The order applet DLL's are loaded by CONTROL.EXE is not guaranteed.
  26. * Control panels may be sorted for display, etc.
  27. *
  28. */
  29. #ifndef _INC_CPL
  30. #define _INC_CPL
  31. #include <pshpack1.h> /* Assume byte packing throughout */
  32. #ifdef __cplusplus
  33. extern "C" { /* Assume C declarations for C++ */
  34. #endif /* __cplusplus */
  35. /*
  36. * CONTROL.EXE will answer this message and launch an applet
  37. *
  38. * WM_CPL_LAUNCH
  39. *
  40. * wParam - window handle of calling app
  41. * lParam - LPTSTR of name of applet to launch
  42. *
  43. * WM_CPL_LAUNCHED
  44. *
  45. * wParam - TRUE/FALSE if applet was launched
  46. * lParam - NULL
  47. *
  48. * CONTROL.EXE will post this message to the caller when the applet returns
  49. * (ie., when wParam is a valid window handle)
  50. *
  51. */
  52. #define WM_CPL_LAUNCH (WM_USER+1000)
  53. #define WM_CPL_LAUNCHED (WM_USER+1001)
  54. /* A function prototype for CPlApplet() */
  55. //typedef LRESULT (APIENTRY *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
  56. typedef LONG (APIENTRY *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
  57. /* The data structure CPlApplet() must fill in. */
  58. typedef struct tagCPLINFO
  59. {
  60. int idIcon; /* icon resource id, provided by CPlApplet() */
  61. int idName; /* name string res. id, provided by CPlApplet() */
  62. int idInfo; /* info string res. id, provided by CPlApplet() */
  63. LONG_PTR lData; /* user defined data */
  64. } CPLINFO, *LPCPLINFO;
  65. typedef struct tagNEWCPLINFOA
  66. {
  67. DWORD dwSize; /* similar to the commdlg */
  68. DWORD dwFlags;
  69. DWORD dwHelpContext; /* help context to use */
  70. LONG_PTR lData; /* user defined data */
  71. HICON hIcon; /* icon to use, this is owned by CONTROL.EXE (may be deleted) */
  72. CHAR szName[32]; /* short name */
  73. CHAR szInfo[64]; /* long name (status line) */
  74. CHAR szHelpFile[128];/* path to help file to use */
  75. } NEWCPLINFOA, *LPNEWCPLINFOA;
  76. typedef struct tagNEWCPLINFOW
  77. {
  78. DWORD dwSize; /* similar to the commdlg */
  79. DWORD dwFlags;
  80. DWORD dwHelpContext; /* help context to use */
  81. LONG_PTR lData; /* user defined data */
  82. HICON hIcon; /* icon to use, this is owned by CONTROL.EXE (may be deleted) */
  83. WCHAR szName[32]; /* short name */
  84. WCHAR szInfo[64]; /* long name (status line) */
  85. WCHAR szHelpFile[128];/* path to help file to use */
  86. } NEWCPLINFOW, *LPNEWCPLINFOW;
  87. #ifdef UNICODE
  88. typedef NEWCPLINFOW NEWCPLINFO;
  89. typedef LPNEWCPLINFOW LPNEWCPLINFO;
  90. #else
  91. typedef NEWCPLINFOA NEWCPLINFO;
  92. typedef LPNEWCPLINFOA LPNEWCPLINFO;
  93. #endif // UNICODE
  94. #if(WINVER >= 0x0400)
  95. #define CPL_DYNAMIC_RES 0
  96. // This constant may be used in place of real resource IDs for the idIcon,
  97. // idName or idInfo members of the CPLINFO structure. Normally, the system
  98. // uses these values to extract copies of the resources and store them in a
  99. // cache. Once the resource information is in the cache, the system does not
  100. // need to load a CPL unless the user actually tries to use it.
  101. // CPL_DYNAMIC_RES tells the system not to cache the resource, but instead to
  102. // load the CPL every time it needs to display information about an item. This
  103. // allows a CPL to dynamically decide what information will be displayed, but
  104. // is SIGNIFICANTLY SLOWER than displaying information from a cache.
  105. // Typically, CPL_DYNAMIC_RES is used when a control panel must inspect the
  106. // runtime status of some device in order to provide text or icons to display.
  107. #endif /* WINVER >= 0x0400 */
  108. /* The messages CPlApplet() must handle: */
  109. #define CPL_INIT 1
  110. /* This message is sent to indicate CPlApplet() was found. */
  111. /* lParam1 and lParam2 are not defined. */
  112. /* Return TRUE or FALSE indicating whether the control panel should proceed. */
  113. #define CPL_GETCOUNT 2
  114. /* This message is sent to determine the number of applets to be displayed. */
  115. /* lParam1 and lParam2 are not defined. */
  116. /* Return the number of applets you wish to display in the control */
  117. /* panel window. */
  118. #define CPL_INQUIRE 3
  119. /* This message is sent for information about each applet. */
  120. /* A CPL SHOULD HANDLE BOTH THE CPL_INQUIRE AND CPL_NEWINQUIRE MESSAGES. */
  121. /* The developer must not make any assumptions about the order or dependance */
  122. /* of CPL inquiries. */
  123. /* lParam1 is the applet number to register, a value from 0 to */
  124. /* (CPL_GETCOUNT - 1). lParam2 is a far ptr to a CPLINFO structure. */
  125. /* Fill in CPLINFO's idIcon, idName, idInfo and lData fields with */
  126. /* the resource id for an icon to display, name and description string ids, */
  127. /* and a long data item associated with applet #lParam1. This information */
  128. /* may be cached by the caller at runtime and/or across sessions. */
  129. /* To prevent caching, see CPL_DYNAMIC_RES, above. */
  130. #define CPL_SELECT 4
  131. /* The CPL_SELECT message has been deleted. */
  132. #define CPL_DBLCLK 5
  133. /* This message is sent when the applet's icon has been double-clicked */
  134. /* upon. lParam1 is the applet number which was selected. lParam2 is the */
  135. /* applet's lData value. */
  136. /* This message should initiate the applet's dialog box. */
  137. #define CPL_STOP 6
  138. /* This message is sent for each applet when the control panel is exiting. */
  139. /* lParam1 is the applet number. lParam2 is the applet's lData value. */
  140. /* Do applet specific cleaning up here. */
  141. #define CPL_EXIT 7
  142. /* This message is sent just before the control panel calls FreeLibrary. */
  143. /* lParam1 and lParam2 are not defined. */
  144. /* Do non-applet specific cleaning up here. */
  145. #define CPL_NEWINQUIRE 8
  146. /* Same as CPL_INQUIRE execpt lParam2 is a pointer to a NEWCPLINFO struct. */
  147. /* A CPL SHOULD HANDLE BOTH THE CPL_INQUIRE AND CPL_NEWINQUIRE MESSAGES. */
  148. /* The developer must not make any assumptions about the order or dependance */
  149. /* of CPL inquiries. */
  150. #if(WINVER >= 0x0400)
  151. #define CPL_STARTWPARMSA 9
  152. #define CPL_STARTWPARMSW 10
  153. #ifdef UNICODE
  154. #define CPL_STARTWPARMS CPL_STARTWPARMSW
  155. #else
  156. #define CPL_STARTWPARMS CPL_STARTWPARMSA
  157. #endif
  158. /* this message parallels CPL_DBLCLK in that the applet should initiate
  159. ** its dialog box. where it differs is that this invocation is coming
  160. ** out of RUNDLL, and there may be some extra directions for execution.
  161. ** lParam1: the applet number.
  162. ** lParam2: an LPSTR to any extra directions that might exist.
  163. ** returns: TRUE if the message was handled; FALSE if not.
  164. */
  165. #endif /* WINVER >= 0x0400 */
  166. /* This message is internal to the Control Panel and MAIN applets. */
  167. /* It is only sent when an applet is invoked from the Command line */
  168. /* during system installation. */
  169. #define CPL_SETUP 200
  170. #ifdef __cplusplus
  171. }
  172. #endif /* __cplusplus */
  173. #include <poppack.h>
  174. #endif /* _INC_CPL */