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.

500 lines
21 KiB

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