Source code of Windows XP (NT5)
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.

245 lines
7.6 KiB

  1. /* (C) Copyright Microsoft Corporation 1991. All rights reserved. */
  2. /*
  3. * WORKBENCH INCLUDE FILE
  4. *
  5. * This is the public include for the workbench. All workbench client
  6. * applications and handler DLLs will need to include this file.
  7. *
  8. * The following must be included before this file:
  9. * windows.h
  10. * wincom.h
  11. * mediaman.h
  12. *
  13. */
  14. #ifndef _WRKBENCH_H_
  15. #define _WRKBENCH_H_
  16. #ifndef EXPORT
  17. #define EXPORT FAR PASCAL
  18. #endif
  19. /******* VERSION FOR USE IN INFO STRUCTURES *******/
  20. #define WRK_VERSION 0x100
  21. /******* RANDOM FUNCTIONS *******/
  22. BOOL EXPORT wrkClientInit( void );
  23. BOOL EXPORT wrkClientExit( void );
  24. WORD EXPORT wrkGetVariable(WORD w);
  25. BOOL EXPORT wrkSetVariable(WORD w, WORD wVariable);
  26. BOOL EXPORT wrkLoadDll(LPSTR lpszDllName);
  27. HWND EXPORT wrkCreateIntroWindow(HANDLE hInstApp,
  28. WORD wString1Id,
  29. WORD wString2Id,
  30. WORD wString3Id,
  31. WORD wBitmapId);
  32. BOOL EXPORT wrkDestroyIntroWindow(HWND hwndIntro);
  33. VOID EXPORT wrkShowAboutDialog(HANDLE hInstApp,
  34. HWND hwndParent,
  35. WORD wCaptionId,
  36. WORD wString1Id,
  37. WORD wString2Id,
  38. WORD wString3Id,
  39. WORD wBitmapId);
  40. #define WRKV_DEBUG 0
  41. #define WRKV_CONFIRMCONVERT 2
  42. #define WRKV_HINSTWORKBENCH 4
  43. /********* EXTENSION LIST *********/
  44. typedef DWORD EXTENSION;
  45. typedef HANDLE ExtensionList;
  46. WORD EXPORT wrkGetExtSize(ExtensionList extList);
  47. EXTENSION EXPORT wrkGetExtElement(ExtensionList extList,
  48. WORD wElement);
  49. WORD EXPORT wrkGetExtString(ExtensionList extList,
  50. LPSTR lpszBuf, WORD wSize);
  51. EXTENSION EXPORT wrkStringToExtension(LPSTR lpszString);
  52. BOOL EXPORT wrkExtInList(ExtensionList extList,
  53. EXTENSION extension);
  54. /********* INSTALLED TOOL FUNCTIONS *************/
  55. #ifndef _WRKI_H_
  56. typedef HANDLE InstalledTool;
  57. #endif
  58. InstalledTool EXPORT wrkRegisterLoader(HANDLE hModDll,
  59. MEDTYPE typeModule, MEDTYPE typeLogical,
  60. LPSTR lpszExtensions, LPSTR lpszTitle, WORD wFlags);
  61. InstalledTool EXPORT wrkRegisterHandler(HANDLE hModDll, MEDTYPE typeLogical,
  62. LPSTR lpszTitle, WORD wFlags);
  63. InstalledTool EXPORT wrkRegisterUtility(LPSTR lpszExeName,
  64. LPSTR lpszTitle, WORD wFlags);
  65. InstalledTool EXPORT wrkRegisterEditor(LPSTR lpszExeName, MEDTYPE typeLogical,
  66. LPSTR lpszTitle, WORD wFlags);
  67. InstalledTool EXPORT wrkIterTools(InstalledTool instTool, WORD wType);
  68. InstalledTool EXPORT wrkVerifyHandler(MEDTYPE typeLogical, LPSTR lpszSuggest);
  69. BOOL EXPORT wrkRealizeModule(InstalledTool tool);
  70. /* Defined tool/module types - for wrkIterTools */
  71. #define TOOL_LOADER 0x0001
  72. #define TOOL_EDITOR 0x0002
  73. #define TOOL_HANDLER 0x0004
  74. #define TOOL_UTILITY 0x0008
  75. #define TOOL_PROCTOOL 0x0010 // not implemented!
  76. #define TOOL_ALLTYPES 0xffff
  77. /* Flags for registerLoader */
  78. #define LOADF_DOESLOAD 0x0001
  79. #define LOADF_DOESSAVE 0x0002
  80. #define LOADF_FILEBASED 0x0004
  81. #define LOADF_CONVERTTOOL 0x0008
  82. #define LOADF_MANAGERTOOL 0x0010
  83. /******* Installed tool Information functions *******/
  84. typedef struct _InstalledToolInfo {
  85. WORD wVersion;
  86. WORD wType;
  87. WORD wFlags;
  88. WORD wUsage;
  89. MEDTYPE typeModule;
  90. MEDTYPE typeLogical;
  91. ExtensionList exten;
  92. } InstalledToolInfo;
  93. typedef InstalledToolInfo FAR *FPInstalledToolInfo;
  94. BOOL EXPORT wrkGetToolInfo(InstalledTool tool, FPInstalledToolInfo fpInfo);
  95. WORD EXPORT wrkGetToolType(InstalledTool tool);
  96. BOOL EXPORT wrkGetToolTitle(InstalledTool tool, LPSTR lpszBuf, WORD wLen);
  97. BOOL EXPORT wrkGetToolModname(InstalledTool tool, LPSTR lpszBuf, WORD wLen);
  98. BOOL EXPORT wrkGetLogicalExtensions(MEDTYPE typeLogical, WORD wFlags,
  99. LPSTR lpszBuf, WORD wLen);
  100. /******* TOOL ARRAY FUNCTIONS *******/
  101. #ifndef _WRKI_H_
  102. typedef WORD ToolArray;
  103. #endif
  104. ToolArray EXPORT wrkCreateToolArray(WORD wSize);
  105. BOOL EXPORT wrkDestroyToolArray(ToolArray toolArr);
  106. WORD EXPORT wrkAddToToolArray(ToolArray toolArr,
  107. InstalledTool tool, BOOL fNoDup);
  108. WORD EXPORT wrkGetToolArraySize(ToolArray toolArr);
  109. InstalledTool EXPORT wrkGetToolArrayEntry(ToolArray toolArr, WORD wIndex);
  110. WORD EXPORT wrkToolChooseDlg(HWND hwnd, ToolArray toolArr, WORD wInitial,
  111. LPSTR lpszTitle, LPSTR lpszFirst, WORD wFlags);
  112. #define TCD_NOSELECTION 0xffff
  113. /******* INSTANCE FUNCTIONS ********/
  114. typedef HANDLE ToolInstance;
  115. ToolInstance EXPORT wrkAddInstance(InstalledTool toolHandle, HWND hwnd,
  116. LPSTR lpszInstTitle, WORD wFlags);
  117. BOOL EXPORT wrkRemoveInstance(ToolInstance toolInst);
  118. LONG EXPORT wrkInstSendMessage(ToolInstance toolInst, unsigned msg,
  119. WORD wParam, LONG lParam);
  120. BOOL EXPORT wrkInstPostMessage(ToolInstance toolInst, unsigned msg,
  121. WORD wParam, LONG lParam);
  122. BOOL EXPORT wrkBroadcastMessage(BOOL fPost, unsigned msg,
  123. WORD wParam, LONG lParam);
  124. ToolInstance EXPORT wrkGetNextInst(ToolInstance toolInst);
  125. /* Tool instance info functions */
  126. typedef struct _ToolInstanceInfo {
  127. WORD wVersion;
  128. WORD wAction;
  129. InstalledTool toolClass;
  130. WORD wInstFlags;
  131. HWND hwndTool;
  132. } ToolInstanceInfo;
  133. typedef ToolInstanceInfo FAR *FPToolInstanceInfo;
  134. /* Action codes for wrkSetInstInfo structure */
  135. #define WRKINFO_INSTFLAGS 0x0002
  136. #define WRKINFO_HWND 0x0008
  137. #define WRKINFO_ALL 0x00FF
  138. InstalledTool EXPORT wrkGetInstToolType(ToolInstance toolInst);
  139. BOOL EXPORT wrkSetInstInfo(ToolInstance toolInst, FPToolInstanceInfo fpInfo);
  140. BOOL EXPORT wrkGetInstInfo(ToolInstance toolInst, FPToolInstanceInfo fpInfo);
  141. BOOL EXPORT wrkSetInstTitle(ToolInstance toolInst, LPSTR lpszInstTitle);
  142. BOOL EXPORT wrkGetInstTitle(ToolInstance toolInst, LPSTR lpszBuf, WORD wLen);
  143. /* Flags for SetInstInfo & AddInstance */
  144. #define WRK_NOINSTNOTIFY 0x0001
  145. /********* RESOURCE ACCESS **************/
  146. WORD EXPORT wrkOpenFilename(LPSTR lpszFilename, FPMedReturn medReturn,
  147. MEDTYPE typeLogical, WORD wFlags, HWND hwnd, LPSTR lpszTitle);
  148. WORD EXPORT wrkOpenDialog(FPMedReturn medReturn, MEDTYPE typeLogical,
  149. WORD wFlags, HWND hwnd, LPSTR lpszTitle);
  150. WORD EXPORT wrkSaveDialog(MEDID medid, FPMedReturn medReturn,
  151. WORD wFlags, HWND hwnd, LPSTR lpszTitle);
  152. BOOL EXPORT wrkShowResError(HWND hwnd, LPSTR lpszTitle);
  153. /* Flags for FileLoading/Saving functions */
  154. #define WRK_SHOWERROR 0x0001
  155. #define WRK_SAVEASDIALOG 0x0002
  156. #define WRK_NONSHARED 0x2000
  157. #define WRK_SHAREDONLY 0x1000
  158. /********* TOOL INSTANCE STARTING *********/
  159. ToolInstance EXPORT wrkRunTool(InstalledTool tool, LPSTR lpszArguments,
  160. WORD wCmdShow, HWND hwndParent, WORD wFlags);
  161. #define WRK_NOGETINSTHANDLE 0x0080
  162. /*
  163. * Messages sent to client tools
  164. */
  165. #define WRK_MINMESSAGE 0xB000
  166. #define WRK_MAXMESSAGE 0xBFFF
  167. /* Notification messages */
  168. #define WRK_NEWINSTANCE (WRK_MINMESSAGE + 3)
  169. #define WRK_DELETEINSTANCE (WRK_MINMESSAGE + 4)
  170. #define WRK_CHANGEINSTANCE (WRK_MINMESSAGE + 5)
  171. #define WRK_NEWTOOL (WRK_MINMESSAGE + 6)
  172. #define WRK_DELETETOOL (WRK_MINMESSAGE + 7)
  173. /* Control messages - instance related */
  174. #define WRK_CLOSEINST (WRK_MINMESSAGE + 10)
  175. #define WRK_ACTIVATEINST (WRK_MINMESSAGE + 11)
  176. #define WRK_DEACTIVATEINST (WRK_MINMESSAGE + 12)
  177. /* Control messages - resource related */
  178. #define WRK_SETRESOURCE (WRK_MINMESSAGE + 19)
  179. /* Flags for WRK_CHANGEINSTANCE message */
  180. #define WRKINST_FLAGS 1L
  181. #define WRKINST_TITLE 4L
  182. #define WRKINST_HWND 8L
  183. /*
  184. * Workbench Error messages
  185. */
  186. #define WRKERR_NOERROR (MMERR_MAXERROR + 0)
  187. #define WRKERR_NOPROFWRITE (MMERR_MAXERROR + 1)
  188. #define WRKERR_HANDLERNOTAVAIL (MMERR_MAXERROR + 10)
  189. #define WRKERR_COULDNOTLOADMOD (MMERR_MAXERROR + 11)
  190. #define WRKERR_USERCANCEL (MMERR_MAXERROR + 12)
  191. #define WRKERR_NOLOADERSAVAIL (MMERR_MAXERROR + 13)
  192. #define WRKERR_COULDNOTRUNTOOL (MMERR_MAXERROR + 14)
  193. #define WRKERR_NOSAVERSAVAIL (MMERR_MAXERROR + 15)
  194. #define WRKERR_UNNAMEDRES (MMERR_MAXERROR + 16)
  195. #define WRKERR_NOCONVERTTOOL (MMERR_MAXERROR + 17)
  196. #define WRKERR_ALREADYACCESSED (MMERR_MAXERROR + 18)
  197. /* This endif must be the last line of the file */
  198. #endif /* _WRKBENCH_H_ */