限制程序单运行,handle代码不管用

gaojupeng 2007-03-27 08:55:12
int ihapp
ihapp = handle(this,true)
if ihapp > 0 then
MessageBox("出错提示" &
,"本程序在系统中已经运行,请使用或关闭打开的程序!")
halt
end if
为什么上面的代码不管用?
...全文
162 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
jlwei888 2007-03-28
  • 打赏
  • 举报
回复
function ulong CreateMutexA (ulong lpMutexAttributes, int bInitialOwner, ref string lpName) library "kernel32.dll"



string ls_mutex_name
if handle(GetApplication (), false) <> 0 then
ls_mutex_name = app_setupini+ char(0)
ll_mutex=createmutexa(0,0,ls_mutex_name)
ll_err=GetLastError()
if ll_err = 183 then
MessageBox ("提示信息","程序已经运行了!")
halt;
end if
end if

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧