void CMainWindow::OnToolsQueryWizard() { string qwPath = preferences.GetHomePath() + "QueryBuilder.exe"; if ( GetFileAttributes( qwPath.c_str() ) == -1 ) { MessageBox( "QueryBuilder is not installed.", "StudentInfo" ); } else { if ( (int)ShellExecute( NULL, "open", qwPath.c_str(), NULL, preferences.GetHomePath().c_str(), SW_SHOWNORMAL ) <= 32 ) { MessageBox( "Unable to execute QueryBuilder.", "StudentInfo" ); } } }
void CMainWindow::OnUpdateToolsQueryWizard( CCmdUI* pCmdUI ) { pCmdUI->Enable( GetFileAttributes( ( preferences.GetHomePath() + "QueryWizard.exe" ).c_str() ) != -1 ); }