VFP中如何判断程序是否运行VF
*-- 判断程序是否重复运行 --*
PUBLIC handle
cCaption='钢材进销存管理系统(Ver1。0)
Declare integer FindWindow in win32api string cClass,String cCaption
handle = FindWindow(0,cCaption)
if FindWindow(0,cCaption)#0
MESSAGEBOX("钢材进销存管理系统已经运行!",16,"系统提示")
RETURN
ENDIF
_Screen。 Caption=cCaption
或者
...全部
*-- 判断程序是否重复运行 --*
PUBLIC handle
cCaption='钢材进销存管理系统(Ver1。0)
Declare integer FindWindow in win32api string cClass,String cCaption
handle = FindWindow(0,cCaption)
if FindWindow(0,cCaption)#0
MESSAGEBOX("钢材进销存管理系统已经运行!",16,"系统提示")
RETURN
ENDIF
_Screen。
Caption=cCaption
或者
_ sible=。f。
_ tocenter=。t。
clea memo
public mypath
mypath=left(sys(16),rat("\",sys(16)))
set defa to (mypath)
set dele on
set excl off
set talk off
set safety off
SET CENT ON
set date to YMD
set mark to [-]
SET DECIMALS TO 2
*********************避免同时运行副本*********************************
declare integer FindWindow IN USER32。
DLL AS Find_Window STRING,STRING
LOCAL cTitle
cTitle=[你的窗体标题]
if find_window(0,ctitle)!=0
=messagebox("本程序已运行",48)
quit
endif
*****************************
do form wel
read even
clea
retur
用API函数CreateMutex()建立一个互斥变量。
。收起