BCB5里如何让程序暂停几秒
1.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
::Sleep(5000);
ShowMessage("lvjack wake up");
}
2.可以这样
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
DWORD lTime;
Application->Initialize();
lTime=GetTickCount(); //读取流逝时间
Application->CreateForm(__classid(TMainForm), &MainForm);
while((GetTickCount()-lTime) / 1000 Hide();
AboutBox->Free();
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
3.
DWORD lTime;
lTime=GetTickCount(); //读取流逝时间
Application->CreateForm(__classid(TMainForm), &MainForm);
while((GetTickCount()-lTime) / 1000 <3);
//上面那个3是延迟秒数
这些是有用的
1.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
::Sleep(5000);
ShowMessage("lvjack wake up");
}
2.可以这样
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
DWORD lTime;
Application->Initialize();
lTime=GetTickCount(); //读取流逝时间
Application->CreateForm(__classid(TMainForm), &MainForm);
while((GetTickCount()-lTime) / 1000 Hide();
AboutBox->Free();
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
3.
DWORD lTime;
lTime=GetTickCount(); //读取流逝时间
Application->CreateForm(__classid(TMainForm), &MainForm);
while((GetTickCount()-lTime) / 1000 <3);
//上面那个3是延迟秒数
这些是有用的