打开APP
未登录
开通VIP,畅享免费电子书等14项超值服
开通VIP
首页
好书
留言交流
下载APP
联系客服
winmm.dll 函数详细引用方法(C#)
nxhujiee
>《◆易语言》
2016.04.15
关注
[csharp]
view plain
copy
//发送一个游戏杆消息到指定的窗口
[DllImport("winmm.dll")]
public static extern int joySetCapture(IntPtr hWnd, int uJoyID, int uPeriod, bool fChanged);
//查询指定的游戏杆设备的位置和活动性
[DllImport("winmm.dll")]
public static extern int joyGetPos(int uJoyID, ref JOYINFO pji);
//查询一个游戏杆设备的位置和它的按扭状态
[DllImport("winmm.dll")]
public static extern int joyGetPosEx(int uJoyID, ref JOYINFOEX pji);
//检取描述指定媒介控制接口错误代码的字符串
[DllImport("winmm.dll")]
public static extern Int32 mciGetErrorString(Int32 errorCode, StringBuilder errorText, Int32 errorTextSize);
//向指定的媒介控制接口设备发送一个字符串
[DllImport("winmm.dll")]
public static extern Int32 mciSendString(string command,string buffer, int bufferSize, IntPtr hwndCallback);
//将指定的MIDI输入设备连接到输出设备
[DllImport("winmm.dll")]
public static extern UInt32 midiConnect(IntPtr hMidi, IntPtr hmo, IntPtr pReserved);
//断开MIDI输入设备和输出设备的连接
[DllImport("winmm.dll")]
public static extern UInt32 midiDisconnect(IntPtr hMidi, IntPtr hmo, IntPtr pReserved);
//关闭指定的音乐仪器数字接口的输入设备
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint midiInClose(IntPtr hMidiIn);
//查询指定的音乐仪器数字接口的输入设备,以确定其性能
[DllImport("winmm.dll", SetLastError = true)]
public static extern MMRESULT midiInGetDevCaps(UIntPtr uDeviceID, ref MIDIINCAPS caps, uint cbMidiInCaps);
//查询指定的音乐仪器数字接口的输入设备,以确定其性能
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint midiInGetNumDevs();
//打开指定的音乐仪器数字接口的输入设备
[DllImport("winmm.dll", SetLastError=true)]
public static extern uint midiInOpen(IntPtr hMidiIn);
//在给定的MIDI输入设备上输入,并将所有挂起的输入缓冲区标记为已执行的
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint midiInReset(IntPtr hMidiIn);
//启动在指定的音乐仪器数字接口的输入设备上的输入
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint midiInStart(IntPtr hMidiIn);
//关闭指定的音乐仪器数字接口的输出设备
[DllImport("winmm.dll")]
public static extern uint midiOutClose(IntPtr hMidiOut);
//查询指定的音乐仪器数字接口的输出设备,以确定其性能
[DllImport("winmm.dll", SetLastError = true)]
public static extern MMRESULT midiOutGetDevCaps(UIntPtr uDeviceID, ref MIDIOUTCAPS lpMidiOutCaps, uint cbMidiOutCaps);
//检取有关MIDI输出设备指定采取的文本说明
[DllImport("winmm.dll")]
public static extern uint midiOutGetErrorText(uint mmrError, StringBuilder pszText, uint cchText);
//检取系统中存在的MIDI输出设备的数量
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint midiOutGetNumDevs();
//打开指定的MIDI输出设备进行回放
[DllImport("winmm.dll")]
public static extern uint midiOutOpen(out IntPtr lphMidiOut, uint uDeviceID, IntPtr dwCallback, IntPtr dwInstance, uint dwFlags);
//向指定的MIDI输出设备发送一条短MIDI消息
[DllImport("winmm.dll")]
public static extern uint midiOutShortMsg(IntPtr hMidiOut, uint dwMsg);
//关闭一个打开的MIDI流
[DllImport("winmm.dll")]
public extern static Int32 midiStreamClose(IntPtr hMidiStream);
//为输出,打开一个MIDI流
[DllImport("winmm.dll")]
public extern static Int32 midiStreamOpen(ref IntPtr hMidiStream, ref Int32 puDeviceID, Int32 cMidi, IntPtr dwCallback, IntPtr dwInstance, Int32 fdwOpen);
//暂停一个MIDI流的播放
[DllImport("winmm.dll")]
public static extern Int32 midiStreamPause(IntPtr hMidiStream);
//关掉指定MIDI输出设备的所有MIDI通道
[DllImport("winmm.dll")]
public static extern Int32 midiStreamStop(IntPtr hMidiStream);
//关闭指定的混频器
[DllImport("winmm.dll")]
public static extern Int32 mixerClose(IntPtr hmx);
//检取和一个声频指线路相关的单一控件的细节
[DllImport("winmm.dll")]
public static extern Int32 mixerGetControlDetails(IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, UInt32 fdwDetailsmixer);
//查询指定的混频器以确定其性能
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint MixerGetDevCaps(int mixerId, ref MixerCaps mixerCaps, int mixerCapsSize);
//获取指定混频器的标识符
[DllImport("winmm.dll", SetLastError=true)]
public static extern MMRESULT mixerGetID(int hmxobj, uint puMxId, MixerFlags fdwId);
//检取和一个声频线路相关的一个或多个控件
[DllImport("winmm.dll")]
public static extern Int32 mixerGetLineControls(IntPtr hmxobj, ref MIXERLINECONTROLS pmxlc, UInt32 fdwControls);
//检取混频器有关特有线路的信息
[DllImport("winmm.dll")]
public static extern Int32 mixerGetLineInfo(IntPtr hmxobj, ref MixerLine pmxl, UInt32 fdwInfo);
//返回系统中存在的混频器的数量
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint mixerGetNumDevs();
//打开指定的混频器,在应用程序关闭该句柄前保证该设备不被移走
[DllImport("winmm.dll")]
public static extern Int32 mixerOpen(ref IntPtr phmx, uint pMxId,IntPtr dwCallback, IntPtr dwInstance, UInt32 fdwOpen);
//设置和一个声频指线路相关的单一控件的细节
[DllImport("winmm.dll")]
public static extern Int32 mixerSetControlDetails(IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, UInt32 fdwDetails);
//播放一个波形声音
[DllImport("winmm.dll", SetLastError = true)]
public static extern bool PlaySound(string pszSound, UIntPtr hmod, uint fdwSound);
[DllImport("winmm.dll", SetLastError = true)]
public static extern bool PlaySound(byte[] pszSound, IntPtr hmod, SoundFlags fdwSound);
//设置应用程序或驱动程序使用的最小定时器分辨率
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint timeBeginPeriod(uint uMilliseconds);
//清除应用程序或驱动程序使用的最小定时器分辨率
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint timeEndPeriod(uint uMilliseconds);
//查询定时器设备以确定其性能
[DllImport("winmm.dll", SetLastError = true)]
public static extern UInt32 timeGetDevCaps(ref TimeCaps timeCaps,UInt32 sizeTimeCaps);
//检取从WINDOWS开始已逝去的毫秒数
[DllImport("winmm.dll", SetLastError = true)]
public static extern UInt32 timeGetSystemTime(ref MmTime mmTime, UInt32 sizeMmTime);
//检取从WINDOWS开始已逝去的毫秒数,此函数比上一条函数开销小
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint timeGetTime();
//毁掉指定的定时器回调事件
[DllImport("winmm.dll", SetLastError = true)]
public static extern UInt32 timeKillEvent(UInt32 timerEventId);
//设置一个定时器回调事件
[DllImport("winmm.dll", SetLastError = true)]
public static extern UInt32 timeSetEvent(UInt32 msDelay, UInt32 msResolution,TimerEventHandler handler, ref UInt32 userCtx, UInt32 eventType);
//关闭指定的波形输入设置
[DllImport("winmm.dll", SetLastError = true)]
static extern uint waveInClose(IntPtr hwi);
// 返回系统中存在的波形输入设备的数量
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveInGetNumDevs();
//为录音而打开一个波形输入设备
[DllImport("winmm.dll")]
public static extern uint waveInOpen(ref IntPtr hWaveIn, uint deviceId, ref WaveFormate wfx, IntPtr dwCallBack, uint dwInstance, uint dwFlags);
//为波形输入准备一个输入缓冲区
[DllImport("winmm.dll", SetLastError = true)]
public static extern MMRESULT waveInPrepareHeader(IntPtr hwi, ref WaveHDR pwh, uint cbwh);
//停止给定的波形输入设备的输入,且将当前位置清零
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveInReset(IntPtr hwi);
// //启动在指定的波形输入设备的输入
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveInStart(IntPtr hwi);
[DllImport("winmm.dll", SetLastError = true)]
public static extern int waveInAddBuffer(int hWaveIn,ref WaveHDR lpWaveInHdr,int uSize);
// 查询一个指定的波形输入设备以确定其性能
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveInGetDevCaps(IntPtr hwo, ref WAVEINCAPS pwoc, uint cbwoc);
////清除由waveInPrepareHeader函数实现的准备
[DllImport("winmm.dll", SetLastError = true)]
public static extern MMRESULT waveInUnprepareHeader(IntPtr hwi, ref WaveHDR pwh, uint cbwh);
//关闭指定的波形输出设备
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutClose(IntPtr hwo);
// 查询一个指定的波形输出设备以确定其性能
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutGetDevCaps(IntPtr hwo, ref WAVEOUTCAPS pwoc, uint cbwoc);
//检取由指定的错误代码标识的文本说明
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutGetErrorText(uint mmrError, StringBuilder pszText, uint cchText);
//检取系统中存在的波形输出设备的数量
[DllImport("winmm.dll", SetLastError = true)]
public static extern uint waveOutGetNumDevs();
//查询一个波形输出设备当前播放的速度
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutGetPlaybackRate(IntPtr hwo, uint dwRate);
// 查询指定波形输出设备的当前音量设置
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutGetVolume(IntPtr hwo, uint dwVolume);
//为播放打开一个波形输出设备
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutOpen(ref IntPtr hWaveOut, IntPtr uDeviceID, ref WaveFormate lpFormat, IntPtr dwCallback, IntPtr dwInstance, uint dwFlags);
//暂停指定波形输出设备上的播放
[DllImport("winmm.dll")]
public static extern uint waveOutPause(IntPtr hwo);
//为播放准备一个波形缓冲区
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutPrepareHeader(IntPtr hWaveOut, ref WaveHDR lpWaveOutHdr, int uSize);
//停止给定的波形输出设备的输出,且将当前位置清零
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutReset(IntPtr hwo);
//设置指定波形输出设备的速度
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutSetPlaybackRate(IntPtr hwo, uint dwRate);
//设置指定的波形输出设备的音量
[DllImport("winmm.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
public static extern int waveOutSetVolume(int uDeviceID, int dwVolume);
//清除由waveOutPrepareHeader函数实现的准备
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutUnprepareHeader(IntPtr hwo, ref WaveHDR pwh, uint cbwh);
//向指定的波形输出设备发送一个数据块
[DllImport("winmm.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern uint waveOutWrite(IntPtr hwo, ref WaveHDR pwh, uint cbwh);
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报
。
打开APP,阅读全文并永久保存
查看更多类似文章
猜你喜欢
类似文章
【热】
打开小程序,算一算2024你的财运
c#类,封装了键盘,和鼠标模拟,和内存读取(申精)(页 1) - 网络安全 - ZDNet...
C#获取进程的主窗口句柄
驱动程序安装类(C#)
C# 实现对硬件的控制
共享内存操作类(C#源码)
Winio64在64位系统中初始化失败问题
更多类似文章 >>
生活服务
热点新闻
留言交流
回顶部
联系我们
分享
收藏
点击这里,查看已保存的文章
导长图
关注
一键复制
下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!
联系客服
微信登录中...
请勿关闭此页面
先别划走!
送你5元优惠券,购买VIP限时立减!
5
元
优惠券
优惠券还有
10:00
过期
马上使用
×