ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby (https://forum.antichat.xyz/forumdisplay.php?f=24)
-   -   Anttweakbar (https://forum.antichat.xyz/showthread.php?t=1306600)

Uztor 14.12.2014 20:26

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();
            }
        }
    }
}



http://puu.sh/dupsw/678d92877d.jpg

FYP 14.12.2014 21:17

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 15.12.2014 03:34

Цитата:

Сообщение от FYP

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 15.12.2014 17:22

Цитата:

Сообщение от Uztor

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;
}


Uztor 18.12.2014 01:55

Цитата:

Сообщение от povargek

Use a AntTweakBar from s0beit 0.3c.

Can you send me the link please?

Dark_Knight 18.12.2014 02:56

Цитата:

Сообщение от Uztor

Can you send me the link please?

http://anttweakbar.sourceforge.net/doc/

Uztor 18.12.2014 09:54

Цитата:

Сообщение от Dark_Knight

I mean S0beit 0.3c source with anttweakbar. :)

Dark_Knight 18.12.2014 14:07

Цитата:

Сообщение от Uztor

I mean S0beit 0.3c source with anttweakbar. :)

And?

Uztor 18.12.2014 17:25

Цитата:

Сообщение от Dark_Knight

And?

what end? I need the sobeit 0.3c source with anttweakbar... please.

/edit: found


Время: 00:53