progman.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. /*
  2. * Program Manager
  3. *
  4. * Copyright 1996 Ulrich Schmid
  5. * Copyright 2002 Sylvain Petreolle
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  20. */
  21. #ifndef PROGMAN_H
  22. #define PROGMAN_H
  23. #define MAX_STRING_LEN 255
  24. #define MAX_PATHNAME_LEN 1024
  25. #define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
  26. #include <windows.h>
  27. #include <windef.h>
  28. /* Fallback icon */
  29. #define DEFAULTICON OIC_WINLOGO
  30. /* Icon index in M$ Window's progman.exe */
  31. #define PROGMAN_ICON_INDEX 0
  32. #define GROUP_ICON_INDEX 6
  33. #define DEFAULT_ICON_INDEX 7
  34. #define DEF_GROUP_WIN_XPOS 100
  35. #define DEF_GROUP_WIN_YPOS 100
  36. #define DEF_GROUP_WIN_WIDTH 300
  37. #define DEF_GROUP_WIN_HEIGHT 200
  38. typedef struct
  39. {
  40. HLOCAL hGroup;
  41. HLOCAL hPrior;
  42. HLOCAL hNext;
  43. HWND hWnd;
  44. /**/ /* Numbers are byte indexes in *.grp */
  45. /**/ /* Program entry */
  46. INT x, y; /* 0 - 3 */
  47. INT nIconIndex; /* 4 - 5 */
  48. HICON hIcon;
  49. /* icon flags ??? */ /* 6 - 7 */
  50. /* iconANDsize */ /* 8 - 9 */
  51. /* iconXORsize */ /* 10 - 11 */
  52. /* pointer to IconInfo */ /* 12 - 13 */
  53. /* pointer to iconXORbits */ /* 14 - 15 */ /* sometimes iconANDbits ?! */
  54. /* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */
  55. HLOCAL hName; /* 18 - 19 */
  56. HLOCAL hCmdLine; /* 20 - 21 */
  57. HLOCAL hIconFile; /* 22 - 23 */
  58. HLOCAL hWorkDir; /* Extension 0x8101 */
  59. INT nHotKey; /* Extension 0x8102 */
  60. /* Modifier: bit 8... */
  61. INT nCmdShow; /* Extension 0x8103 */
  62. /**/ /* IconInfo */
  63. /* HotSpot x ??? */ /* 0 - 1 */
  64. /* HotSpot y ??? */ /* 2 - 3 */
  65. /* Width */ /* 4 - 5 */
  66. /* Height */ /* 6 - 7 */
  67. /* WidthBytes ??? */ /* 8 - 9 */
  68. /* Planes */ /* 10 - 10 */
  69. /* BitsPerPixel */ /* 11 - 11 */
  70. } PROGRAM;
  71. typedef struct
  72. {
  73. HLOCAL hPrior;
  74. HLOCAL hNext;
  75. HWND hWnd;
  76. HLOCAL hGrpFile;
  77. HLOCAL hActiveProgram;
  78. BOOL bFileNameModified;
  79. BOOL bOverwriteFileOk;
  80. INT seqnum;
  81. /**/ /* Absolute */
  82. /* magic `PMCC' */ /* 0 - 3 */
  83. /* checksum */ /* 4 - 5 */
  84. /* Extension ptr */ /* 6 - 7 */
  85. INT nCmdShow; /* 8 - 9 */
  86. INT x, y; /* 10 - 13 */
  87. INT width, height; /* 14 - 17 */
  88. INT iconx, icony; /* 18 - 21 */
  89. HLOCAL hName; /* 22 - 23 */
  90. /* unknown */ /* 24 - 31 */
  91. /* number of programs */ /* 32 - 33 */
  92. HLOCAL hPrograms; /* 34 ... */
  93. /**/ /* Extensions */
  94. /* Extension type */ /* 0 - 1 */
  95. /* Program number */ /* 2 - 3 */
  96. /* Size of entry */ /* 4 - 5 */
  97. /* Data */ /* 6 ... */
  98. /* magic `PMCC' */ /* Extension 0x8000 */
  99. /* End of Extensions */ /* Extension 0xffff */
  100. } PROGGROUP;
  101. typedef struct
  102. {
  103. HANDLE hInstance;
  104. HANDLE hAccel;
  105. HWND hMainWnd;
  106. HWND hMDIWnd;
  107. HICON hMainIcon;
  108. HICON hGroupIcon;
  109. HICON hDefaultIcon;
  110. HMENU hMainMenu;
  111. HMENU hFileMenu;
  112. HMENU hOptionMenu;
  113. HMENU hWindowsMenu;
  114. HMENU hLanguageMenu;
  115. LPCSTR lpszIniFile;
  116. LPCSTR lpszIcoFile;
  117. BOOL bAutoArrange;
  118. BOOL bSaveSettings;
  119. BOOL bMinOnRun;
  120. HLOCAL hGroups;
  121. HLOCAL hActiveGroup;
  122. } GLOBALS;
  123. extern GLOBALS Globals;
  124. INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type);
  125. INT MAIN_MessageBoxIDS_s(UINT ids_text_s, LPCSTR str, UINT ids_title, WORD type);
  126. VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replacestring);
  127. HLOCAL GRPFILE_ReadGroupFile(const char* path);
  128. BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup);
  129. ATOM GROUP_RegisterGroupWinClass(void);
  130. HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
  131. INT x, INT y, INT width, INT height,
  132. INT iconx, INT icony,
  133. BOOL bFileNameModified, BOOL bOverwriteFileOk,
  134. /* FIXME shouldn't be necessary */
  135. BOOL bSuppressShowWindow);
  136. VOID GROUP_NewGroup(void);
  137. VOID GROUP_ModifyGroup(HLOCAL hGroup);
  138. VOID GROUP_DeleteGroup(HLOCAL hGroup);
  139. /* FIXME shouldn't be necessary */
  140. VOID GROUP_ShowGroupWindow(HLOCAL hGroup);
  141. HLOCAL GROUP_FirstGroup(void);
  142. HLOCAL GROUP_NextGroup(HLOCAL hGroup);
  143. HLOCAL GROUP_ActiveGroup(void);
  144. HWND GROUP_GroupWnd(HLOCAL hGroup);
  145. LPCSTR GROUP_GroupName(HLOCAL hGroup);
  146. ATOM PROGRAM_RegisterProgramWinClass(void);
  147. HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
  148. INT x, INT y, LPCSTR lpszCmdLine,
  149. LPCSTR lpszIconFile, INT nIconIndex,
  150. LPCSTR lpszWorkDir, INT nHotKey, INT nCmdShow);
  151. VOID PROGRAM_NewProgram(HLOCAL hGroup);
  152. VOID PROGRAM_ModifyProgram(HLOCAL hProgram);
  153. VOID PROGRAM_CopyMoveProgram(HLOCAL hProgram, BOOL bMove);
  154. VOID PROGRAM_DeleteProgram(HLOCAL hProgram, BOOL BUpdateGrpFile);
  155. HLOCAL PROGRAM_FirstProgram(HLOCAL hGroup);
  156. HLOCAL PROGRAM_NextProgram(HLOCAL hProgram);
  157. HLOCAL PROGRAM_ActiveProgram(HLOCAL hGroup);
  158. LPCSTR PROGRAM_ProgramName(HLOCAL hProgram);
  159. VOID PROGRAM_ExecuteProgram(HLOCAL hLocal);
  160. INT DIALOG_New(INT nDefault);
  161. HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszGroupName, BOOL bMove);
  162. BOOL DIALOG_Delete(UINT ids_format_s, LPCSTR lpszName);
  163. BOOL DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszPath, INT nSize);
  164. BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
  165. LPSTR lpszWorkDir, LPSTR lpszIconFile,
  166. HICON *lphIcon, INT *nIconIndex,
  167. INT *lpnHotKey, INT *lpnCmdShow, INT nSize);
  168. VOID DIALOG_Execute(void);
  169. VOID STRING_LoadMenus(VOID);
  170. /* Class names */
  171. extern const WCHAR STRING_MAIN_WIN_CLASS_NAME[];
  172. extern const WCHAR STRING_MDI_WIN_CLASS_NAME[];
  173. extern const WCHAR STRING_GROUP_WIN_CLASS_NAME[];
  174. extern const WCHAR STRING_PROGRAM_WIN_CLASS_NAME[];
  175. /* Resource names */
  176. #define IDD_MAIN 1
  177. #define IDD_NEW 2
  178. #define IDD_OPEN 3
  179. #define IDD_MOVE 4
  180. #define IDD_COPY 5
  181. #define IDD_DELETE 6
  182. #define IDD_GROUP 7
  183. #define IDD_PROGRAM 8
  184. #define IDD_SYMBOL 9
  185. #define IDD_EXECUTE 10
  186. #define IDA_ACCEL 1
  187. /* Stringtable index */
  188. #define IDS_PROGRAM_MANAGER 0x02
  189. #define IDS_ERROR 0x03
  190. #define IDS_WARNING 0x04
  191. #define IDS_INFO 0x05
  192. #define IDS_DELETE 0x06
  193. #define IDS_DELETE_GROUP_s 0x07
  194. #define IDS_DELETE_PROGRAM_s 0x08
  195. #define IDS_NOT_IMPLEMENTED 0x09
  196. #define IDS_FILE_READ_ERROR_s 0x0a
  197. #define IDS_FILE_WRITE_ERROR_s 0x0b
  198. #define IDS_GRPFILE_READ_ERROR_s 0x0c
  199. #define IDS_OUT_OF_MEMORY 0x0d
  200. #define IDS_WINHELP_ERROR 0x0e
  201. #define IDS_UNKNOWN_FEATURE_s 0x0f
  202. #define IDS_FILE_NOT_OVERWRITTEN_s 0x10
  203. #define IDS_SAVE_GROUP_AS_s 0x11
  204. #define IDS_NO_HOT_KEY 0x12
  205. #define IDS_ALL_FILES 0x13
  206. #define IDS_PROGRAMS 0x14
  207. #define IDS_LIBRARIES_DLL 0x15
  208. #define IDS_SYMBOL_FILES 0x16
  209. #define IDS_SYMBOLS_ICO 0x17
  210. /* Menu */
  211. #define MAIN_MENU 0x109
  212. #define PM_NEW 0x100
  213. #define PM_OPEN 0x101
  214. #define PM_MOVE 0x102
  215. #define PM_COPY 0x103
  216. #define PM_DELETE 0x104
  217. #define PM_ATTRIBUTES 0x105
  218. #define PM_EXECUTE 0x107
  219. #define PM_EXIT 0x108
  220. #define PM_AUTO_ARRANGE 0x110
  221. #define PM_MIN_ON_RUN 0x111
  222. #define PM_SAVE_SETTINGS 0x113
  223. #define PM_OVERLAP 0x120
  224. #define PM_SIDE_BY_SIDE 0x121
  225. #define PM_ARRANGE 0x122
  226. #define PM_FIRST_CHILD 0x3030
  227. /*
  228. *#define PM_FIRST_LANGUAGE 0x400
  229. *#define PM_LAST_LANGUAGE 0x499
  230. */
  231. #define PM_CONTENTS 0x131
  232. #define PM_ABOUT_WINE 0x142
  233. /* Dialog `New' */
  234. /* RADIOBUTTON: The next two must be in sequence */
  235. #define PM_NEW_GROUP 0x150
  236. #define PM_NEW_PROGRAM 0x151
  237. #define PM_NEW_GROUP_TXT 0x152
  238. #define PM_NEW_PROGRAM_TXT 0x153
  239. /* Dialogs `Copy', `Move' */
  240. #define PM_PROGRAM 0x160
  241. #define PM_FROM_GROUP 0x161
  242. #define PM_TO_GROUP 0x162
  243. #define PM_TO_GROUP_TXT 0x163
  244. /* Dialogs `Group attributes' */
  245. #define PM_DESCRIPTION 0x170
  246. #define PM_DESCRIPTION_TXT 0x171
  247. #define PM_FILE 0x172
  248. #define PM_FILE_TXT 0x173
  249. /* Dialogs `Program attributes' */
  250. #define PM_COMMAND_LINE 0x180
  251. #define PM_COMMAND_LINE_TXT 0x181
  252. #define PM_DIRECTORY 0x182
  253. #define PM_DIRECTORY_TXT 0x183
  254. #define PM_HOT_KEY 0x184
  255. #define PM_HOT_KEY_TXT 0x185
  256. #define PM_ICON 0x186
  257. #define PM_OTHER_SYMBOL 0x187
  258. /* Dialog `Symbol' */
  259. #define PM_ICON_FILE 0x190
  260. #define PM_ICON_FILE_TXT 0x191
  261. #define PM_SYMBOL_LIST 0x192
  262. #define PM_SYMBOL_LIST_TXT 0x193
  263. /* Dialog `Execute' */
  264. #define PM_COMMAND 0x1a0
  265. #define PM_SYMBOL 0x1a1
  266. #define PM_BROWSE 0x1a2
  267. #define PM_HELP 0x1a3
  268. #endif /* PROGMAN_H */
  269. /* Local Variables: */
  270. /* c-file-style: "GNU" */
  271. /* End: */