Message
Message
h"
#include <iostream>
#include <fstream>
#include <string>
#include <windows.h> // for Sleep function
#include "../imgui/imgui.h"
#include "../imgui/imgui_impl_dx9.h"
#include "../imgui/imgui_impl_win32.h"
#include <Windows.h> // Include Widows.h for Sleep function
switch (message)
{
case WM_SIZE: {
if (gui::device && wideParameter != SIZE_MINIMIZED)
{
gui::presentParameters.BackBufferWidth = LOWORD(longParameter);
gui::presentParameters.BackBufferHeight = HIWORD(longParameter);
gui::ResetDevice();
}
} return 0;
case WM_SYSCOMMAND: {
if ((wideParameter & 0xfff0) == SC_KEYMENU) // Disable ALT application menu
return 0;
} break;
case WM_DESTROY: {
PostQuitMessage(0);
} return 0;
case WM_LBUTTONDOWN: {
gui::position = MAKEPOINTS(longParameter); // set click points
} return 0;
case WM_MOUSEMOVE: {
if (wideParameter == MK_LBUTTON)
{
const auto points = MAKEPOINTS(longParameter);
auto rect = ::RECT{ };
GetWindowRect(gui::window, &rect);
rect.left += points.x - gui::position.x;
rect.top += points.y - gui::position.y;
} return 0;
RegisterClassEx(&windowClass);
window = CreateWindowEx(
0,
"class001",
windowName,
WS_POPUP,
100,
100,
WIDTH,
HEIGHT,
0,
0,
windowClass.hInstance,
0
);
ShowWindow(window, SW_SHOWDEFAULT);
UpdateWindow(window);
}
if (!d3d)
return false;
ZeroMemory(&presentParameters, sizeof(presentParameters));
presentParameters.Windowed = TRUE;
presentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
presentParameters.BackBufferFormat = D3DFMT_UNKNOWN;
presentParameters.EnableAutoDepthStencil = TRUE;
presentParameters.AutoDepthStencilFormat = D3DFMT_D16;
presentParameters.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
if (d3d->CreateDevice(
D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
window,
D3DCREATE_HARDWARE_VERTEXPROCESSING,
&presentParameters,
&device) < 0)
return false;
return true;
}
if (result == D3DERR_INVALIDCALL)
IM_ASSERT(0);
ImGui_ImplDX9_CreateDeviceObjects();
}
if (d3d)
{
d3d->Release();
d3d = nullptr;
}
}
io.IniFilename = NULL;
ImGui::StyleColorsDark();
ImGui_ImplWin32_Init(window);
ImGui_ImplDX9_Init(device);
}
if (message.message == WM_QUIT)
{
isRunning = !isRunning;
return;
}
}
device->SetRenderState(D3DRS_ZENABLE, FALSE);
device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
if (device->BeginScene() >= 0)
{
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
device->EndScene();
}
ImGui::SetNextWindowPos({ 0, 0 });
ImGui::SetNextWindowSize({ WIDTH + 100, HEIGHT + 100 }); // Increase the window
size BROKEN ASF NIGGA
ImGui::Begin(
"Injector",
&isRunning,
ImGuiWindowFlags_NoResize |
ImGuiWindowFlags_NoSavedSettings |
ImGuiWindowFlags_NoCollapse |
ImGuiWindowFlags_NoMove
);
if (ImGui::Button("X")) {
isRunning = false;
}
ImGui::End();
}