WELCOME TO INFOCHEATS.NET

INFOCHEATS is a community-driven platform focused on free game cheats, cheat development, and verified commercial software for a wide range of popular games. We provide a large collection of free cheats shared by the community. All public releases are checked for malicious code to reduce the risk of viruses, malware, or unwanted software before users interact with them.

Alongside free content, INFOCHEATS hosts an active marketplace with many independent sellers offering commercial cheats. Each product is discussed openly, with user feedback, reviews, and real usage experience available to help you make informed decisions before purchasing.

Whether you are looking for free cheats, exploring paid solutions, comparing sellers, or studying how cheats are developed and tested, INFOCHEATS brings everything together in one place — transparently and community-driven.

Hook WndProc (ImGui)

rushensky

Newbie
Newbie

rushensky

Newbie
Newbie
Status
Offline
Joined
Jul 11, 2019
Messages
5
Reaction score
6
Code:
LRESULT __stdcall CALLBACK hkWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    if (uMsg == WM_KEYDOWN)
    {
        if (wParam == VK_INSERT)
            m_pDrawMenu->IsVisible = !m_pDrawMenu->IsVisible;
    }

    if (ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam) && m_pDrawMenu->IsVisible)
        return true;

    return CallWindowProc(g_WndProc_o, hWnd, uMsg, wParam, lParam);
}

// your entry point

    if (!GetHWND(&g_hWnd))
        ErrorMessage("Couldn't get hWnd.");

    g_WndProc_o = (WNDPROC)SetWindowLong(g_hWnd, GWL_WNDPROC, (LRESULT)hkWndProc);


// And Simple WndProcHandler
RESULT ImGui_ImplWin32_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
{
    ImGuiIO& io = ImGui::GetIO();

    switch (msg)
    {
    case WM_LBUTTONDOWN:
        io.MouseDown[0] = true;
        return true;

    case WM_LBUTTONUP:
        io.MouseDown[0] = false;
        return true;

    case WM_RBUTTONDOWN:
        io.MouseDown[1] = true;
        return true;

    case WM_RBUTTONUP:
        io.MouseDown[1] = false;
        return true;

    case WM_MBUTTONDOWN:
        io.MouseDown[2] = true;
        return true;

    case WM_MBUTTONUP:
        io.MouseDown[2] = false;
        return true;

    case WM_MOUSEWHEEL:
        io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.f : -1.f;
        return true;

    case WM_MOUSEHWHEEL:
        io.MouseWheelH += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.f : -1.f;
        return true;

    case WM_MOUSEMOVE:
        io.MousePos.x = LOWORD(lParam);
        io.MousePos.y = HIWORD(lParam);
        return true;

    case WM_KEYDOWN:
    case WM_SYSKEYDOWN:
        if (wParam < 256)
            io.KeysDown[wParam] = true;
        return true;

    case WM_KEYUP:
    case WM_SYSKEYUP:
        if (wParam < 256)
            io.KeysDown[wParam] = false;
        return true;

    case WM_CHAR:
        wchar_t wch;
        MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (char*)& wParam, 1, &wch, 1);
        io.AddInputCharacter(wch);
        return true;
    }

    return false;
}
 
Top