ERFORDERLICHE
OBJEKTE
1 Commandbutton (Command1)
FORM-CODE
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
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 Sub Command1_Click()
Dim wHandle As Long
Dim R As Long
wHandle = FindWindow(vbNullString, "Rechner")
If wHandle <> 0 Then
R = PostMessage(wHandle, &H10, 0&, 0&)
If R = 0 Then MsgBox "Fehler !"
Else
MsgBox "Der Rechner ist nicht offen !"
End If
End Sub
|