From 210f95c2d3080b4c8c3b5a32402899e70450d456 Mon Sep 17 00:00:00 2001 From: Dale Stammen Date: Fri, 28 Mar 2014 11:27:43 -0700 Subject: [PATCH] can't close app on WP8 --- templates/cpp-template-default/Classes/HelloWorldScene.cpp | 5 +++++ tests/cpp-empty-test/Classes/HelloWorldScene.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/templates/cpp-template-default/Classes/HelloWorldScene.cpp b/templates/cpp-template-default/Classes/HelloWorldScene.cpp index 2b28e35550..0bd8eb6611 100644 --- a/templates/cpp-template-default/Classes/HelloWorldScene.cpp +++ b/templates/cpp-template-default/Classes/HelloWorldScene.cpp @@ -78,6 +78,11 @@ bool HelloWorld::init() void HelloWorld::menuCloseCallback(Ref* pSender) { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert"); + return; +#endif + Director::getInstance()->end(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) diff --git a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp index 959e2cd6cf..5a43cdfa17 100644 --- a/tests/cpp-empty-test/Classes/HelloWorldScene.cpp +++ b/tests/cpp-empty-test/Classes/HelloWorldScene.cpp @@ -78,6 +78,11 @@ bool HelloWorld::init() void HelloWorld::menuCloseCallback(Ref* sender) { +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) + MessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert"); + return; +#endif + Director::getInstance()->end(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)