我是靠谱客的博主 拉长仙人掌,这篇文章主要介绍delphi 设置程序不能同时打开多个,现在分享给大家,希望可以做个参考。

Interface
Uses: Windows, Forms
//登录Form OnCreate事件
if AppRunning = True then
begin
Application.MessageBox('对不起,程序已运行!',
'提示', MB_OK +
MB_ICONINFORMATION);
Application.Terminate;
end;
function AppRunning: Boolean;
var
hMutex: HWND;
ret: Integer;
begin
hMutex := CreateMutex(nil, False, PChar(Application.Title));
ret := GetLastError;
Result := ret = ERROR_ALREADY_EXISTS;
ReleaseMutex(hMutex);
end;

最后

以上就是拉长仙人掌最近收集整理的关于delphi 设置程序不能同时打开多个的全部内容,更多相关delphi内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部