Merge branch 'master' of github.com:jclehner/nmrpflash
This commit is contained in:
commit
495891fb6b
1 changed files with 4 additions and 3 deletions
7
main.c
7
main.c
|
|
@ -107,13 +107,14 @@ void require_admin()
|
||||||
|
|
||||||
void show_exit_prompt()
|
void show_exit_prompt()
|
||||||
{
|
{
|
||||||
|
DWORD pid;
|
||||||
HWND win = GetConsoleWindow();
|
HWND win = GetConsoleWindow();
|
||||||
if (!win) {
|
if (!win || !GetWindowThreadProcessId(win, &pid)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetCurrentProcessId() == GetWindowThreadProcessId(win, NULL)) {
|
if (GetCurrentProcessId() == pid) {
|
||||||
printf("\nPress any key to exit\n");
|
printf("Press any key to exit\n");
|
||||||
getch();
|
getch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue