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()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue