-
Notifications
You must be signed in to change notification settings - Fork 9
/
basic.cpp
46 lines (33 loc) · 895 Bytes
/
basic.cpp
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
#include <Windows.h>
#include <iostream>
#include "extensions2.h"
void MH_CALL OnButton(MegaHackExt::Button *obj)
{
std::cout << "Clicked\n";
}
DWORD MainThread(LPVOID lpParam)
{
using namespace MegaHackExt;
Window *window = Window::Create("Window");
Button *button = Button::Create("Right");
button->setCallback(OnButton);
CheckBox *checkbox = CheckBox::Create("Left");
checkbox->setCallback([](CheckBox *obj, bool b) { std::cout << b << '\n'; });
window->add(HorizontalLayout::Create(checkbox, button));
Label *label = Label::Create("Label");
window->add(label);
Client::commit(window);
return S_OK;
}
DWORD DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL, 0x1000, reinterpret_cast<LPTHREAD_START_ROUTINE>(&MainThread), NULL, 0, NULL);
break;
default:
break;
}
return TRUE;
}