kill process
来源:互联网 发布:淘宝官网网站 编辑:程序博客网 时间:2024/05/21 06:03
DWORD pid;
HWND hwnd123 = FindWindowEx(NULL, NULL,NULL, _T("On-Screen Keyboard"));
GetWindowThreadProcessId(hwnd123, &pid);
///////////kill////////////
DWORD bOKToKill = FALSE;
SendMessageTimeout(hwnd123, WM_QUERYENDSESSION, 0, 0, SMTO_ABORTIFHUNG|SMTO_NOTIMEOUTIFNOTHUNG, 100, &bOKToKill);
if (bOKToKill)
return FALSE; // window doesn't want to die: abort
PostMessage(hwnd123, WM_CLOSE, 0, 0);
// I've closed the main windows; now wait for process to die.
BOOL bKilled = TRUE;
HANDLE hp=OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE,FALSE,pid);
if (hp) {
if (WaitForSingleObject(hp, 5000) != WAIT_OBJECT_0)
{
TerminateProcess(hp,0);
}
CloseHandle(hp);
}
- Kill Process
- kill process
- kill process
- kill process
- Kill Process
- Linux kill a process
- kill Oracle process
- linux kill process
- Python kill process
- linux kill children process
- Android Kill Process
- mysql---kill process
- kill process in linux
- 582. Kill Process Medium
- [leetcode] 582. Kill Process
- leetcode 582.Kill Process
- 如何KILL<defunct> process
- 582. Kill Process
- imperative programming(IP), founction programming(FP)
- telnet imap&pop
- mysql 主从同步原理
- 基带芯片和射频芯片
- org.apache.axis2.AxisFault: Timeout waiting for connection
- kill process
- typedef用法小结
- Android system.img 打包解包
- error
- root sysroot chroot rootfs解析
- VS快捷方式
- org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorre
- 认识Pop3命令
- ibatis 映射