Skip to content

Commit

Permalink
Implement kill the process by pid
Browse files Browse the repository at this point in the history
  • Loading branch information
equation314 committed Feb 20, 2017
1 parent 5c94e99 commit 970f725
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/updater/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const QString tempUpdaterPath = tempPath + Updater::UPDATER_NAME;
/// 杀死进程 pid
void killProcess(int pid)
{

HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
if (hProcess != NULL) TerminateProcess(hProcess, 0);
}

/// 创建快捷方式
Expand Down Expand Up @@ -66,7 +67,7 @@ bool createShortcut(const QString& installDir, const QString& destinationDir)
/// 杀死进程 pid
void killProcess(int pid)
{

QProcess::execute(QString("kill -9 %1").arg(pid));
}

/// 创建快捷方式
Expand Down

0 comments on commit 970f725

Please sign in to comment.