- Код: Выделить всё
Private Declare Function WinExec Lib "Kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Private Const SW_SHOW = 5
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Const WM_CLOSE = &H10
Const VK_TAB = &H9
Const VK_SPACE = &H20
Private Sub Command2_Click()
Dim hW&
hW& = FindWindow(vbNullString, "VipIP + extra surf" & Chr(0))
If hW& > 0 Then
PostMessage hW&, VK_TAB, VK_SPACE, 0&
Else
Dim rtn As Long
rtn = WinExec("E:\SOFT\retres\vipip (1).exe", SW_SHOW)
hW& = FindWindow(vbNullString, "VipIP + extra surf" & Chr(0))
If hW& > 0 Then
PostMessage hW&, VK_TAB, VK_SPACE, 0&
End If
End Sub
что не так почему не работает?
[Viper] :: Используем теги CODE!