mirror of https://github.com/axmolengine/axmol.git
fixed win32 don't exit
This commit is contained in:
parent
e89f20a0b3
commit
6b2ce283e4
|
@ -546,7 +546,13 @@ public:
|
||||||
void onShutDownApp(int fd, const std::string &args)
|
void onShutDownApp(int fd, const std::string &args)
|
||||||
{
|
{
|
||||||
Director::getInstance()->getScheduler()->performFunctionInCocosThread([](){
|
Director::getInstance()->getScheduler()->performFunctionInCocosThread([](){
|
||||||
exit(0);
|
|
||||||
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||||
|
extern void shutDownApp();
|
||||||
|
shutDownApp();
|
||||||
|
#else
|
||||||
|
exit(0);
|
||||||
|
#endif
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -204,6 +204,12 @@ void onHelpAbout()
|
||||||
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG_ABOUT), glfwGetWin32Window(g_eglView->getWindow()), AboutDialogCallback);
|
DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DIALOG_ABOUT), glfwGetWin32Window(g_eglView->getWindow()), AboutDialogCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void shutDownApp()
|
||||||
|
{
|
||||||
|
HWND hWnd=glfwGetWin32Window(g_eglView->getWindow());
|
||||||
|
::SendMessage(hWnd,WM_CLOSE,NULL,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/*@brief new windows process*/
|
/*@brief new windows process*/
|
||||||
LRESULT CALLBACK SNewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK SNewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +224,7 @@ LRESULT CALLBACK SNewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
|
||||||
switch (wmId)
|
switch (wmId)
|
||||||
{
|
{
|
||||||
case ID_FILE_EXIT:
|
case ID_FILE_EXIT:
|
||||||
exit(0);
|
shutDownApp();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_VIEW_PORTRAIT:
|
case ID_VIEW_PORTRAIT:
|
||||||
|
|
Loading…
Reference in New Issue