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.

214 lines
8.0 KiB

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