處理“顯卡類型”按鈕的單擊事件,設置顯卡類型,并將設置結(jié)果保存到INI文件中。代碼如下:
void CCaptureDlg::OnSetting()
{
CButton* pVGAButton = (CButton*)GetDlgItem(IDC_VGA);
int sel = pVGAButton->GetCheck(); //獲得VGA單選按鈕的狀態(tài)
if(sel)
{
WritePrivateProfileString("顯卡設置","類型","VGA","./syssetting.ini"); //將數(shù)據(jù)寫入INI文件
}
else
{
WritePrivateProfileString("顯卡設置","類型","PCI","./syssetting.ini"); //將數(shù)據(jù)寫入INI文件
}
MessageBox("要使顯卡設置生效,需要重新啟動應用程序!","提示");
}