这样做....当计算器没有运行的时候..isRun就会变成False,在运行了..isRun就会变成True...这样在Command1中...就会判断是否可以Shell
我的msn: myfend@
purana你帮我看看下面的程序代码有问题吗?
在模块中声明了findwindow了
Private isrun As Boolean
Private Sub Form_Load()
old = -100
Timer2.Interval = 10
End Sub
Private Sub picBack_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If y > 8670 And y < 100065 Then
If x > 1000 And x < 2400 Then
shp.Left = 960
Screen.MousePointer = vbHourglass
If isrun = True Then MsgBox ("您已经打开一次了")
isrun = True
shp.BackColor = &HC0FFFF
End If
If x > 3700 And x < 5175 Then
shp.Left = 3810
Screen.MousePointer = vbHourglass
End If
If x > 6570 And x < 9030 Then
shp.Left = 6675
Screen.MousePointer = vbHourglass
End If
If x > 9720 And x < 11310 Then
shp.Left = 9815
Screen.MousePointer = vbHourglass
End If
Else
Screen.MousePointer = 1
End If
End Sub
Private Sub picBack_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If y > 8670 And y < 100065 Then
If x > 1000 And x < 2400 Then
shp.Left = 960
Screen.MousePointer = vbCustom
Shell App.Path & "\ajr.exe", vbNormalFocus
End If
If x > 3700 And x < 5175 Then
shp.Left = 3810
Screen.MousePointer = vbCustom
Shell App.Path & "\5051.exe", vbNormalFocus
Hook
End If
If x > 6570 And x < 9030 Then
shp.Left = 6675
Screen.MousePointer = vbCustom
Shell App.Path & "\Book.exe", vbNormalFocus
End If
If x > 9720 And x < 11310 Then
shp.Left = 9815
Screen.MousePointer = vbCustom
Shell App.Path & "\Test.exe", vbNormalFocus
End If
Else
Screen.MousePointer = 1
End If
End Sub
Private Sub Timer2_Timer()
Dim isFindHwnd As Long
isFindHwnd = FindWindow(vbNullString, "ajr")
If (isFindHwnd > 0) Then
isrun = True
Else
isrun = False
frmMulti.shp.BackColor = &HFFFFFF
End If
End Sub