Graceful shutdown

This commit is contained in:
orignal 2016-07-26 11:52:44 -04:00
parent 183c22cc84
commit 36aa248556
2 changed files with 9 additions and 0 deletions

View file

@ -239,5 +239,13 @@ namespace win32
{ {
UnregisterClass (I2PD_WIN32_CLASSNAME, GetModuleHandle(NULL)); UnregisterClass (I2PD_WIN32_CLASSNAME, GetModuleHandle(NULL));
} }
bool GracefulShutdown ()
{
HWND hWnd = FindWindow (I2PD_WIN32_CLASSNAME, TEXT("i2pd"));
if (hWnd)
PostMessage (hWnd, WM_COMMAND, MAKEWPARAM(ID_GRACEFUL_SHUTDOWN, 0), 0);
return hWnd;
}
} }
} }

View file

@ -10,6 +10,7 @@ namespace win32
bool StartWin32App (); bool StartWin32App ();
void StopWin32App (); void StopWin32App ();
int RunWin32App (); int RunWin32App ();
bool GracefulShutdown ();
} }
} }
#endif // WIN32APP_H__ #endif // WIN32APP_H__