有关MciSendString
来源:互联网 发布:淘宝助理5.0下载地址 编辑:程序博客网 时间:2024/06/09 22:43
n
n如果调用成功,该函数将返回0。
例如:
[DllImport("winmm.dll",EntryPoint = "mciSendString",CharSet = CharSet.Auto)]
public static extern int mciSendString
(
string IpstrCommand,//命令
string IpstrReturnString,//接收返回信息的缓冲区
int uReturnLength,//返回信息的缓冲区的大小
int hwndCallback//
);
private void PlayMusic_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "All supported Formats" +"(*.MID)|*.MID";
string temp = "";
if (ofd.ShowDialog() == DialogResult.OK)
{
string name = "open " + Convert.ToChar(34) + ofd.FileName +
Convert.ToChar(34) + " alias media";
mciSendString(name, temp, 128/*temp.Length*/, 0);
mciSendString("play media", temp, 128/*temp.Length*/, 0);
}
}
private void StopMusic_Click(object sender, System.EventArgs e)
{
string temp = "";
mciSendString("close media", temp, 128, 0);
mciSendString("close all", temp, 128, 0);
}
例如:
[DllImport("winmm.dll",EntryPoint = "mciSendString",CharSet = CharSet.Auto)]
public static extern int mciSendString
(
string IpstrCommand,//命令
string IpstrReturnString,//接收返回信息的缓冲区
int uReturnLength,//返回信息的缓冲区的大小
int hwndCallback//
);
private void PlayMusic_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "All supported Formats" +"(*.MID)|*.MID";
string temp = "";
if (ofd.ShowDialog() == DialogResult.OK)
{
string name = "open " + Convert.ToChar(34) + ofd.FileName +
Convert.ToChar(34) + " alias media";
mciSendString(name, temp, 128/*temp.Length*/, 0);
mciSendString("play media", temp, 128/*temp.Length*/, 0);
}
}
private void StopMusic_Click(object sender, System.EventArgs e)
{
string temp = "";
mciSendString("close media", temp, 128, 0);
mciSendString("close all", temp, 128, 0);
}
- 有关MciSendString
- mciSendString
- mciSendString
- mciSendString
- mciSendString
- mciSendString
- mciSendString
- mciSendString
- mciSendString
- mciSendString
- MCISendString详细参数
- MCISendString详细参数
- MCISendString详细参数
- MCISendString详细参数
- MCISendString详细参数
- mciSendString大概
- MCISendString详细参数
- mciSendString应用
- 在命令行修改IP地址
- DSP相关网站
- 病毒式营销
- SAP LUW and DB LUW
- 最近喜欢的一首歌
- 有关MciSendString
- First Post
- xsl 函数大全
- 一点感悟
- 想学习Delphi了,那个版本好呢`~
- 数字图像处理词汇表
- vc的提示不见了后,这样做!
- C#使用Lucene建索引和搜索代码示例
- computer archeology