Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jclehner/nmrpflash
Browse files Browse the repository at this point in the history
  • Loading branch information
jclehner committed Jan 13, 2017
2 parents 8bbfb54 + f24eb9e commit 495891f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ void require_admin()

void show_exit_prompt()
{
DWORD pid;
HWND win = GetConsoleWindow();
if (!win) {
if (!win || !GetWindowThreadProcessId(win, &pid)) {
return;
}

if (GetCurrentProcessId() == GetWindowThreadProcessId(win, NULL)) {
printf("\nPress any key to exit\n");
if (GetCurrentProcessId() == pid) {
printf("Press any key to exit\n");
getch();
}
}
Expand Down

0 comments on commit 495891f

Please sign in to comment.