Browse Source

Graceful shutdown

pull/588/head
orignal 8 years ago
parent
commit
36aa248556
  1. 8
      Win32/Win32App.cpp
  2. 1
      Win32/Win32App.h

8
Win32/Win32App.cpp

@ -239,5 +239,13 @@ namespace win32 @@ -239,5 +239,13 @@ namespace win32
{
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;
}
}
}

1
Win32/Win32App.h

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

Loading…
Cancel
Save