VB 自启动问题-请各位高手指教

发布时间:2024-05-19 15:46 发布:上海旅游网

问题描述:

VB的EXE程序,我想让程序自启动三次,代码如下:
Public Sub Main()
If Command$ <> "third inst" Then
DoSwap 0
If WindowCount > 3 Then End
If Command$ <> "second inst" Then
Form1.Move 0, (Screen.Height * 3 / 3 - 500), Screen.Width, Screen.Height / 3 + 150
Form1.Show
Shell "测试系统3PCS090421.exe second inst", 1
Else
Form1.Move 0, (Screen.Height * 2 / 3 - 500), Screen.Width, Screen.Height / 3 + 150
Form1.Show
Shell "测试系统3PCS090421.exe third inst", 1
End If
Else
Form1.Move 0, -200, Screen.Width, Screen.Height / 3 + 150
Form1.Show
End If
End Sub
Public Sub DoSwap(hwnd As Long)
Call EnumWindows(AddressOf EnumWindowsProc, hwnd)
End Sub
Private Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Boolean
Dim h As Long
h = GetProp(hwnd, strWindowProp)
If h = 1 Then
WindowCount = WindowCount + 1
End If
EnumWindowsProc = True
End Function
无法实现效果,请各位大虾指教!谢谢!
现在的情况是可以启动三个程序,但是有一个程序的窗体显示不出来。。。

问题解答:

VB 自启动问题-请各位高手指教这个旅游问答期待您的解答,请登录账号或关注微信公众号回答这个问题。

热点新闻