看一看我用"超級解霸"放MP3的矢口否程序(系統必須裝超級解霸5.5):
HANDLE HWndCalculator
HWndCalculator = FindWindow(NULL, "超級解霸-MMX 5.5");
// close the exist Calculator
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);
HWndCalculator = FindWindow(NULL, "超級解霸5.5");
// close the exist Calculator
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);
HWndCalculator = FindWindow(NULL, "超級解霸5.5");
// close the exist Calculator
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);
HWndCalculator = FindWindow(NULL,"Sthado");
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);
CGauge1->Progress=0;
FMain->FileName=StrToDateTime(CD->QGet->FieldByName("BTIME")->AsString).FormatString("yyyy-mm-dd hhnnss");
if(rbContinue->Checked)
{
tNext->Interval=CD->QGet->FieldByName("TIMESUB")->AsInteger*1000+4*1000;
tNext->Enabled=true;
}
else
tNext->Enabled=false;
if(FileExists(FMain->DataPath+"//"+FMain->FileName+".mp3"))
{
iProgress=CD->QGet->FieldByName("TIMESUB")->AsInteger+4;
iTemp=iProgress;
tProgress->Enabled=true;
String sTemp=FMain->FileName+".mp3";
ShellExecute(Handle,"open",sTemp.c_str(),0,FMain->DataPath.c_str(),SW_HIDE);
}
else
{
tNext->Interval=1000;
if(rbContinue->Checked)
tNext->Enabled=true;
else
tNext->Enabled=true;
}