随笔3
1.NOTIFYICONDATA:向任务栏托盘区域发送消息
2.进程静音的功能:
BOOL CQKFlashPlayer::SetMute(BOOL bMute)
{
HMIXER hMixer;
MIXERCONTROL mxc;
MIXERLINE mxl;
MIXERLINECONTROLS mxlc;
MIXERCONTROLDETAILS mxcd;
MIXERCONTROLDETAILS_SIGNED volStruct;
MMRESULT mmr;
//Sound Setting
mmr = mixerOpen(&hMixer, 0, 0, 0, 0);
if (mmr != MMSYSERR_NOERROR) return FALSE;
// 初始化MIXERLINE结构体.
ZeroMemory(&mxl, sizeof(MIXERLINE));
mxl.cbStruct = sizeof(MIXERLINE);
// 指出需要获取的通道,扬声器用MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
mxl.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
mmr = mixerGetLineInfo((HMIXEROBJ)hMixer, &mxl, MIXER_GETLINEINFOF_COMPONENTTYPE);
if (mmr != MMSYSERR_NOERROR) return FALSE;
// 取得控制器.
ZeroMemory(&mxlc, sizeof(MIXERLINECONTROLS));
mxlc.cbStruct = sizeof(MIXERLINECONTROLS);
mxlc.dwLineID = mxl.dwLineID;
mxlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE;
mxlc.cControls = 1;
mxlc.cbmxctrl = sizeof(mxc);
mxlc.pamxctrl = &mxc;
//mxc.cMultipleItems=0;
ZeroMemory(&mxc, sizeof(MIXERCONTROL));
mxc.cbStruct = sizeof(MIXERCONTROL);
mmr = mixerGetLineControls((HMIXEROBJ)hMixer, &mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);
if (mmr != MMSYSERR_NOERROR) return FALSE;
// 初始化MIXERCONTROLDETAILS结构体
ZeroMemory(&mxcd, sizeof(MIXERCONTROLDETAILS));
mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_SIGNED);
mxcd.dwControlID = mxc.dwControlID;
mxcd.paDetails = &volStruct;
mxcd.cChannels = 1;
// 获得音量值
volStruct.lValue = bMute;
mmr = mixerSetControlDetails((HMIXEROBJ)hMixer, &mxcd, MIXER_SETCONTROLDETAILSF_VALUE);
mixerClose(hMixer);
return TRUE;
}