Вопрос Драв лист Имгуя

Забаненный
Статус
Оффлайн
Регистрация
31 Окт 2023
Сообщения
21
Реакции[?]
2
Поинты[?]
2K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Всем хай, добавил имгуй в свой драйверный чит, захотел нарисовать watermark, написал, а он стоит в позиции где находится меню, помогите!!!(сама ватермарка перед ImGui::Render();
Код:
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#include <thread>
#include "../sdk/other/client.hpp"
#include "../sdk/other/offsets.hpp"
#include "../sdk/math/vector.h"
#include <vector>
#include "../sdk/imgui/imgui.h"
#include "../sdk/imgui/back/imgui_impl_dx9.h"
#include "../sdk/imgui/back/imgui_impl_win32.h"
#include <d3d9.h>
#include <tchar.h>

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#define DIRECTINPUT_VERSION 0x0800
#include "main.h"
#include "../sdk/renderer/renderer.h"
#include <d3dx9.h>
#include "../diretx.h"
#include "../Color.hpp"

int main1(int, char**, std::uintptr_t client, HANDLE driver)
{


    LPWSTR appclass;
    appclass = (LPWSTR)AppClass;
    LPWSTR appcNAME;
    appcNAME = (LPWSTR)AppName;
   

    RECT desktop;
    GetWindowRect(GetDesktopWindow(), &desktop);
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, appclass, NULL };
    RegisterClassEx(&wc);
    hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_LAYERED, appclass, appcNAME, WS_POPUP, (desktop.right / 2) - (WindowWidth / 2), (desktop.bottom / 2) - (WindowHeight / 2), WindowWidth, WindowHeight, 0, 0, wc.hInstance, 0);

    //SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
    SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, ULW_COLORKEY);

    if (CreateDeviceD3D(hwnd) < 0)
    {
        CleanupDeviceD3D();
        UnregisterClass(wc.lpszClassName, wc.hInstance);
        return 1;
    }

    ShowWindow(hwnd, SW_SHOWDEFAULT);
    UpdateWindow(hwnd);
    SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

    IMGUI_CHECKVERSION();
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    DefaultFont = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\segoeui.ttf", 20.0f, NULL, io.Fonts->GetGlyphRangesCyrillic());
    ImGui::StyleColorsDark();
    ImGui_ImplWin32_Init(hwnd);
    ImGui_ImplDX9_Init(g_pd3dDevice);

    MSG msg;
    ZeroMemory(&msg, sizeof(msg));
    static bool open = true;
    DWORD dwFlag = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
    char somelogin[25] = "";
    while (msg.message != WM_QUIT)
    {
        if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
            continue;
        }
        if (!open) ExitProcess(EXIT_SUCCESS);
        std::this_thread::sleep_for(std::chrono::milliseconds(20));


       


        ImGui_ImplDX9_NewFrame();
        ImGui_ImplWin32_NewFrame();
        ImGui::NewFrame();

        static bool isVisible = false;
        if (GetAsyncKeyState(VK_INSERT) & 1)
            isVisible = !isVisible;
        static int keyaim = false;
        static bool aim = false;
        if (isVisible)
        {
            ImGui::SetNextWindowSize(ImVec2(WindowWidth, WindowHeight), ImGuiCond_Once);
            ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Once);
            {
                ImGui::Begin(AppName, &open, dwFlag);
                ImGui::AlignTextToFramePadding();
                ImGui::Checkbox("AimBot", &aim);
                ImGui::Text("aimbot on lalt");
            }
            ImGui::End();
           
        }
        // aimbot
       

   
   
       

        ImGui::EndFrame();


       

        g_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0, 1.0f, 0);
        if (g_pd3dDevice->BeginScene() >= 0)
        {
           
           
      ImGui::GetBackgroundDrawList()->AddText(ImVec2(10, 10), ImColor(255, 255, 255), "Watermark");


            ImGui::Render();
       
           





            ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
            g_pd3dDevice->EndScene();
        }
        HRESULT result = g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
        if (result == D3DERR_DEVICELOST && g_pd3dDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET) ResetDevice();
    }

    ImGui_ImplDX9_Shutdown();
    ImGui_ImplWin32_Shutdown();
    ImGui::DestroyContext();
    CleanupDeviceD3D();
    DestroyWindow(hwnd);
    UnregisterClass(wc.lpszClassName, wc.hInstance);

    return 0;
}
 
HvH Legend
Пользователь
Статус
Оффлайн
Регистрация
23 Окт 2022
Сообщения
357
Реакции[?]
93
Поинты[?]
72K
Всем хай, добавил имгуй в свой драйверный чит, захотел нарисовать watermark, написал, а он стоит в позиции где находится меню, помогите!!!(сама ватермарка перед ImGui::Render();
Код:
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
#include <thread>
#include "../sdk/other/client.hpp"
#include "../sdk/other/offsets.hpp"
#include "../sdk/math/vector.h"
#include <vector>
#include "../sdk/imgui/imgui.h"
#include "../sdk/imgui/back/imgui_impl_dx9.h"
#include "../sdk/imgui/back/imgui_impl_win32.h"
#include <d3d9.h>
#include <tchar.h>

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#define DIRECTINPUT_VERSION 0x0800
#include "main.h"
#include "../sdk/renderer/renderer.h"
#include <d3dx9.h>
#include "../diretx.h"
#include "../Color.hpp"

int main1(int, char**, std::uintptr_t client, HANDLE driver)
{


    LPWSTR appclass;
    appclass = (LPWSTR)AppClass;
    LPWSTR appcNAME;
    appcNAME = (LPWSTR)AppName;
 

    RECT desktop;
    GetWindowRect(GetDesktopWindow(), &desktop);
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, appclass, NULL };
    RegisterClassEx(&wc);
    hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_LAYERED, appclass, appcNAME, WS_POPUP, (desktop.right / 2) - (WindowWidth / 2), (desktop.bottom / 2) - (WindowHeight / 2), WindowWidth, WindowHeight, 0, 0, wc.hInstance, 0);

    //SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
    SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, ULW_COLORKEY);

    if (CreateDeviceD3D(hwnd) < 0)
    {
        CleanupDeviceD3D();
        UnregisterClass(wc.lpszClassName, wc.hInstance);
        return 1;
    }

    ShowWindow(hwnd, SW_SHOWDEFAULT);
    UpdateWindow(hwnd);
    SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

    IMGUI_CHECKVERSION();
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO(); (void)io;
    DefaultFont = io.Fonts->AddFontFromFileTTF("C:\\Windows\\Fonts\\segoeui.ttf", 20.0f, NULL, io.Fonts->GetGlyphRangesCyrillic());
    ImGui::StyleColorsDark();
    ImGui_ImplWin32_Init(hwnd);
    ImGui_ImplDX9_Init(g_pd3dDevice);

    MSG msg;
    ZeroMemory(&msg, sizeof(msg));
    static bool open = true;
    DWORD dwFlag = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse;
    char somelogin[25] = "";
    while (msg.message != WM_QUIT)
    {
        if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
            continue;
        }
        if (!open) ExitProcess(EXIT_SUCCESS);
        std::this_thread::sleep_for(std::chrono::milliseconds(20));


     


        ImGui_ImplDX9_NewFrame();
        ImGui_ImplWin32_NewFrame();
        ImGui::NewFrame();

        static bool isVisible = false;
        if (GetAsyncKeyState(VK_INSERT) & 1)
            isVisible = !isVisible;
        static int keyaim = false;
        static bool aim = false;
        if (isVisible)
        {
            ImGui::SetNextWindowSize(ImVec2(WindowWidth, WindowHeight), ImGuiCond_Once);
            ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Once);
            {
                ImGui::Begin(AppName, &open, dwFlag);
                ImGui::AlignTextToFramePadding();
                ImGui::Checkbox("AimBot", &aim);
                ImGui::Text("aimbot on lalt");
            }
            ImGui::End();
         
        }
        // aimbot
     

 
 
     

        ImGui::EndFrame();


     

        g_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0, 1.0f, 0);
        if (g_pd3dDevice->BeginScene() >= 0)
        {
         
         
      ImGui::GetBackgroundDrawList()->AddText(ImVec2(10, 10), ImColor(255, 255, 255), "Watermark");


            ImGui::Render();
     
         





            ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
            g_pd3dDevice->EndScene();
        }
        HRESULT result = g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
        if (result == D3DERR_DEVICELOST && g_pd3dDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET) ResetDevice();
    }

    ImGui_ImplDX9_Shutdown();
    ImGui_ImplWin32_Shutdown();
    ImGui::DestroyContext();
    CleanupDeviceD3D();
    DestroyWindow(hwnd);
    UnregisterClass(wc.lpszClassName, wc.hInstance);

    return 0;
}
логично для него создать отдельный ImGui::Begin.
Пример:

Код:
        ImGui::SetNextWindowSize(ImVec2(230, 30));
        ImGui::Begin("watermark test", nullptr, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoResize);
        {
            auto backgroud_list = ImGui::GetBackgroundDrawList();
            auto draw_list = ImGui::GetWindowDrawList();
            ImVec2 xy = ImGui::GetWindowPos();

            backgroud_list->AddShadowRect(xy, ImVec2(xy.x + 230, xy.y + 30), ImColor(26, 28, 96), 100.f, ImVec2(0, 0)); //Glow effect
            draw_list->AddText(menu.nameTable, 15.f, ImVec2(xy.x + 10, xy.y + 8), ImColor(133, 133, 133, 255), "TEST WATERMARK IMGUI"); //Name
        }
        ImGui::End();
 
Сверху Снизу