MCI_OVLY_OPEN_PARMS Structure 结构中的成员 lpstrDeviceType的值
来源:互联网 发布:office2016激活 知乎 编辑:程序博客网 时间:2024/06/05 17:53
Name or constant identifier of the device type. (The name of the device is typically obtained from the registry or SYSTEM.INI file.) If this member is a constant, it can be one of the values listed in MCI Device Types.
MSDN
Name or constant identifier of the device type. (The name of the device is typically obtained from the registry or SYSTEM.INI file.) If this member is a constant, it can be one of the values listed in
The following values identify devices in MCI messages and structures:
Waveform-audio device
实在看不懂,好像9X时代的东东.最后终于在注册表中找到了.
HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/MCI Extensions中有所有的文件类型,和相对应的播放设备。
MCI播放mp3的例子:
#include<windows.h>
#include<stdio.h>
#include<mmsystem.h>
#pragma comment(lib,"winmm.lib")
void main()
{
char buf[128];
//use mciSendString()
//mciSendString("play e://songs//把根留住.mp3",buf,sizeof(buf),NULL);
//mciSendString("play e://songs//zhj.mp3",buf,sizeof(buf),NULL);
char str[128] = {0 };
int i = 0;
//use mciSendCommand
MCI_OPEN_PARMS mciOpen;
MCIERROR mciError;
SetWindowText(NULL,"12345");
//mciOpen.lpstrDeviceType = (LPCTSTR)MCI_ALL_DEVICE_ID;
//mciOpen.lpstrDeviceType = "waveaudio"; //只能播放.wav文件
//mciOpen.lpstrDeviceType = "avivideo"; //*.avi
mciOpen.lpstrDeviceType = "mpegvideo";
//mciOpen.lpstrDeviceType = "sequencer";
mciOpen.lpstrElementName = "e://songs//zhj.mp3";
//mciOpen.lpstrElementName = "e://movie//first.avi";
//mciOpen.lpstrElementName = "c://winnt//media//Windows 登录音.wav";
mciError = mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE | MCI_OPEN_ELEMENT,(DWORD)&mciOpen);
if(mciError)
{
mciGetErrorString(mciError,buf,128);
printf("send MCI_OPEN command failed:%s/n",buf);
return;
}
UINT DeviceID = mciOpen.wDeviceID ;
MCI_PLAY_PARMS mciPlay;
mciError = mciSendCommand(DeviceID,MCI_PLAY,0 ,(DWORD)&mciPlay);
if(mciError)
{
printf("send MCI_PLAY command failed/n");
return;
}
/*
while(1)
{
sprintf(str,"now playing/t%d/tseconds",i);
printf("%s/r",str);
i++;
Sleep(1000);
}
*/
}
- MCI_OVLY_OPEN_PARMS Structure 结构中的成员 lpstrDeviceType的值
- Application Structure(应用程序的结构)
- 结构 Structure
- 【abap】编程时,通过结构structure中的字段,如何找到对应的透明表
- 结构体中的成员对齐
- 计算结构/类中的数据成员的偏移
- 为结构体中的CString成员赋值出错的问题
- 为结构体中的CString成员赋值出错的问题
- 为结构体中的CString成员赋值出错的问题
- 结构体中的数组成员的赋值问题
- 结构体成员变量的偏移值
- 根据结构体某个成员的地址求出结构体所有成员的值
- container_of()传入结构体中的成员,返回该结构体的首地址
- 指向结构体变量的指针引用结构体变量中的成员
- 【C_C++】根据结构体中的成员地址求结构体的地址
- 指向结构体变量的指针引用结构体变量中的成员
- Lisp.结构(Structure)
- C# 结构(structure)
- Kerberos原理--经典对话
- Linux内核中 kernel_thread函数的若干问题说明
- bat
- BLL-自动生成业务逻辑层代码
- GetUpperBound
- MCI_OVLY_OPEN_PARMS Structure 结构中的成员 lpstrDeviceType的值
- 个人开公司的流程,以后用得着
- DAL-自动生成数据访问层代码
- 游戏开发流程和部分分工
- symbian 资源文件中定义菜单
- 不同CS(文件)类中使用接口或不同CS文件中使用接口
- 从Visual C++6.0到Visual C++2010见证VC++辉煌时刻
- Linux常用指令速查手册
- DBHelper类