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.

463 lines
20 KiB

  1. /*----------------------------------------------------------------------------*\
  2. *
  3. * MCIWnd
  4. *
  5. * MCIWnd window class header file.
  6. *
  7. * the MCIWnd window class is a window class for controling MCI devices
  8. * MCI devices include, wave files, midi files, AVI Video, cd audio,
  9. * vcr, video disc, and others..
  10. *
  11. * to learn more about MCI and mci command sets see the
  12. * "Microsoft Multimedia Programmers's guide" in the Win31 SDK
  13. *
  14. * the easiest use of the MCIWnd class is like so:
  15. *
  16. * hwnd = MCIWndCreate(hwndParent, hInstance, 0, "chimes.wav");
  17. * ...
  18. * MCIWndPlay(hwnd);
  19. * MCIWndStop(hwnd);
  20. * MCIWndPause(hwnd);
  21. * ....
  22. * MCIWndDestroy(hwnd);
  23. *
  24. * this will create a window with a play/pause, stop and a playbar
  25. * and start the wave file playing.
  26. *
  27. * mciwnd.h defines macros for all the most common MCI commands, but
  28. * any string command can be used if needed.
  29. *
  30. * Note: unlike the mciSendString() API, no alias or file name needs
  31. * to be specifed, since the device to use is implied by the window handle.
  32. *
  33. * MCIWndSendString(hwnd, "setaudio stream to 2");
  34. *
  35. * (C) Copyright Microsoft Corp. 1991-1994. All rights reserved.
  36. *
  37. * You have a royalty-free right to use, modify, reproduce and
  38. * distribute the Sample Files (and/or any modified version) in
  39. * any way you find useful, provided that you agree that
  40. * Microsoft has no warranty obligations or liability for any
  41. * Sample Application Files.
  42. *
  43. * If you did not get this from Microsoft Sources, then it may not be the
  44. * most current version. This sample code in particular will be updated
  45. * and include more documentation.
  46. *
  47. * Sources are:
  48. * CompuServe: WINSDK forum, MDK section.
  49. * Anonymous FTP from ftp.uu.net vendor\microsoft\multimedia
  50. *
  51. * WIN32:
  52. *
  53. * MCIWnd supports both ansi and unicode interfaces. For any message that
  54. * takes or returns a text string, two versions of the message are defined,
  55. * appended with A or W for Ansi or Wide Char. The message or api itself
  56. * is defined to be one or other of these depending on whether you have
  57. * UNICODE defined in your application.
  58. * Thus for the api MCIWndCreate, there are in fact two apis,
  59. * MCIWndCreateA and MCIWndCreateW. If you call MCIWndCreate, this will be
  60. * re-routed to MCIWndCreateA unless UNICODE is defined when building your
  61. * application. In any one application, you can mix calls to the
  62. * Ansi and Unicode entrypoints.
  63. *
  64. * If you use SendMessage instead of the macros below such as MCIWndOpen(),
  65. * you will see that the messages have changed for WIN32, to support Ansi
  66. * and Unicode entrypoints. In particular, MCI_OPEN has been replaced by
  67. * MCWNDM_OPENA, or MCIWNDM_OPENW (MCIWNDM_OPEN is defined to be one or
  68. * other of these).
  69. *
  70. * Also, note that the WIN32 implementation of MCIWnd uses UNICODE
  71. * so all apis and messages supporting ANSI strings do so by mapping them
  72. * UNICODE strings and then calling the corresponding UNICODE entrypoint.
  73. *
  74. *----------------------------------------------------------------------------*/
  75. #ifndef INC_MCIWND
  76. #define INC_MCIWND
  77. #ifdef __cplusplus
  78. // MFC Redefines SendMessage, so make sure we get the global one....
  79. #define MCIWndSM ::SendMessage /* SendMessage in C++*/
  80. #else
  81. #define MCIWndSM SendMessage /* SendMessage in C */
  82. #endif /* __cplusplus */
  83. #ifdef __cplusplus
  84. extern "C" {
  85. #endif
  86. #define MCIWND_WINDOW_CLASS TEXT("MCIWndClass")
  87. #ifdef WIN32
  88. HWND FAR _cdecl _loadds MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
  89. DWORD dwStyle,LPCSTR szFile);
  90. HWND FAR _cdecl _loadds MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance,
  91. DWORD dwStyle,LPCWSTR szFile);
  92. #ifdef UNICODE
  93. #define MCIWndCreate MCIWndCreateW
  94. #else
  95. #define MCIWndCreate MCIWndCreateA
  96. #endif
  97. #else
  98. HWND FAR _cdecl _loadds MCIWndCreate(HWND hwndParent, HINSTANCE hInstance,
  99. DWORD dwStyle,LPCSTR szFile);
  100. #endif
  101. BOOL FAR _cdecl _loadds MCIWndRegisterClass();
  102. // Flags for the MCIWndOpen command
  103. #define MCIWNDOPENF_NEW 0x0001 // open a new file
  104. // window styles
  105. #define MCIWNDF_NOAUTOSIZEWINDOW 0x0001 // when movie size changes
  106. #define MCIWNDF_NOPLAYBAR 0x0002 // no toolbar
  107. #define MCIWNDF_NOAUTOSIZEMOVIE 0x0004 // when window size changes
  108. #define MCIWNDF_NOMENU 0x0008 // no popup menu from RBUTTONDOWN
  109. #define MCIWNDF_SHOWNAME 0x0010 // show name in caption
  110. #define MCIWNDF_SHOWPOS 0x0020 // show position in caption
  111. #define MCIWNDF_SHOWMODE 0x0040 // show mode in caption
  112. #define MCIWNDF_SHOWALL 0x0070 // show all
  113. #ifdef WIN32
  114. // some notifications include text strings.
  115. // to receive notifications in ANSI instead of unicode set the
  116. // MCIWNDF_NOTIFYANSI style bit. The macros below include this bit
  117. // by default unless you define UNICODE in your application.
  118. #define MCIWNDF_NOTIFYANSI 0x0080
  119. #define MCIWNDF_NOTIFYMODEW 0x0100 // tell parent of mode change
  120. #define MCIWNDF_NOTIFYPOSW 0x0200 // tell parent of pos change
  121. #define MCIWNDF_NOTIFYSIZEW 0x0400 // tell parent of size change
  122. #define MCIWNDF_NOTIFYMEDIAW 0x0800 // tell parent of media change
  123. #define MCIWNDF_NOTIFYERRORW 0x1000 // tell parent of an error
  124. #define MCIWNDF_NOTIFYALLW 0x1F00 // tell all
  125. #define MCIWNDF_NOTIFYMODEA 0x0180 // tell parent of mode change
  126. #define MCIWNDF_NOTIFYPOSA 0x0280 // tell parent of pos change
  127. #define MCIWNDF_NOTIFYSIZEA 0x0480 // tell parent of size change
  128. #define MCIWNDF_NOTIFYMEDIAA 0x0880 // tell parent of media change
  129. #define MCIWNDF_NOTIFYERRORA 0x1080 // tell parent of an error
  130. #define MCIWNDF_NOTIFYALLA 0x1F80 // tell all
  131. #ifdef UNICODE
  132. #define MCIWNDF_NOTIFYMODE MCIWNDF_NOTIFYMODEW
  133. #define MCIWNDF_NOTIFYPOS MCIWNDF_NOTIFYPOSW
  134. #define MCIWNDF_NOTIFYSIZE MCIWNDF_NOTIFYSIZEW
  135. #define MCIWNDF_NOTIFYMEDIA MCIWNDF_NOTIFYMEDIAW
  136. #define MCIWNDF_NOTIFYERROR MCIWNDF_NOTIFYERRORW
  137. #define MCIWNDF_NOTIFYALL MCIWNDF_NOTIFYALLW
  138. #else
  139. #define MCIWNDF_NOTIFYMODE MCIWNDF_NOTIFYMODEA
  140. #define MCIWNDF_NOTIFYPOS MCIWNDF_NOTIFYPOSA
  141. #define MCIWNDF_NOTIFYSIZE MCIWNDF_NOTIFYSIZEA
  142. #define MCIWNDF_NOTIFYMEDIA MCIWNDF_NOTIFYMEDIAA
  143. #define MCIWNDF_NOTIFYERROR MCIWNDF_NOTIFYERRORA
  144. #define MCIWNDF_NOTIFYALL MCIWNDF_NOTIFYALLA
  145. #endif
  146. #else
  147. #define MCIWNDF_NOTIFYMODE 0x0100 // tell parent of mode change
  148. #define MCIWNDF_NOTIFYPOS 0x0200 // tell parent of pos change
  149. #define MCIWNDF_NOTIFYSIZE 0x0400 // tell parent of size change
  150. #define MCIWNDF_NOTIFYMEDIA 0x0800 // tell parent of media change
  151. #define MCIWNDF_NOTIFYERROR 0x1000 // tell parent of an error
  152. #define MCIWNDF_NOTIFYALL 0x1F00 // tell all
  153. #endif
  154. #define MCIWNDF_RECORD 0x2000 // Give a record button
  155. #define MCIWNDF_NOERRORDLG 0x4000 // Show Error Dlgs for MCI cmds?
  156. #define MCIWNDF_NOOPEN 0x8000 // Don't allow user to open things
  157. // can macros
  158. #define MCIWndCanPlay(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_CAN_PLAY,0,0)
  159. #define MCIWndCanRecord(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_CAN_RECORD,0,0)
  160. #define MCIWndCanSave(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_CAN_SAVE,0,0)
  161. #define MCIWndCanWindow(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_CAN_WINDOW,0,0)
  162. #define MCIWndCanEject(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_CAN_EJECT,0,0)
  163. #define MCIWndCanConfig(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_CAN_CONFIG,0,0)
  164. #define MCIWndPaletteKick(hwnd) (BOOL)MCIWndSM(hwnd,MCIWNDM_PALETTEKICK,0,0)
  165. #define MCIWndSave(hwnd, szFile) (LONG)MCIWndSM(hwnd, MCI_SAVE, 0, (LPARAM)(LPVOID)(szFile))
  166. #define MCIWndSaveDialog(hwnd) MCIWndSave(hwnd, -1)
  167. // if you dont give a device it will use the current device....
  168. #define MCIWndNew(hwnd, lp) (LONG)MCIWndSM(hwnd, MCIWNDM_NEW, 0, (LPARAM)(LPVOID)(lp))
  169. #define MCIWndRecord(hwnd) (LONG)MCIWndSM(hwnd, MCI_RECORD, 0, 0)
  170. #ifdef WIN32
  171. #define MCIWndOpen(hwnd, sz, f) (LONG)MCIWndSM(hwnd, MCIWNDM_OPEN, (WPARAM)(UINT)(f),(LPARAM)(LPVOID)(sz))
  172. #else
  173. #define MCIWndOpen(hwnd, sz, f) (LONG)MCIWndSM(hwnd, MCI_OPEN, (WPARAM)(UINT)(f),(LPARAM)(LPVOID)(sz))
  174. #endif
  175. #define MCIWndOpenDialog(hwnd) MCIWndOpen(hwnd, -1, 0)
  176. #define MCIWndClose(hwnd) (LONG)MCIWndSM(hwnd, MCI_CLOSE, 0, 0)
  177. #define MCIWndPlay(hwnd) (LONG)MCIWndSM(hwnd, MCI_PLAY, 0, 0)
  178. #define MCIWndStop(hwnd) (LONG)MCIWndSM(hwnd, MCI_STOP, 0, 0)
  179. #define MCIWndPause(hwnd) (LONG)MCIWndSM(hwnd, MCI_PAUSE, 0, 0)
  180. #define MCIWndResume(hwnd) (LONG)MCIWndSM(hwnd, MCI_RESUME, 0, 0)
  181. #define MCIWndSeek(hwnd, lPos) (LONG)MCIWndSM(hwnd, MCI_SEEK, 0, (LPARAM)(LONG)(lPos))
  182. #define MCIWndEject(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_EJECT, 0, 0)
  183. #define MCIWndHome(hwnd) MCIWndSeek(hwnd, MCIWND_START)
  184. #define MCIWndEnd(hwnd) MCIWndSeek(hwnd, MCIWND_END)
  185. #define MCIWndGetSource(hwnd, prc) (LONG)MCIWndSM(hwnd, MCIWNDM_GET_SOURCE, 0, (LPARAM)(LPRECT)(prc))
  186. #define MCIWndPutSource(hwnd, prc) (LONG)MCIWndSM(hwnd, MCIWNDM_PUT_SOURCE, 0, (LPARAM)(LPRECT)(prc))
  187. #define MCIWndGetDest(hwnd, prc) (LONG)MCIWndSM(hwnd, MCIWNDM_GET_DEST, 0, (LPARAM)(LPRECT)(prc))
  188. #define MCIWndPutDest(hwnd, prc) (LONG)MCIWndSM(hwnd, MCIWNDM_PUT_DEST, 0, (LPARAM)(LPRECT)(prc))
  189. #define MCIWndPlayReverse(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_PLAYREVERSE, 0, 0)
  190. #define MCIWndPlayFrom(hwnd, lPos) (LONG)MCIWndSM(hwnd, MCIWNDM_PLAYFROM, 0, (LPARAM)(LONG)(lPos))
  191. #define MCIWndPlayTo(hwnd, lPos) (LONG)MCIWndSM(hwnd, MCIWNDM_PLAYTO, 0, (LPARAM)(LONG)(lPos))
  192. #define MCIWndPlayFromTo(hwnd, lStart, lEnd) (MCIWndSeek(hwnd, lStart), MCIWndPlayTo(hwnd, lEnd))
  193. #define MCIWndGetDeviceID(hwnd) (UINT)MCIWndSM(hwnd, MCIWNDM_GETDEVICEID, 0, 0)
  194. #define MCIWndGetAlias(hwnd) (UINT)MCIWndSM(hwnd, MCIWNDM_GETALIAS, 0, 0)
  195. #define MCIWndGetMode(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_GETMODE, (WPARAM)(UINT)(len), (LPARAM)(LPTSTR)(lp))
  196. #define MCIWndGetPosition(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_GETPOSITION, 0, 0)
  197. #define MCIWndGetPositionString(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_GETPOSITION, (WPARAM)(UINT)(len), (LPARAM)(LPTSTR)(lp))
  198. #define MCIWndGetStart(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_GETSTART, 0, 0)
  199. #define MCIWndGetLength(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_GETLENGTH, 0, 0)
  200. #define MCIWndGetEnd(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_GETEND, 0, 0)
  201. #define MCIWndStep(hwnd, n) (LONG)MCIWndSM(hwnd, MCI_STEP, 0,(LPARAM)(long)(n))
  202. #define MCIWndDestroy(hwnd) (VOID)MCIWndSM(hwnd, WM_CLOSE, 0, 0)
  203. #define MCIWndSetZoom(hwnd,iZoom) (VOID)MCIWndSM(hwnd, MCIWNDM_SETZOOM, 0, (LPARAM)(UINT)(iZoom))
  204. #define MCIWndGetZoom(hwnd) (UINT)MCIWndSM(hwnd, MCIWNDM_GETZOOM, 0, 0)
  205. #define MCIWndSetVolume(hwnd,iVol) (LONG)MCIWndSM(hwnd, MCIWNDM_SETVOLUME, 0, (LPARAM)(UINT)(iVol))
  206. #define MCIWndGetVolume(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_GETVOLUME, 0, 0)
  207. #define MCIWndSetSpeed(hwnd,iSpeed) (LONG)MCIWndSM(hwnd, MCIWNDM_SETSPEED, 0, (LPARAM)(UINT)(iSpeed))
  208. #define MCIWndGetSpeed(hwnd) (LONG)MCIWndSM(hwnd, MCIWNDM_GETSPEED, 0, 0)
  209. #define MCIWndSetTimeFormat(hwnd, lp) (LONG)MCIWndSM(hwnd, MCIWNDM_SETTIMEFORMAT, 0, (LPARAM)(LPTSTR)(lp))
  210. #define MCIWndGetTimeFormat(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_GETTIMEFORMAT, (WPARAM)(UINT)(len), (LPARAM)(LPTSTR)(lp))
  211. #define MCIWndValidateMedia(hwnd) (VOID)MCIWndSM(hwnd, MCIWNDM_VALIDATEMEDIA, 0, 0)
  212. #define MCIWndSetRepeat(hwnd,f) (void)MCIWndSM(hwnd, MCIWNDM_SETREPEAT, 0, (LPARAM)(BOOL)(f))
  213. #define MCIWndGetRepeat(hwnd) (BOOL)MCIWndSM(hwnd, MCIWNDM_GETREPEAT, 0, 0)
  214. #define MCIWndUseFrames(hwnd) MCIWndSetTimeFormat(hwnd, TEXT("frames"))
  215. #define MCIWndUseTime(hwnd) MCIWndSetTimeFormat(hwnd, TEXT("ms"))
  216. #define MCIWndSetActiveTimer(hwnd, active) \
  217. (VOID)MCIWndSM(hwnd, MCIWNDM_SETACTIVETIMER, \
  218. (WPARAM)(UINT)(active), 0L)
  219. #define MCIWndSetInactiveTimer(hwnd, inactive) \
  220. (VOID)MCIWndSM(hwnd, MCIWNDM_SETINACTIVETIMER, \
  221. (WPARAM)(UINT)(inactive), 0L)
  222. #define MCIWndSetTimers(hwnd, active, inactive) \
  223. (VOID)MCIWndSM(hwnd, MCIWNDM_SETTIMERS,(WPARAM)(UINT)(active), \
  224. (LPARAM)(UINT)(inactive))
  225. #define MCIWndGetActiveTimer(hwnd) \
  226. (UINT)MCIWndSM(hwnd, MCIWNDM_GETACTIVETIMER, 0, 0L);
  227. #define MCIWndGetInactiveTimer(hwnd) \
  228. (UINT)MCIWndSM(hwnd, MCIWNDM_GETINACTIVETIMER, 0, 0L);
  229. #define MCIWndRealize(hwnd, fBkgnd) (LONG)MCIWndSM(hwnd, MCIWNDM_REALIZE,(WPARAM)(BOOL)(fBkgnd),0)
  230. #define MCIWndSendString(hwnd, sz) (LONG)MCIWndSM(hwnd, MCIWNDM_SENDSTRING, 0, (LPARAM)(LPTSTR)(sz))
  231. #define MCIWndReturnString(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_RETURNSTRING, (WPARAM)(UINT)(len), (LPARAM)(LPVOID)(lp))
  232. #define MCIWndGetError(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_GETERROR, (WPARAM)(UINT)(len), (LPARAM)(LPVOID)(lp))
  233. //#define MCIWndActivate(hwnd, f) (void)MCIWndSM(hwnd, WM_ACTIVATE, (WPARAM)(BOOL)(f), 0)
  234. #define MCIWndGetPalette(hwnd) (HPALETTE)MCIWndSM(hwnd, MCIWNDM_GETPALETTE, 0, 0)
  235. #define MCIWndSetPalette(hwnd, hpal) (LONG)MCIWndSM(hwnd, MCIWNDM_SETPALETTE, (WPARAM)(HPALETTE)(hpal), 0)
  236. #define MCIWndGetFileName(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_GETFILENAME, (WPARAM)(UINT)(len), (LPARAM)(LPVOID)(lp))
  237. #define MCIWndGetDevice(hwnd, lp, len) (LONG)MCIWndSM(hwnd, MCIWNDM_GETDEVICE, (WPARAM)(UINT)(len), (LPARAM)(LPVOID)(lp))
  238. #define MCIWndGetStyles(hwnd) (UINT)MCIWndSM(hwnd, MCIWNDM_GETSTYLES, 0, 0L)
  239. #define MCIWndChangeStyles(hwnd, mask, value) (LONG)MCIWndSM(hwnd, MCIWNDM_CHANGESTYLES, (WPARAM)(UINT)(mask), (LPARAM)(LONG)(value))
  240. #define MCIWndOpenInterface(hwnd, pUnk) (LONG)MCIWndSM(hwnd, MCIWNDM_OPENINTERFACE, 0, (LPARAM)(LPUNKNOWN)(pUnk))
  241. #define MCIWndSetOwner(hwnd, hwndP) (LONG)MCIWndSM(hwnd, MCIWNDM_SETOWNER, (WPARAM)(hwndP), 0)
  242. // Messages an app will send to MCIWND
  243. // all the text-related messages are defined out of order above (they need
  244. // to be defined before the MCIWndOpen() macros
  245. #define MCIWNDM_GETDEVICEID (WM_USER + 100)
  246. #define MCIWNDM_GETSTART (WM_USER + 103)
  247. #define MCIWNDM_GETLENGTH (WM_USER + 104)
  248. #define MCIWNDM_GETEND (WM_USER + 105)
  249. #define MCIWNDM_EJECT (WM_USER + 107)
  250. #define MCIWNDM_SETZOOM (WM_USER + 108)
  251. #define MCIWNDM_GETZOOM (WM_USER + 109)
  252. #define MCIWNDM_SETVOLUME (WM_USER + 110)
  253. #define MCIWNDM_GETVOLUME (WM_USER + 111)
  254. #define MCIWNDM_SETSPEED (WM_USER + 112)
  255. #define MCIWNDM_GETSPEED (WM_USER + 113)
  256. #define MCIWNDM_SETREPEAT (WM_USER + 114)
  257. #define MCIWNDM_GETREPEAT (WM_USER + 115)
  258. #define MCIWNDM_REALIZE (WM_USER + 118)
  259. #define MCIWNDM_VALIDATEMEDIA (WM_USER + 121)
  260. #define MCIWNDM_PLAYFROM (WM_USER + 122)
  261. #define MCIWNDM_PLAYTO (WM_USER + 123)
  262. #define MCIWNDM_GETPALETTE (WM_USER + 126)
  263. #define MCIWNDM_SETPALETTE (WM_USER + 127)
  264. #define MCIWNDM_SETTIMERS (WM_USER + 129)
  265. #define MCIWNDM_SETACTIVETIMER (WM_USER + 130)
  266. #define MCIWNDM_SETINACTIVETIMER (WM_USER + 131)
  267. #define MCIWNDM_GETACTIVETIMER (WM_USER + 132)
  268. #define MCIWNDM_GETINACTIVETIMER (WM_USER + 133)
  269. #define MCIWNDM_CHANGESTYLES (WM_USER + 135)
  270. #define MCIWNDM_GETSTYLES (WM_USER + 136)
  271. #define MCIWNDM_GETALIAS (WM_USER + 137)
  272. #define MCIWNDM_PLAYREVERSE (WM_USER + 139)
  273. #define MCIWNDM_GET_SOURCE (WM_USER + 140)
  274. #define MCIWNDM_PUT_SOURCE (WM_USER + 141)
  275. #define MCIWNDM_GET_DEST (WM_USER + 142)
  276. #define MCIWNDM_PUT_DEST (WM_USER + 143)
  277. #define MCIWNDM_CAN_PLAY (WM_USER + 144)
  278. #define MCIWNDM_CAN_WINDOW (WM_USER + 145)
  279. #define MCIWNDM_CAN_RECORD (WM_USER + 146)
  280. #define MCIWNDM_CAN_SAVE (WM_USER + 147)
  281. #define MCIWNDM_CAN_EJECT (WM_USER + 148)
  282. #define MCIWNDM_CAN_CONFIG (WM_USER + 149)
  283. #define MCIWNDM_PALETTEKICK (WM_USER + 150)
  284. #define MCIWNDM_OPENINTERFACE (WM_USER + 151)
  285. #define MCIWNDM_SETOWNER (WM_USER + 152)
  286. #ifdef WIN32
  287. //define both A and W messages
  288. #define MCIWNDM_SENDSTRINGA (WM_USER + 101)
  289. #define MCIWNDM_GETPOSITIONA (WM_USER + 102)
  290. #define MCIWNDM_GETMODEA (WM_USER + 106)
  291. #define MCIWNDM_SETTIMEFORMATA (WM_USER + 119)
  292. #define MCIWNDM_GETTIMEFORMATA (WM_USER + 120)
  293. #define MCIWNDM_GETFILENAMEA (WM_USER + 124)
  294. #define MCIWNDM_GETDEVICEA (WM_USER + 125)
  295. #define MCIWNDM_GETERRORA (WM_USER + 128)
  296. #define MCIWNDM_NEWA (WM_USER + 134)
  297. #define MCIWNDM_RETURNSTRINGA (WM_USER + 138)
  298. #define MCIWNDM_OPENA (WM_USER + 153)
  299. #define MCIWNDM_SENDSTRINGW (WM_USER + 201)
  300. #define MCIWNDM_GETPOSITIONW (WM_USER + 202)
  301. #define MCIWNDM_GETMODEW (WM_USER + 206)
  302. #define MCIWNDM_SETTIMEFORMATW (WM_USER + 219)
  303. #define MCIWNDM_GETTIMEFORMATW (WM_USER + 220)
  304. #define MCIWNDM_GETFILENAMEW (WM_USER + 224)
  305. #define MCIWNDM_GETDEVICEW (WM_USER + 225)
  306. #define MCIWNDM_GETERRORW (WM_USER + 228)
  307. #define MCIWNDM_NEWW (WM_USER + 234)
  308. #define MCIWNDM_RETURNSTRINGW (WM_USER + 238)
  309. #define MCIWNDM_OPENW (WM_USER + 252)
  310. // map defaults to A or W depending on app's UNICODE setting
  311. #ifdef UNICODE
  312. #define MCIWNDM_SENDSTRING MCIWNDM_SENDSTRINGW
  313. #define MCIWNDM_GETPOSITION MCIWNDM_GETPOSITIONW
  314. #define MCIWNDM_GETMODE MCIWNDM_GETMODEW
  315. #define MCIWNDM_SETTIMEFORMAT MCIWNDM_SETTIMEFORMATW
  316. #define MCIWNDM_GETTIMEFORMAT MCIWNDM_GETTIMEFORMATW
  317. #define MCIWNDM_GETFILENAME MCIWNDM_GETFILENAMEW
  318. #define MCIWNDM_GETDEVICE MCIWNDM_GETDEVICEW
  319. #define MCIWNDM_GETERROR MCIWNDM_GETERRORW
  320. #define MCIWNDM_NEW MCIWNDM_NEWW
  321. #define MCIWNDM_RETURNSTRING MCIWNDM_RETURNSTRINGW
  322. #define MCIWNDM_OPEN MCIWNDM_OPENW
  323. #else
  324. #define MCIWNDM_SENDSTRING MCIWNDM_SENDSTRINGA
  325. #define MCIWNDM_GETPOSITION MCIWNDM_GETPOSITIONA
  326. #define MCIWNDM_GETMODE MCIWNDM_GETMODEA
  327. #define MCIWNDM_SETTIMEFORMAT MCIWNDM_SETTIMEFORMATA
  328. #define MCIWNDM_GETTIMEFORMAT MCIWNDM_GETTIMEFORMATA
  329. #define MCIWNDM_GETFILENAME MCIWNDM_GETFILENAMEA
  330. #define MCIWNDM_GETDEVICE MCIWNDM_GETDEVICEA
  331. #define MCIWNDM_GETERROR MCIWNDM_GETERRORA
  332. #define MCIWNDM_NEW MCIWNDM_NEWA
  333. #define MCIWNDM_RETURNSTRING MCIWNDM_RETURNSTRINGA
  334. #define MCIWNDM_OPEN MCIWNDM_OPENA
  335. #endif
  336. // note that the source text for MCIWND will thus contain
  337. // support for eg MCIWNDM_SENDSTRING (both the 16-bit entrypoint and
  338. // in win32 mapped to MCIWNDM_SENDSTRINGW), and MCIWNDM_SENDSTRINGA (the
  339. // win32 ansi thunk).
  340. #else
  341. // 16-bit Windows defines
  342. #define MCIWNDM_SENDSTRING (WM_USER + 101)
  343. #define MCIWNDM_GETPOSITION (WM_USER + 102)
  344. #define MCIWNDM_GETMODE (WM_USER + 106)
  345. #define MCIWNDM_SETTIMEFORMAT (WM_USER + 119)
  346. #define MCIWNDM_GETTIMEFORMAT (WM_USER + 120)
  347. #define MCIWNDM_GETFILENAME (WM_USER + 124)
  348. #define MCIWNDM_GETDEVICE (WM_USER + 125)
  349. #define MCIWNDM_GETERROR (WM_USER + 128)
  350. #define MCIWNDM_NEW (WM_USER + 134)
  351. #define MCIWNDM_RETURNSTRING (WM_USER + 138)
  352. #endif
  353. // Messages MCIWND will send to an app
  354. #define MCIWNDM_NOTIFYMODE (WM_USER + 200) // wp = hwnd, lp = mode
  355. #define MCIWNDM_NOTIFYPOS (WM_USER + 201) // wp = hwnd, lp = pos
  356. #define MCIWNDM_NOTIFYSIZE (WM_USER + 202) // wp = hwnd
  357. #define MCIWNDM_NOTIFYMEDIA (WM_USER + 203) // wp = hwnd, lp = fn
  358. #define MCIWNDM_NOTIFYERROR (WM_USER + 205) // wp = hwnd, lp = error
  359. // special seek values for START and END
  360. #define MCIWND_START -1
  361. #define MCIWND_END -2
  362. #ifndef MCI_PLAY
  363. /* MCI command message identifiers */
  364. #ifndef WIN32
  365. // win32 apps send MCIWNDM_OPEN
  366. #define MCI_OPEN 0x0803
  367. #endif
  368. #define MCI_CLOSE 0x0804
  369. #define MCI_PLAY 0x0806
  370. #define MCI_SEEK 0x0807
  371. #define MCI_STOP 0x0808
  372. #define MCI_PAUSE 0x0809
  373. #define MCI_STEP 0x080E
  374. #define MCI_RECORD 0x080F
  375. #define MCI_SAVE 0x0813
  376. #define MCI_CUT 0x0851
  377. #define MCI_COPY 0x0852
  378. #define MCI_PASTE 0x0853
  379. #define MCI_RESUME 0x0855
  380. #define MCI_DELETE 0x0856
  381. #endif
  382. #ifndef MCI_MODE_NOT_READY
  383. /* return values for 'status mode' command */
  384. #define MCI_MODE_NOT_READY (524)
  385. #define MCI_MODE_STOP (525)
  386. #define MCI_MODE_PLAY (526)
  387. #define MCI_MODE_RECORD (527)
  388. #define MCI_MODE_SEEK (528)
  389. #define MCI_MODE_PAUSE (529)
  390. #define MCI_MODE_OPEN (530)
  391. #endif
  392. #ifdef __cplusplus
  393. }
  394. #endif
  395. #endif