Merge branch 'master' of github.com:jclehner/nmrpflash

This commit is contained in:
Joseph C. Lehner 2017-01-13 11:39:12 +01:00
commit 495891fb6b

7
main.c
View file

@ -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();
}
}