Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_QUIT = &H10
Private Sub Command1_Click()
SendMessage Proc_HWND, WM_QUIT, 0, 0
End Sub
Terminating a process does not necessarily remove the process object from the system. A process object is deleted when the last handle to the process is closed.
The TerminateProcess function is used to unconditionally cause a process to exit. Use it only in extreme circumstances. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 34