Anttweakbar

Статус
В этой теме нельзя размещать новые ответы.

Uztor

Новичок
Автор темы
42
0
Hello, I can't click on a Item...
I use Anttweakbar + SAMPFUNCS API.

Код:
bool CALLBACK Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
if (MenuActive == 1)
        {
            TwWindowSize(405, 235);
            char menuParameters[512], buf[2048];
            int i;
            int BackBufferWidth, BackBufferHeight;
            int iMainMenuPosX = BackBufferWidth / 2 - 400 / 2;
            int iMainMenuPosY = BackBufferHeight - 275;
            iMainMenuPosX = (BackBufferWidth / 2) - (405 / 2) - 150;
            iMainMenuPosY = (BackBufferHeight / 2) - (235 / 2) - 150;
            TwBar *twBar_Main;
            twBar_Main = TwNewBar("test");
            TwAddButton(twBar_Main, "GTA", NULL, NULL, NULL);
            TwDraw();
        }
}

Код:
void CALLBACK mainloop(void)
{
    static bool init = false;
    if (!init)
    {
        ...
    } else {
        TwInit(TW_DIRECT3D9, SF->getRender()->getD3DDevice());
        if (SF->getGame()->isKeyPressed(0x7A)) { //F11
            if (MenuActive == 0) {
                MenuActive = 1;
                SF->getSAMP()->getMisc()->ToggleCursor(true);
            }
            else if (MenuActive == 1) {
                MenuActive = 0;
                SF->getSAMP()->getMisc()->ToggleCursor(false);
                TwTerminate();
            }
        }
    }
}

678d92877d.jpg
 
Последнее редактирование:

FYP

Известный
Администратор
1,758
5,722
you need to and TwEventWin to win msg callback. like that:
Код:
LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
  // Send event message to AntTweakBar
  if( TwEventWin(wnd, msg, wParam, lParam) )
  return 0;  // Event has been handled by AntTweakBar
}
 

Uztor

Новичок
Автор темы
42
0
you need to and TwEventWin to win msg callback. like that:
Код:
LRESULT CALLBACK MessageProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
  // Send event message to AntTweakBar
  if( TwEventWin(wnd, msg, wParam, lParam) )
  return 0;  // Event has been handled by AntTweakBar
}
Hello, the function "TwEventWin" does not exist in the 1.16 Version.
 

povargek

Известный
Друг
59
113
Hello, the function "TwEventWin" does not exist in the 1.16 Version.

Use a AntTweakBar from s0beit 0.3c.
I'm use this code:

Код:
static LRESULT __stdcall OnWindowMsg(HWND wnd, UINT umsg, WPARAM wparam, LPARAM lparam)
{
    if (TwEventWin(wnd, umsg, wparam, lparam))
        return 0;

    return CallWindowProc(!orig_wndproc!, wnd, umsg, wparam, lparam);
}

CWndHook::CWndHook(HWND wnd)
{
    orig_wndproc = (WNDPROC)(UINT_PTR)SetWindowLong(wnd, GWL_WNDPROC, (LONG)(UINT_PTR)OnWindowMsg);
    orig_wnd = wnd;
}

CWndHook::~CWndHook()
{
    SetWindowLong(orig_wnd, GWL_WNDPROC, (LONG)(UINT_PTR)orig_wndproc);
    orig_wnd = NULL;
}
 
Статус
В этой теме нельзя размещать новые ответы.

Похожие темы

    • Закрыта
    • Опрос
    Ответы
    262
    Просмотры
    75K
  1. Ответы
    33
    Просмотры
    13K
  2. Ответы
    15
    Просмотры
    10K