ExitProcess
The ExitProcess function ends a process and all its threads.
VOID ExitProcess(
UINT uExitCode // exit code for all threads
);
Parameters
uExitCode
Specifies the exit code for the process, and for all threads that are terminated as a result of this call. Use the GetExitCodeProcess function to retrieve the process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.
TerminateProcess
The TerminateProcess function terminates the specified process and all of its threads.
BOOL TerminateProcess(
HANDLE hProcess, // handle to the process
UINT uExitCode // exit code for the process
);
Parameters
hProcess
Handle to the process to terminate.
Windows NT: The handle must have PROCESS_TERMINATE access.
uExitCode
Specifies the exit code for the process and for all threads terminated as a result of this call. Use the GetExitCodeProcess function to retrieve the process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
SendNotifyMessage
The SendNotifyMessage function sends the specified message to a window. If the window was created by the calling thread, SendNotifyMessage calls the window procedure for the window and does not return until the window procedure has processed the message. If the window was created by a different thread, SendNotifyMessage passes the message to the window procedure and returns immediately; it does not wait for the window procedure to finish processing the message.
BOOL SendNotifyMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
to: awant2k(一点通)大俠, 好象剛好說反了,我是指那個被控制的程序不是我寫的,它是一個對話框程式,有一個test按鈕,我的目的是想讓它在被按了test之後,就被暫停,而不是整個退出來,我自己寫的程式能偵測到其test按鈕被按,然後我的程式彈出一個對話框完成掃描後,再去讓那個進行繼續執行下去,這樣能辦到嗎?