-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdllmain.cpp
More file actions
54 lines (47 loc) · 951 Bytes
/
dllmain.cpp
File metadata and controls
54 lines (47 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// dllmain.cpp : Defines the entry point for the DLL application.
#include "includes.h"
#include "menu.h"
extern bool running;
uintptr_t WINAPI MainThread(HMODULE hModule)
{
Menu::Create();
Menu::Initialize();
//AllocConsole();
//FILE* f;
//freopen_s(&f, "CONOUT$", "w", stdout);
while (running)
{
Menu::Render();
if (GetAsyncKeyState(VK_INSERT) & 1)
{
Menu::ToggleMenu();
}
if (GetAsyncKeyState(VK_DELETE) & 1)
{
break;
}
Sleep(1);
}
Menu::Shutdown(hModule);
//fclose(f);
//FreeConsole();
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)MainThread, hModule, 0, nullptr));
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}