Amed писал(а):2)
SetActiveWindow (FoundHwnd) или BringWindowToTop (FoundHwnd)
3)
SendKeys "^(a)", True
4)
SendKeys "{Enter}", True
Private Declare Function SetActiveWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function BringWindowToTop Lib "user32" Alias "BringWindowToTop" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetActiveWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim Window
Window = FindWindow(vbNullString, Text1.Text)
If Window = 0 Then
MsgBox Text1.Text & " No window", vbCritical
Else
MsgBox Text1.Text & " Window present", vbInformation
End If
End Sub
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetActiveWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim Window As Long
Window = FindWindow(vbNullString, Text1.Text)
If Window = 0 Then
MsgBox Text1.Text & " No window", vbCritical
Else
MsgBox Text1.Text & " Window present", vbInformation
Call SetActiveWindow (Window)
SendKeys "^(a)", True
SendKeys "{Enter}", True
End If
End Sub
Private Sub Command2_Click()
Call SetActiveWindow(Window)
SendKeys "^(a)", True
SendKeys "{Enter}", True
SendKeys "{Enter}", True
End Sub
Sub Form_Activate()
Dim Flag As Boolean
If Flag Then Exit Sub
Call SetActiveWindow(Window)
SendKeys "^(a)", True
SendKeys "{Enter}", True
SendKeys "{Enter}", True
Flag = True
End Sub
Private Declare Function CloseWindow Lib "user32" Alias "CloseWindow" (ByVal hwnd As Long) As Long
Private Sub Form_Load()
Call CloseWindow (FoundHwnd)
End Sub
Amed писал(а):
- Код: Выделить всё
Private Declare Function CloseWindow Lib "user32" Alias "CloseWindow" (ByVal hwnd As Long) As Long
Private Sub Form_Load()
Call CloseWindow (FoundHwnd)
End Sub
API-Guide писал(а):Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Send an E-Mail to the KPD-Team
ShellExecute Me.hwnd, vbNullString, "C:\document.pdf", vbNullString, "C:", SW_SHOWNORMAL
End Sub
Amed писал(а):Вот-вот...API-Guide писал(а):Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Send an E-Mail to the KPD-Team
ShellExecute Me.hwnd, vbNullString, "C:\document.pdf", vbNullString, "C:", SW_SHOWNORMAL
End Sub
Сейчас этот форум просматривают: Majestic-12 [Bot] и гости: 8