Icon
//
// Descr. :
//
// Return : HCURSOR
//-----------------------------------------------------------------------------
HCURSOR CMainDlg::OnQueryDragIcon()
{
return ( HCURSOR ) m_hIcon;
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : OnChangeDialog
//
// Descr. : Callback for a range of commands.
// CMainDlg is an empty dialog resource. Instead, it owns and displays
// child dialog boxes. This function performs switching between child
// dialogs by hiding the current child dialog and showing the new
// one. The main dialog then resizes to fit around the new child dialog.
//
// Return : void
// Arg : UINT nId : command id
//-----------------------------------------------------------------------------
void CMainDlg::OnChangeDialog( UINT nId )
{
static UINT currentDlg = 0;
CRect childRect;
if( nId == currentDlg )
return;
switch( nId )
{
case ID_SPEAKERS:
vcDlg.ShowWindow( SW_HIDE );
wvDlg.ShowWindow( SW_HIDE );
spDlg.ShowWindow( SW_SHOW );
spDlg.GetWindowRect( &childRect );
break;
case ID_WAVEIN:
spDlg.ShowWindow( SW_HIDE );
vcDlg.ShowWindow( SW_HIDE );
wvDlg.ShowWindow( SW_SHOW );
wvDlg.GetWindowRect( &childRect );
break;
case ID_VOICEIN:
spDlg.ShowWindow( SW_HIDE );
wvDlg.ShowWindow( SW_HIDE );
vcDlg.ShowWindow( SW_SHOW );
vcDlg.GetWindowRect( &childRect );
break;
}
// resize the main window to fit the new child dialog
static int menuHeight = GetSystemMetrics( SM_CYMENU );
CalcWindowRect( &childRect );
SetWindowPos( &wndTop, 0, 0, childRect.Width(), childRect.Height() + menuHeight,
SWP_NOMOVE|SWP_NOZORDER );
currentDlg = nId;
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : OnInfo
//
// Descr. :
//
// Return : void
//-----------------------------------------------------------------------------
void CMainDlg::OnInfo()
{
GetDevicesInfo( "mixerinfo.txt" );
if( ( int )ShellExecute( GetSafeHwnd(), "open", "notepad.exe", "mixerinfo.txt", ".", SW_SHOW ) < 33 )
MessageBox( "ShellExecute returned an error." );
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : OnInfoDlg
//
// Descr. :
//
// Return : void
//-----------------------------------------------------------------------------
void CMainDlg::OnInfoDlg()
{
CInfoDlg inDlg(this);
inDlg.DoModal();
}
//mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
// Name : OnUpdateMenu
//
// Descr. : menu update callback for a range of command IDs
//
// Return : void
// Arg : CCmdUI* pCmdUI :
//-----------------------------------------------------------------------------
void CMainDlg::OnUpdateMenu( CCmdUI* pCmdUI )
{
CMenu *menu = GetMenu();
if( menu == NULL )
return;
switch( pCmdUI->m_nID )
{
case ID_SPEAKERS:
TRACE( " -- check ID_SPEAKERS.\n" );
menu->CheckMenuItem( ID_SPEAKERS, MF_CHECKED );
menu->CheckMenuItem( ID_WAVEIN, MF_UNCHECKED );
menu->CheckMenuItem( ID_VOICEIN, MF_UNCHECKED );
break;
case ID_WAVEIN:
TRACE( " -- check ID_WAVEIN.\n" );
menu->CheckMenuItem( ID_SPEAKERS, MF_UNCHECKED );
menu->CheckMenuItem( ID_WAVEIN, MF_CHECKED );
menu->CheckMenuItem( ID_VOICEIN, MF_UNCHECKED );
break;
case ID_VOICEIN:
TRACE( " -- check ID_WAVEIN.\n" );
menu->CheckMenuItem( ID_SPEAKERS, MF_UNCHECKED );
menu->CheckMenuItem( ID_WAVEIN, MF_UNCHECKED );
menu->CheckMenuItem( ID_VOICEIN, MF_CHECKED );
break;
}
}