如果可执行程序路径唯一的话,可以用以下代码 Private Sub Form_Load() If App.PrevInstance = True Then Unload Form1 End If End Sub 否则,用API函数CreateMutex,GetLastError,CloseHandle,可以判定程序是否已经执行
能不能给个vb实现这种功能的全过程啊sub form_load() end subsub command1_onclick() if app.prevInstance=true then '如果app.prevInstance可以判断notepad.exe是否执行 Shell("c:\windows\notepad.exe",1) else myret=msgbox("该程序已经执行",vbokonly) if(myret=1) then 执行一个让notepad.exe到前台的函数 请问这个函数是哪个函数( end if End If 这样才彻底啊,各位大虾,请不吝赐教
能不能给个vb实现这种功能的全过程啊sub form_load() end subsub command1_onclick() if app.prevInstance=true then '如果app.prevInstance可以判断notepad.exe是否执行 Shell("c:\windows\notepad.exe",1) else myret=msgbox("该程序已经执行",vbokonly) if(myret=1) then 执行一个让notepad.exe到前台的函数 请问这个函数是哪个函数( end if End If 这样才彻底啊,各位大虾,请不吝赐教,我一定给您加分
Private Sub Form_Load()
If App.PrevInstance = True Then
Unload Form1
End If
End Sub
否则,用API函数CreateMutex,GetLastError,CloseHandle,可以判定程序是否已经执行
end subsub command1_onclick()
if app.prevInstance=true then '如果app.prevInstance可以判断notepad.exe是否执行
Shell("c:\windows\notepad.exe",1)
else
myret=msgbox("该程序已经执行",vbokonly)
if(myret=1) then
执行一个让notepad.exe到前台的函数 请问这个函数是哪个函数(
end if
End If
这样才彻底啊,各位大虾,请不吝赐教
end subsub command1_onclick()
if app.prevInstance=true then '如果app.prevInstance可以判断notepad.exe是否执行
Shell("c:\windows\notepad.exe",1)
else
myret=msgbox("该程序已经执行",vbokonly)
if(myret=1) then
执行一个让notepad.exe到前台的函数 请问这个函数是哪个函数(
end if
End If
这样才彻底啊,各位大虾,请不吝赐教,我一定给您加分