1 如何避免一程序重复运行?
2 当一程序已经运行,如何再点击那个程序时,不再运行这个程序,而是将已运行的程序调出来。比如FrontPage或FoxMail。
2 当一程序已经运行,如何再点击那个程序时,不再运行这个程序,而是将已运行的程序调出来。比如FrontPage或FoxMail。
解决方案 »
- 用Printer.line直接打印输出的时候如何插入图片?
- vb m的平方米怎么写??????????
- 为什么文件变成只读了
- 请问activereport可以制作折线图么,
- 如何将EXCEL中cell的数据导入Microsoft SQL server?
- 一个非常简单的问题!高分救教!在线等候!
- VB迷茫者问有关打印机设置的问题(在printer.width&height不起作用时)
- msform 2.0的combobox 控件中有columncunt这个属性.有谁知道怎么用它显示多列?100分等着你
- 如何使窗体背景透明
- 高手请进!关于编写windows进程问题?
- 枚举一个文件夹下所有的文件应该怎么做??
- 有网络编程经验的请进
MsgBox ("程序已经运行,不能再次装载。"), vbExclamation
End
End If
msgbox "程序已运行!"
End If
1。如楼上的。(只能控制在同一路径下同一个程序,如果把该程序拷贝到不同路径就不行了 )
2。通过API:(缺陷:该方法必须要求有界面,并且知道主界面的标题)
for example:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPublic Declare Function BringWindowToTop Lib "user32" Alias "BringWindowToTop" (ByVal hwnd As Long) As LongPublic Declare Function ShowWindow Lib "user32" Alias "ShowWindow" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long dim whether_run as boolean
whether_run =findwindow(0,"Main Form's title")
if whether_run<>0 then
bringwindowtotop(whether_run)
showwindow(whether_run ,3)
end if