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.

54 lines
2.1 KiB

  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Security;
  4. namespace Apewer.Internals.Interop
  5. {
  6. [SecuritySafeCritical]
  7. internal class WinMM
  8. {
  9. #region WinMM
  10. [DllImport("winmm.dll")]
  11. public static extern long mciGetCreatorTask(long wDeviceID);
  12. [DllImport("winmm.dll")]
  13. public static extern long mciGetDeviceID(string lpstrName);
  14. [DllImport("winmm.dll", SetLastError = true)]
  15. public static extern long mciSendString(string lpstrCommand, ref string lpstrReturnString, int uReturnLength, IntPtr hwndCallback);
  16. [DllImport("WinMm.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
  17. public static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
  18. [DllImport("winmm.dll", CharSet = CharSet.Auto)]
  19. public static extern IntPtr mmioOpen(string fileName, IntPtr not_used, int flags);
  20. [DllImport("winmm.dll", CharSet = CharSet.Auto)]
  21. public static extern int mmioAscend(IntPtr hMIO, MMCKINFO lpck, int flags);
  22. [DllImport("winmm.dll", CharSet = CharSet.Auto)]
  23. public static extern int mmioDescend(IntPtr hMIO, [MarshalAs(UnmanagedType.LPStruct)] MMCKINFO lpck, [MarshalAs(UnmanagedType.LPStruct)] MMCKINFO lcpkParent, int flags);
  24. [DllImport("winmm.dll", CharSet = CharSet.Auto)]
  25. public static extern int mmioRead(IntPtr hMIO, [MarshalAs(UnmanagedType.LPArray)] byte[] wf, int cch);
  26. [DllImport("winmm.dll", CharSet = CharSet.Auto)]
  27. public static extern int mmioClose(IntPtr hMIO, int flags);
  28. [DllImport("winmm.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
  29. public static extern bool PlaySound(byte[] soundName, IntPtr hmod, int soundFlags);
  30. [DllImport("winmm.dll", CharSet = CharSet.Auto)]
  31. public static extern bool PlaySound([MarshalAs(UnmanagedType.LPWStr)] string soundName, IntPtr hmod, int soundFlags);
  32. [DllImport("winmm.dll")]
  33. public static extern long sndPlaySound(string lpszSoundName, long uFlags);
  34. #endregion
  35. }
  36. }