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.

168 lines
6.0 KiB

  1. /*****************************************************************************\
  2. * *
  3. * cpl.h - Control panel extension DLL definitions *
  4. * *
  5. * Version 3.10 *
  6. * *
  7. * Copyright (c) 1992-1994, Microsoft Corp. All rights reserved *
  8. * *
  9. ******************************************************************************
  10. * General rules for being installed in the Control Panel:
  11. *
  12. * 1) The DLL must export a function named CPlApplet which will handle
  13. * the messages discussed below.
  14. * 2) If the applet needs to save information in CONTROL.INI minimize
  15. * clutter by using the application name [MMCPL.appletname].
  16. * 2) If the applet is refrenced in CONTROL.INI under [MMCPL] use
  17. * the following form:
  18. * ...
  19. * [MMCPL]
  20. * uniqueName=c:\mydir\myapplet.dll
  21. * ...
  22. *
  23. *
  24. * The order applet DLL's are loaded by CONTROL.EXE is:
  25. *
  26. * 1) MAIN.CPL is loaded from the windows system directory.
  27. *
  28. * 2) Installable drivers that are loaded and export the
  29. * CplApplet() routine.
  30. *
  31. * 3) DLL's specified in the [MMCPL] section of CONTROL.INI.
  32. *
  33. * 4) DLL's named *.CPL from windows system directory.
  34. *
  35. */
  36. #ifndef _INC_CPL
  37. #define _INC_CPL
  38. #ifndef RC_INVOKED
  39. #pragma pack(1) /* Assume byte packing throughout */
  40. #endif /* RC_INVOKED */
  41. #ifdef __cplusplus
  42. extern "C" { /* Assume C declarations for C++ */
  43. #endif /* __cplusplus */
  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 - LPSTR 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 (CALLBACK *APPLET_PROC)(HWND hwndCpl, UINT msg, LPARAM lParam1, LPARAM lParam2);
  65. /* The data structure CPlApplet() must fill in. */
  66. typedef struct tagCPLINFO
  67. {
  68. int idIcon; /* icon resource id, provided by CPlApplet() */
  69. int idName; /* name string res. id, provided by CPlApplet() */
  70. int idInfo; /* info string res. id, provided by CPlApplet() */
  71. LONG lData; /* user defined data */
  72. } CPLINFO, *PCPLINFO, FAR *LPCPLINFO;
  73. typedef struct tagNEWCPLINFO
  74. {
  75. DWORD dwSize; /* similar to the commdlg */
  76. DWORD dwFlags;
  77. DWORD dwHelpContext; /* help context to use */
  78. LONG lData; /* user defined data */
  79. HICON hIcon; /* icon to use, this is owned by CONTROL.EXE (may be deleted) */
  80. char szName[32]; /* short name */
  81. char szInfo[64]; /* long name (status line) */
  82. char szHelpFile[128];/* path to help file to use */
  83. } NEWCPLINFO, *PNEWCPLINFO, FAR *LPNEWCPLINFO;
  84. /* The messages CPlApplet() must handle: */
  85. #define CPL_INIT 1
  86. /* This message is sent to indicate CPlApplet() was found. */
  87. /* lParam1 and lParam2 are not defined. */
  88. /* Return TRUE or FALSE indicating whether the control panel should proceed. */
  89. #define CPL_GETCOUNT 2
  90. /* This message is sent to determine the number of applets to be displayed. */
  91. /* lParam1 and lParam2 are not defined. */
  92. /* Return the number of applets you wish to display in the control */
  93. /* panel window. */
  94. #define CPL_INQUIRE 3
  95. /* This message is sent for information about each applet. */
  96. /* lParam1 is the applet number to register, a value from 0 to */
  97. /* (CPL_GETCOUNT - 1). lParam2 is a far ptr to a CPLINFO structure. */
  98. /* Fill in CPL_INFO's idIcon, idName, idInfo and lData fields with */
  99. /* the resource id for an icon to display, name and description string ids, */
  100. /* and a long data item associated with applet #lParam1. */
  101. #define CPL_SELECT 4
  102. /* This message is sent when the applet's icon has been clicked upon. */
  103. /* lParam1 is the applet number which was selected. lParam2 is the */
  104. /* applet's lData value. */
  105. #define CPL_DBLCLK 5
  106. /* This message is sent when the applet's icon has been double-clicked */
  107. /* upon. lParam1 is the applet number which was selected. lParam2 is the */
  108. /* applet's lData value. */
  109. /* This message should initiate the applet's dialog box. */
  110. #define CPL_STOP 6
  111. /* This message is sent for each applet when the control panel is exiting. */
  112. /* lParam1 is the applet number. lParam2 is the applet's lData value. */
  113. /* Do applet specific cleaning up here. */
  114. #define CPL_EXIT 7
  115. /* This message is sent just before the control panel calls FreeLibrary. */
  116. /* lParam1 and lParam2 are not defined. */
  117. /* Do non-applet specific cleaning up here. */
  118. #define CPL_NEWINQUIRE 8
  119. /* this is the same as CPL_INQUIRE execpt lParam2 is a pointer to a */
  120. /* NEWCPLINFO structure. this will be sent before the CPL_INQUIRE */
  121. /* and if it is responed to (return != 0) CPL_INQUIRE will not be sent */
  122. #define CPL_STARTWPARMS 9
  123. /* this message parallels CPL_DBLCLK in that the applet should initiate
  124. ** its dialog box. where it differs is that this invocation is coming
  125. ** out of RUNDLL, and there may be some extra directions for execution.
  126. ** lParam1: the applet number.
  127. ** lParam2: an LPSTR to any extra directions that might exist.
  128. ** returns: TRUE if the message was handled; FALSE if not.
  129. */
  130. #ifdef __cplusplus
  131. }
  132. #endif /* __cplusplus */
  133. #ifndef RC_INVOKED
  134. #pragma pack()
  135. #endif /* RC_INVOKED */
  136. #endif /* _INC_CPL */