Originally posted by SeaHag
I found this...


VB Code:
  1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  2. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  3.  
  4. Const WM_CLOSE = &H10
  5.  
  6. Private Sub Command1_Click()
  7.  
  8. Dim intHwnd As Long
  9.  
  10. intHwnd = FindWindow(vbNullString, "Calculator") ' Must match the caption of the window exactly
  11. SendMessage intHwnd, WM_CLOSE, 0&, 0&
  12.  
  13. End Sub





Works great except for stuff running in the taskbar...


Arggg
u find that less messy than what I suggested ???