postmessage to kill mdn application

  • Thread starter Thread starter iccsi
  • Start date Start date
I

iccsi

I use following code to get Windows Handle and PostMessage API to kill
my application.

The KillProcess kill the the main form of the application, but not MS
Access application.

What should I change to kill MS Access application?

Your help is great appreciated,


Private Declare Function apiGetWindow Lib "user32" _
Alias "GetWindow" _
(ByVal hwnd As Long, _
ByVal wCmd As Long) _
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 Const WM_CLOSE = &H10


Public Function KillProcess(hwnd As Long) As Long
KillProcess = PostMessage(hwnd, WM_CLOSE, 0, 0)
End Function
 
Back
Top