c++builder防止程序重复运行
(2008-10-27 10:23:18)
标签:
c编程it |
分类: 计算机 |
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
HANDLE
hMutex=CreateMutex(NULL,false,"RunOnlyOneInstance");
if(hMutex==NULL||ERROR_ALREADY_EXISTS==::GetLastError())
{
return
false;
}
Application->Initialize();
Application->Title
= "";
Application->CreateForm(__classid(TfmMain),
&fmMain);
Application->CreateForm(__classid(Tdm),
&dm);
Application->Run();
}
catch (Exception
&exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw
Exception("");
}
catch (Exception
&exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
{
}
前一篇:8款主流yy球拍使用手感对比
后一篇:c++的MD5加密--md5.h