codice:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As IntPtr, ByVal nCmdShow As Integer) As IntPtr
Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As IntPtr) As Boolean
Const SW_RESTORE As Integer = 9
Dim hwndApp As IntPtr = FindWindow("notepad", vbNullString)
ShowWindow(hwndApp, SW_RESTORE)
SetForegroundWindow(hwndApp)
If Not (hwndApp.Equals(IntPtr.Zero)) Then
SendKeys.SendWait("X")
End If
per mandare un pulsante ad un aplicazione..
funziona.
ma posso fare in modo che non metta il foreground...
voglio che glieli mandi e basta..