Click here to Skip to main content
16,010,876 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: edit control in vc++ Pin
sudeep_br12-Apr-06 21:47
sudeep_br12-Apr-06 21:47 
AnswerRe: edit control in vc++ Pin
Iain Clarke, Warrior Programmer10-Apr-06 5:58
Iain Clarke, Warrior Programmer10-Apr-06 5:58 
QuestionHow to disable the system speaker control Pin
ashwath200510-Apr-06 4:52
ashwath200510-Apr-06 4:52 
AnswerRe: How to disable the system speaker control Pin
ashwath200510-Apr-06 4:55
ashwath200510-Apr-06 4:55 
QuestionRe: How to disable the system speaker control Pin
David Crow10-Apr-06 5:56
David Crow10-Apr-06 5:56 
AnswerRe: How to disable the system speaker control Pin
ashwath200510-Apr-06 6:05
ashwath200510-Apr-06 6:05 
GeneralRe: How to disable the system speaker control Pin
David Crow10-Apr-06 7:25
David Crow10-Apr-06 7:25 
GeneralRe: How to disable the system speaker control Pin
ashwath200510-Apr-06 19:46
ashwath200510-Apr-06 19:46 
hi,
I have written the following code for disabling the MUTE control,
MMRESULT result;
HMIXER hMixer;
result = mixerOpen(&hMixer, MIXER_OBJECTF_MIXER, 0, 0, 0);
//obtain a handle to the mixer device.

if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"Mixer could not be opened","1",MB_OK);
}


//we need to get the speaker line of the mixer device
MIXERLINE ml = {0};
ml.cbStruct = sizeof(MIXERLINE);
ml.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
result = mixerGetLineInfo((HMIXEROBJ) hMixer,&ml, MIXER_GETLINEINFOF_COMPONENTTYPE);

if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"mixerGetLineInfo failed","1",MB_OK);
}

//we need to get the volume control of the speaker line.
MIXERLINECONTROLS mlc = {0};
MIXERCONTROL mc={0};
mc.fdwControl=MIXERCONTROL_CONTROLF_DISABLED;

mlc.cbStruct = sizeof(MIXERLINECONTROLS);
mlc.dwLineID = ml.dwLineID;
mlc.dwControlType = MIXERCONTROL_CONTROLTYPE_MUTE;
mlc.cControls = 1;
mlc.pamxctrl = &mc;
mlc.cbmxctrl = sizeof(MIXERCONTROL);
result = mixerGetLineControls((HMIXEROBJ)hMixer,
&mlc, MIXER_GETLINECONTROLSF_ONEBYTYPE);

if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"mixerGetLineControls failed","2",MB_OK);
}

//we set the mute and unmute values
MIXERCONTROLDETAILS mcd = {0};
MIXERCONTROLDETAILS_UNSIGNED mcdu = {0};
mcdu.dwValue =lVal; //0 for unmute and //65535 for mute.
mcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
mcd.hwndOwner = 0;
mcd.dwControlID =mc.dwControlID;
mcd.paDetails = &mcdu;
mcd.cbDetails = sizeof(MIXERCONTROLDETAILS_UNSIGNED);
mcd.cChannels = 1;

result = mixerSetControlDetails((HMIXEROBJ)hMixer,
&mcd, MIXER_SETCONTROLDETAILSF_VALUE);
if(result!=MMSYSERR_NOERROR)
{
::MessageBox(NULL,"mixerSetControlDetails failed","3",MB_OK);
}

The above code does not disable the MUTE control.
I have checked all the return values,all of them return MMSYSERR_NOERROR as the return value.
Kindly help me to fix this problem.


QuestionRe: How to disable the system speaker control Pin
David Crow11-Apr-06 2:49
David Crow11-Apr-06 2:49 
AnswerRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 3:57
ashwath200511-Apr-06 3:57 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 4:13
David Crow11-Apr-06 4:13 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 4:21
ashwath200511-Apr-06 4:21 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 4:58
David Crow11-Apr-06 4:58 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:08
ashwath200511-Apr-06 5:08 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 5:13
David Crow11-Apr-06 5:13 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:18
ashwath200511-Apr-06 5:18 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:27
ashwath200511-Apr-06 5:27 
GeneralRe: How to disable the system speaker control Pin
David Crow11-Apr-06 5:30
David Crow11-Apr-06 5:30 
GeneralRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:33
ashwath200511-Apr-06 5:33 
QuestionRe: How to disable the system speaker control Pin
David Crow11-Apr-06 5:37
David Crow11-Apr-06 5:37 
AnswerRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 5:45
ashwath200511-Apr-06 5:45 
QuestionRe: How to disable the system speaker control Pin
David Crow11-Apr-06 5:52
David Crow11-Apr-06 5:52 
AnswerRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 20:01
ashwath200511-Apr-06 20:01 
QuestionRe: How to disable the system speaker control Pin
ashwath200511-Apr-06 20:04
ashwath200511-Apr-06 20:04 
AnswerRe: How to disable the system speaker control Pin
David Crow12-Apr-06 2:55
David Crow12-Apr-06 2:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.