diff --git a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp index 525ae802..00e3ab67 100644 --- a/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MainMenu.cpp @@ -9,6 +9,7 @@ #ifdef _WINDOWS64 #include "AchievementScreen.h" #include "StatsCounter.h" +#include "Windows64_Minecraft.h" #endif #ifdef __ORBIS__ #include @@ -368,6 +369,12 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) break; #endif +#ifdef _WINDOWS64 + case eControl_Exit: + PostMessage(GetMinecraftWindowHWND(), WM_CLOSE, 0, 0); + break; +#endif + default: __debugbreak(); } diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index d8520a9d..276a1438 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -16709,6 +16709,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue + diff --git a/Minecraft.Client/Minecraft.Client.vcxproj.filters b/Minecraft.Client/Minecraft.Client.vcxproj.filters index 0751d835..98a642ab 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj.filters +++ b/Minecraft.Client/Minecraft.Client.vcxproj.filters @@ -3658,6 +3658,9 @@ Header Files + + Windows64\Source Files + diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 2d201600..416ec917 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -40,6 +40,8 @@ #include "Xbox/resource.h" +#include "Windows64_Minecraft.h" + HINSTANCE hMyInst; LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam); char chGlobalText[256]; @@ -289,6 +291,11 @@ void MemSect(int sect) HINSTANCE g_hInst = NULL; HWND g_hWnd = NULL; +HWND GetMinecraftWindowHWND() +{ + return g_hWnd; +} + static bool g_isFullscreen = false; static RECT g_windowedRect = {}; static LONG g_windowedStyle = 0; diff --git a/Minecraft.Client/Windows64_Minecraft.h b/Minecraft.Client/Windows64_Minecraft.h new file mode 100644 index 00000000..7ceb9434 --- /dev/null +++ b/Minecraft.Client/Windows64_Minecraft.h @@ -0,0 +1,3 @@ +#include + +HWND GetMinecraftWindowHWND(); \ No newline at end of file