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.

382 lines
12 KiB

  1. /*
  2. ***************************************************************
  3. * mmcpl.h
  4. *
  5. * Header file for mm control applet.
  6. *
  7. *
  8. * History:
  9. *
  10. * January -by- VijR
  11. * Created.
  12. ***************************************************************
  13. */
  14. #ifndef MMCPL_H
  15. #define MMCPL_H
  16. #define _INC_OLE
  17. #ifndef STRICT
  18. #define STRICT
  19. #endif
  20. #pragma warning( disable: 4103)
  21. #include <windows.h> // also includes windowsx.h
  22. #include <shellapi.h> // for registration functions
  23. #include <windowsx.h>
  24. #include <ole2.h>
  25. #include <mmsystem.h>
  26. #include <setupapi.h>
  27. #include <shlobj.h> // Shell OLE interfaces
  28. #include <string.h>
  29. #ifndef INITGUID
  30. #include <shlobjp.h>
  31. #endif
  32. #include <commdlg.h>
  33. #include "rcids.h" // Resource declaration
  34. #define PUBLIC FAR PASCAL
  35. #define CPUBLIC FAR _cdecl
  36. #define PRIVATE NEAR PASCAL
  37. //#include "utils.h" // Common macros
  38. /* Temporarily here until someone defines these for 16 bit side again. */
  39. #ifndef ERROR_SUCCESS
  40. #define ERROR_SUCCESS 0L
  41. #endif
  42. #ifndef ARRAYSIZE
  43. #define ARRAYSIZE(x) (sizeof((x))/sizeof((x)[0]))
  44. #endif
  45. /*
  46. ***************************************************************
  47. * Constants and Definitions
  48. ***************************************************************
  49. */
  50. #define MIDI TEXT("MIDI")
  51. #define ACM TEXT("ACM")
  52. #define MSACM TEXT("MSACM.")
  53. #define WAVE TEXT("Wave")
  54. #define MIDIMAP TEXT("MidiMapper")
  55. #define WAVEMAP TEXT("WaveMapper")
  56. #define AUX TEXT("Aux")
  57. #define MIXER TEXT("Mixer")
  58. #define JOYSTICK TEXT("Joystick")
  59. #define MCI TEXT("MCI")
  60. #define ICM TEXT("ICM")
  61. #define ICMSTR TEXT("VIDC.")
  62. #define ICMSTR2 TEXT("VIDS.")
  63. #define VIDCAP TEXT("MSVIDEO")
  64. #define AUDIO TEXT("Audio")
  65. #define CDAUDIO TEXT("CDAudio")
  66. #define VIDEO TEXT("Video")
  67. #define VOICE TEXT("Voice")
  68. #define VOLUME TEXT("Volume")
  69. #define MAXSTR 256 // maximum size of a string or filename
  70. #define SZCODE const TCHAR
  71. #define INTCODE const int
  72. #define WINDOWS_DEFAULTENTRY 1
  73. #define NONE_ENTRY 0
  74. #define MAXNAME 32 // Maximum name length
  75. #define MAXLNAME 64
  76. #define MAXMESSAGE 128 // Maximum resource string message
  77. #define MAXSTRINGLEN 256 // Maximum output string length
  78. #define MAXINTLEN 7 // Maximum interger string length
  79. #define MAXLONGLEN 11 // Maximum long string length
  80. #define MAXMSGLEN 512 // Maximum message length
  81. #define WAVE_ID 0
  82. #define MIDI_ID 1
  83. #define MIXER_ID 2
  84. #define AUX_ID 3
  85. #define MCI_ID 4
  86. #define ACM_ID 5
  87. #define ICM_ID 6
  88. #define VIDCAP_ID 7
  89. #define JOYSTICK_ID 8
  90. DEFINE_GUID(CLSID_mmsePropSheetHandler, 0x00022613L, 0x0000, 0x0000, 0xC0, 0x00, 0x00,
  91. 0x00, 0x00, 0x00, 0x00, 0x46);
  92. #define HWAVEOUT_MAPPER ((HWAVEOUT)IntToPtr(WAVE_MAPPER))
  93. #define HWAVEIN_MAPPER ((HWAVEIN)IntToPtr(WAVE_MAPPER))
  94. #define HMIDIOUT_MAPPER ((HMIDIOUT)IntToPtr(WAVE_MAPPER))
  95. #define HWAVEOUT_INDEX(i) ((HWAVEOUT)IntToPtr(i))
  96. #define HWAVEIN_INDEX(i) ((HWAVEIN)IntToPtr(i))
  97. #define HMIDIOUT_INDEX(i) ((HMIDIOUT)IntToPtr(i))
  98. #define HMIXER_INDEX(i) ((HMIXER)IntToPtr(i))
  99. #define HMIXEROBJ_INDEX(i) ((HMIXEROBJ)IntToPtr(i))
  100. /*
  101. ***************************************************************
  102. * Internal STRUCTS used by mm.cpl
  103. ***************************************************************
  104. */
  105. typedef struct _ClassNode
  106. {
  107. short iNode; //1 if class, 2 if device , 3-> ACM, 4->instrument
  108. TCHAR szClassName[64];
  109. TCHAR szClass[16];
  110. HICON hIcon;
  111. } CLASSNODE, * PCLASSNODE;
  112. typedef struct iResources
  113. {
  114. short iNode;
  115. TCHAR szFriendlyName[MAXSTR];
  116. TCHAR szDesc[MAXSTR];
  117. TCHAR szParam[64];
  118. TCHAR szFile[MAXSTR];
  119. TCHAR szDrvEntry[64];
  120. TCHAR szClass[16];
  121. HDRVR hDriver;
  122. DWORD dnDevNode;
  123. short fQueryable; // 0 -> can't, 1 -> can, -1 -> need to check
  124. short iClassID;
  125. int fStatus; //0 -> Disabled, 1-> Enabled and entry in reg, 2->Enabled but no entry in reg (i.e.old dev), 3->Enabled and ACTIVE, 4->inactive
  126. PCLASSNODE pcn;
  127. }IRESOURCE, *PIRESOURCE;
  128. typedef struct _Instrument
  129. {
  130. short iNode;
  131. TCHAR szFriendlyName[MAXSTR];
  132. TCHAR szInstr[64];
  133. PIRESOURCE pDev;
  134. }INSTRUMENT, * PINSTRUMENT;
  135. typedef struct event
  136. {
  137. short iNode; //1 if module 2 if event
  138. short fHasSound;
  139. LPTSTR pszEvent;
  140. LPTSTR pszEventLabel;
  141. LPTSTR pszPath;
  142. struct event *npNextEvent;
  143. } EVENT, *PEVENT;
  144. typedef struct module
  145. {
  146. short iNode; //1 if module 2 if event
  147. LPTSTR pszKey;
  148. LPTSTR pszLabel;
  149. BOOL fChange;
  150. PEVENT npList;
  151. } MODULE, *PMODULE;
  152. typedef struct _AudioDlgInfo
  153. {
  154. UINT uPrefIn;
  155. UINT uPrefOut;
  156. UINT uPrefMIDIOut;
  157. UINT cNumOutDevs;
  158. UINT cNumInDevs;
  159. UINT cNumMIDIOutDevs;
  160. BOOL fPrefOnly;
  161. } AUDIODLGINFO, * PAUDIODLGINFO;
  162. typedef struct
  163. {
  164. HDEVINFO hDevInfo;
  165. PSP_DEVINFO_DATA pDevInfoData;
  166. } ALLDEVINFO, *PALLDEVINFO;
  167. /*
  168. ***************************************************************
  169. * Globals and Strings used to loadstring resources at startup
  170. ***************************************************************
  171. */
  172. #ifdef __cplusplus
  173. extern "C" {
  174. #endif
  175. extern TCHAR gszNone[];
  176. extern TCHAR gszRemoveScheme[];
  177. extern TCHAR gszChangeScheme[];
  178. extern SZCODE gszWindowsHlp[];
  179. extern SZCODE gszNull[];
  180. extern SZCODE cszWavExt[];
  181. extern SZCODE cszMIDIExt[];
  182. extern SZCODE cszRMIExt[];
  183. extern SZCODE cszAVIExt[];
  184. extern SZCODE cszSlash[];
  185. extern SZCODE cszAUDIO[];
  186. extern SZCODE cszVIDEO[];
  187. extern SZCODE cszCDAUDIO[];
  188. extern SZCODE cszMIDI[];
  189. extern TCHAR gszDevEnabled[];
  190. extern TCHAR gszDevDisabled[];
  191. extern TCHAR gszGeneral[];
  192. extern HINSTANCE ghInstance;
  193. extern BOOL gfVoiceTab;
  194. extern HWND ghVocDlg;
  195. extern BOOL gfRedisplayCPL;
  196. extern INT_PTR PASCAL GetVerDesc (LPCTSTR pstrFile, LPTSTR pstrDesc);
  197. extern BOOL PASCAL GetExeDesc (LPTSTR szFile, LPTSTR pszBuff, int cchBuff);
  198. extern BOOL PASCAL LoadDesc(LPCTSTR pstrFile, LPTSTR pstrDesc);
  199. extern void AddExt(LPTSTR pszFile, LPCTSTR cszExt);
  200. extern BOOL PASCAL ValidateRegistry(void);
  201. #define GEI_MODNAME 0x01
  202. #define GEI_DESCRIPTION 0x02
  203. #define GEI_FLAGS 0x03
  204. #define GEI_EXEHDR 0x04
  205. #define GEI_FAPI 0x05
  206. MMRESULT GetWaveID(UINT *puWaveID);
  207. void PASCAL ShowPropSheet(LPCTSTR pszTitle,
  208. DLGPROC pfnDialog,
  209. UINT idTemplate,
  210. HWND hWndParent,
  211. LPTSTR pszCaption,
  212. LPARAM lParam);
  213. void PASCAL ShowMidiPropSheet(LPPROPSHEETHEADER ppshExt, LPCTSTR pszTitle,
  214. HWND hWndParent,
  215. short iMidiPropType,
  216. LPTSTR pszCaption,
  217. HTREEITEM hti,
  218. LPARAM lParam1,
  219. LPARAM lParam2);
  220. void PASCAL ShowWithMidiDevPropSheet(LPCTSTR pszTitle,
  221. DLGPROC pfnDialog,
  222. UINT idTemplate,
  223. HWND hWndParent,
  224. LPTSTR pszCaption,
  225. HTREEITEM hti,
  226. LPARAM lParam, LPARAM lParamExt1, LPARAM lParamExt2);
  227. #define MT_WAVE 1
  228. #define MT_MIDI 2
  229. #define MT_AVI 3
  230. #define MT_ASF 4
  231. #define MT_ERROR 0
  232. BOOL mmpsh_ShowFileDetails(LPTSTR pszCaption, HWND hwndParent, LPTSTR pszFile, short iMediaType);
  233. INT_PTR mmse_MessageBox(HWND hwndP, LPTSTR szMsg, LPTSTR szTitle, UINT uStyle);
  234. void PASCAL GetPropSheet(LPCTSTR pszTitle,
  235. LPCTSTR pszClass,
  236. DLGPROC pfnDialog,
  237. UINT idTemplate,
  238. HWND hWndParent,
  239. HICON hClassIcon,
  240. LPPROPSHEETHEADER ppsh, HPROPSHEETPAGE * lphpsp);
  241. BOOL PASCAL ErrorBox (HWND, int, LPTSTR);
  242. int PASCAL DisplayMessage(HWND hDlg, int iResTitle, int iResMsg, UINT uStyle);
  243. BOOL ACMEnumCodecs(void);
  244. void ACMCleanUp(void);
  245. void ACMNodeChange(HWND hDlg);
  246. BOOL CALLBACK MMExtPropSheetCallback(DWORD dwFunc, DWORD_PTR dwParam1, DWORD_PTR dwParam2, DWORD_PTR dwInstance);
  247. typedef BOOL (CALLBACK FAR * LPFNMMEXTPROPSHEETCALLBACK)(DWORD dwFunc, DWORD_PTR dwParam1, DWORD_PTR dwParam2, DWORD_PTR dwInstance);
  248. //Following are functions currently supported by the callback functions:
  249. //dwInstance parameter which is passed to the external module when its entry point
  250. //is called MUST always be passed back along with all the functions.
  251. #define MM_EPS_GETNODEDESC 0x00000001
  252. //Gets the description displayed in the tree for the node for which the External Prop. Sheet is up.
  253. //For 'simple' property sheet this just returns a sheet Name
  254. //dwParam1 is a pointer to a string buffer in which the description is returned
  255. #define MM_EPS_GETNODEID 0x00000002
  256. //Gets the Reg. Key Path offset from the MediaResources key
  257. //For 'simple' property sheet this just returns a sheet class
  258. //dwParam1 is a pointer to a string buffer in which the Key Path is returned
  259. #define MM_EPS_ADDSHEET 0x00000003
  260. //Adds a property sheet for the current node in the tree.
  261. //dwParam1 = HPROPSHEETPAGE for the page being added.
  262. #define MM_EPS_TREECHANGE 0x00000004
  263. //Notifies the CPL that the tree styructure has change. On receiving this function
  264. //the CPL rebuilds the subtree at this level and all levels below it.
  265. #define MM_EPS_BLIND_TREECHANGE 0x00000005
  266. //Notification from MIDI sheet that something has changed in the MIDI subtree.
  267. //BLIND because the sheet was not launched from the Adv. Tab, so we dont know
  268. //what the heck he is talking about.
  269. BOOL CALLBACK AddSimpleMidiPages (LPTSTR pszTitle, LPFNMMEXTPROPSHEETCALLBACK lpfnAddPropSheetPage,LPARAM lParam);
  270. BOOL CALLBACK AddMidiPages (LPCTSTR pszTitle, LPFNMMEXTPROPSHEETCALLBACK lpfnAddPropSheetPage,LPARAM lParam);
  271. BOOL CALLBACK AddDevicePages (LPCTSTR pszTitle, LPFNMMEXTPROPSHEETCALLBACK lpfnAddPropSheetPage,LPARAM lParam);
  272. BOOL CALLBACK AddInstrumentPages (LPCTSTR pszTitle, LPFNMMEXTPROPSHEETCALLBACK lpfnAddPropSheetPage,LPARAM lParam);
  273. #ifdef FIX_BUG_15451
  274. void ShowDriverSettings (HWND hDlg, LPTSTR pszName);
  275. #endif // FIX_BUG_15451
  276. #ifdef __cplusplus
  277. } // extern "C"
  278. #endif
  279. #define MIDI_CLASS_PROP 1
  280. #define MIDI_DEVICE_PROP 2
  281. #define MIDI_INSTRUMENT_PROP 3
  282. #define WM_ACMMAP_ACM_NOTIFY (WM_USER + 100)
  283. /*
  284. ***************************************************************
  285. * DEBUG Definitions
  286. ***************************************************************
  287. */
  288. #ifdef ASSERT
  289. #undef ASSERT
  290. #endif
  291. #ifdef DEBUG
  292. #define STATIC
  293. #ifdef DEBUG_TRACE
  294. #define DPF_T dprintf
  295. #else
  296. #define DPF_T 1 ? (void)0 : (void)
  297. #endif
  298. void FAR cdecl dprintf(LPSTR szFormat, ...);
  299. #define DPF dprintf
  300. #define ddd dprintf
  301. #define ASSERT(f) \
  302. { \
  303. if (!(f)) \
  304. DPF("ERROR-ERROR#####: Assertion failed in %s on line %d @@@@@",__FILE__, __LINE__); \
  305. }
  306. #else
  307. #define STATIC static
  308. #define ASSERT(f)
  309. #define DPF 1 ? (void)0 : (void)
  310. #define DPF_T 1 ? (void)0 : (void)
  311. #endif
  312. #endif // MMCPL_H