mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
feat(Console): Disable close button and handle close signal
This commit is contained in:
parent
7006e55558
commit
6c622152eb
@ -59,7 +59,7 @@ namespace big
|
||||
|
||||
if ((m_console_handle = GetStdHandle(STD_OUTPUT_HANDLE)) != nullptr)
|
||||
{
|
||||
SetConsoleTitleA("BigBaseV2");
|
||||
SetConsoleTitleA("Yim's Mod Menu");
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
|
||||
m_console_out.open("CONOUT$", std::ios_base::out | std::ios_base::app);
|
||||
|
@ -8,6 +8,15 @@
|
||||
#include "renderer.hpp"
|
||||
#include "script_mgr.hpp"
|
||||
|
||||
BOOL WINAPI ctrl_handler(DWORD event)
|
||||
{
|
||||
LOG(INFO) << "Received close signal, unloading menu.";
|
||||
|
||||
g_running = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
|
||||
{
|
||||
using namespace big;
|
||||
@ -23,6 +32,9 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
|
||||
std::this_thread::sleep_for(1s);
|
||||
|
||||
auto logger_instance = std::make_unique<logger>();
|
||||
SetConsoleCtrlHandler(ctrl_handler, TRUE);
|
||||
DeleteMenu(GetSystemMenu(GetConsoleWindow(), false), SC_CLOSE, MF_BYCOMMAND);
|
||||
|
||||
try
|
||||
{
|
||||
LOG(RAW_GREEN_TO_CONSOLE) << u8R"kek(
|
||||
|
Loading…
x
Reference in New Issue
Block a user