I have written the following code that will end a windows application. The problem is that when I send the WM_CLOSE message, the program tries to close. But if any changes have been made to the application another window appears first asking if you would like to save your changes. This window then prevents the application from closing.
I am looking for an API call that like Task Manager closes the application unconditionally.
Code sample.
Public Const WS_CANCELMODE = &H1F
Public Const WM_CLOSE = &H10
rc = PostMessage(TargetHwnd, WS_CANCELMODE, 0, 0&)
rc = PostMessage(TargetHwnd, WM_CLOSE, 0, 0&)
I am looking for an API call that like Task Manager closes the application unconditionally.
Code sample.
Public Const WS_CANCELMODE = &H1F
Public Const WM_CLOSE = &H10
rc = PostMessage(TargetHwnd, WS_CANCELMODE, 0, 0&)
rc = PostMessage(TargetHwnd, WM_CLOSE, 0, 0&)