Merge branch 'fix-exit-button' into 'main'

Fix close button

See merge request whispers-lce/client!3
This commit is contained in:
Whisper W
2026-03-03 00:37:49 -05:00
5 changed files with 21 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#ifdef _WINDOWS64
#include "AchievementScreen.h"
#include "StatsCounter.h"
#include "Windows64_Minecraft.h"
#endif
#ifdef __ORBIS__
#include <error_dialog.h>
@@ -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();
}

View File

@@ -16709,6 +16709,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|ORBIS'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Windows64_DLCOffers.h" />
<ClInclude Include="Windows64_Minecraft.h" />
<ClInclude Include="WolfModel.h" />
<ClInclude Include="WolfRenderer.h" />
<ClInclude Include="WstringLookup.h" />

View File

@@ -3658,6 +3658,9 @@
<ClInclude Include="KeyboardMouseInput.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Windows64_Minecraft.h">
<Filter>Windows64\Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

View File

@@ -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;

View File

@@ -0,0 +1,3 @@
#include <Windows.h>
HWND GetMinecraftWindowHWND();