_
Private Shared Function FindWindow( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As IntPtr
End Function
_
Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_CLOSE = 0xF060;
Dim nWnd As IntPtr
Dim ceroIntPtr As New IntPtr(0)
Dim Wnd_name as String
Wnd_name= "Some App Name"
nWnd = FindWindow(Nothing, Wnd_name)
SendMessage(nWnd, WM_SYSCOMMAND, SC_CLOSE, 0)
|