Hack / Menu SHOW OFF!

Posts 31–45 of 60 · Page 3 of 4
Quote Originally Posted by _corn_ View Post
what the helll??!??!? get a life dude, that is an epic hack, bet you couldn't make it.
Lol...@~FALLEN~ is one of the best coders....i dont know his previous accounts but i only know he is VEry GOOD at coding


---------- Post added at 04:42 PM ---------- Previous post was at 04:37 PM ----------

Quote Originally Posted by joered View Post
pretty old but idc im not even into cf anymore.




and @topblast i like your menu and think your a good coder
Not Begging but can u make a tut on how to make D3D...i know ur not in CF any more but am dieing to make one..i have only made memory hardly
Who cares who is the best coder????
Topblast is a good coder he is not leeching he makes his own stuff.
Fallen is a great coder idk more about him.
Fallen is 18?? and Topblast around the 16 i believe??? wel toblast has 2 years to reach the same level as Fallen.

STFU and talk about it in 2 years
Quote Originally Posted by ~FALLEN~ View Post
@_corn_

you obviously don't know who i am so im gonna let that slide, but it is a pathetic hack..




this proves you don't know crap, there's a difference between signed / non specification / unsigned .. seriously you're just making yourself look terrible.. you guys must not know who i am. can someone who knows me get up in this convo @Royku @NoJustice @giniyat202 idk tons more but yeh

signed is -128 - 127 non specification is -128 - 255 and unsigned is 0 - 255 ( char ( 8 bit ( 1 byte ) data type ) )

p.s topblast do you know your endians?? if so name the number of bits to a bool... bet you cant without using google to find the answer
LOL i already explained it in the post about, it was a simple logic error from doing over the source i use for Hydra, fool.

They are 8bits in a bool, they are no registers smaller than 8bit so they cant store it, Please ur going into memory where I live and make my babies dont try me.

oh the difference between signed and unsigned is 8th bit.
in signed if the 8th bit is 1 then number is negitive but in unsigned it doesnt matter it uses all.
non specification cannot be from -128 to 255, because its a byte of 8bits, had u known the reason between signed and unsigned u would know thats not possible.


---------- Post added at 12:30 PM ---------- Previous post was at 12:23 PM ----------

Quote Originally Posted by Code[VB] View Post
you´r right

lol i hooked today some in and out of game d3d parts xD very funny.. ///

what about music_king ? he makes mpgh vips right? how about him?
u can hook any function in CA, even in the functions that calls present


---------- Post added at 12:32 PM ---------- Previous post was at 12:30 PM ----------

Quote Originally Posted by ~FALLEN~ View Post
actually bill gates didnt even make windows, he got a bunch of people to make it for him.. he's really just a successful business man
well, i wont say he is just a business man, he did code in his old days, when IBM offered him the chance to make an OS



PS: I am on ubuntu, hmm, its kinda slow... it sticks a lot and it talking up a lot of my CPU I GOT A PHENON II x4(knew i should of spent the $50 for the damn 6core)

---------- Post added at 11:47 AM ---------- Previous post was at 11:32 AM ----------

Quote Originally Posted by Brimir View Post
Dude, I helped you on Teamvieuwer... Your classes were out dated... I saw you correct your classes with mine....
So funny.. I knew you are a leecher that is why I captured my screen when I tv'ed you. Do I need to post the evidence?

(Going on vacation.. so i will post it over 3 day's)



You menu's are so complex becouse you are not a good coder... I saw your menu source.. its crap..
You make things in 10 lines.. when you can do it in 2 lines...
You don't use good names..



You are not pro, you are a leecher with a lot of time.


@~FALLEN~ you are pro
That was not the menu, that was in the part of the hack of which i did not code. It is a g-force hack, the team member contributed.

Beside, just because it used extra lines does not mean ur a bad code, U guys got this shit when coding u are trying to get the task done not work on the least codes, then u check over for that stuff, I dont have time to check over, it workss BLAME!

This is my menu (it a little hectic because i didnt finish

cMenu.h
Code:
#pragma once

#include <windows.h>
#include <d3d9.h>
#include <stdio.h>
#include <shlwapi.h>
#include "d3dfont9.h"
#include "cInput.h"
#include "resource.h"
//#include "textures.h"

#ifdef MENU_EXPORT
    #define D3DHOOK_API __declspec(dllexport)
#else
    #define D3DHOOK_API __declspec(dllimport)
#endif

#pragma pack(push, 1)
class cMenu;
//
#define TitleBarColor                0x904848cc
#define TitleBarInactiveColor        0x90888888
#define MinButtonColor                0x90FFA8A8
#define MinButtonHighlightColor        0xFFFF0000
#define TabInactiveColor            0x337575FF
#define TabActiveColor                0x334545FF
#define TabMouseActiveColor            0x33B5B5FF

#define ItemFontColor                0xFFFFFFFF
#define ItemSelectedFontColor        0xFF00FFFF

struct UIHANDLE
{
public:
    char* Name;
    char Selected; 

    bool Minimized, Running;
    DWORD UID;
    int bX, bY, bH, bW;
    CInput* Input;
    CD3DFont* m_pFont;
    LPDIRECT3DDEVICE9 m_pDevice;
    D3DHOOK_API UIHANDLE ( )
    {        
        UID = (DWORD)this;
        m_pFont =0;
    }

    D3DHOOK_API UIHANDLE (DWORD size )
    {
        memset(this, 0, size);
        UID = (DWORD)this;
    }

    D3DHOOK_API bool ObjectsInterset( UIHANDLE handle)
    {
        if(handle.Input)
        {
            if(handle.Input->IsMouseHere(handle.bX, handle.bY, handle.bW, handle.bH))
            {
                return false;
            }
            else 
            {
                if(handle.Input->IsMouseHere(this->bX, this->bY, this->bW, this->bH))
                    return true;
            }
        }
        else
        {
            Input->Enable();
            if(Input->IsMouseHere(handle.bX, handle.bY, handle.bW, handle.bH))
            {
                Input->Disable();
                return false;
            }
            else 
            {
                if(Input->IsMouseHere(this->bX, this->bY, this->bW, this->bH))
                {
                    Input->Disable();
                    return true;
                }
            }
        }
        return false;
                
    }
    
    virtual D3DHOOK_API void Show(LPDIRECT3DDEVICE9)
    {
    }
protected:
    virtual void MouseHover( UIHANDLE* sender ) 
    {

    }

};

class D3DColorSpectrum
{
    DWORD Width;
    DWORD Height;
    
    D3DCOLOR HSLToRGB(float H, float S, float L);
public:
    void Draw( LPDIRECT3DDEVICE9 pDevice, int x, int y, int w, int h);
    D3DCOLOR GetColor(int X, int Y);
};

class sGRAPHICS : public D3DColorSpectrum
{
public:
    virtual D3DHOOK_API void DrawBox(LPDIRECT3DDEVICE9 pDevice, DWORD x, DWORD y, DWORD w, DWORD h, DWORD color);
    virtual D3DHOOK_API void DrawTexBox(LPDIRECT3DDEVICE9 pDevice, LPDIRECT3DTEXTURE9 pTexture, int x, int y, int w, int h);
};

enum ITEM_TYPE
{
    ITEM_TEXT = 0, 
    ITEM_NORMAL = 1,
    ITEM_COLOR = 2,
    ITEM_BUTTON = 3
};

struct sItem : public UIHANDLE
{
public:
    char* Name;
    unsigned char* Value;

    unsigned char MaxValue;
    unsigned char type;
    char** Options;
    char* desc;
    void ClickInc()
    {
        if(Value)
        {
            if ((*Value) == (MaxValue-1))
                (*Value) = 0;
            else if ((*Value) < (MaxValue-1))
                (*Value)++;
        }
    }
    void Inc()
    {
        if (Value)
            if ((*Value) < (MaxValue-1))
                (*Value)++;
        
    }

    void Dec()
    {
        if (Value)
            if ((*Value) > 0)
                (*Value)--;        
    }

    unsigned char GetValue() 
    {

        if (Value)
            return (*Value); 
        else 
            return 0;
    }

    D3DCOLOR GetColor()
    {
        if(Options)
            return (DWORD)*Options;
        else
            return 0;
    }


    sItem() : UIHANDLE(sizeof(sItem))
    {
    }

    ~sItem()
    {
        memset(this, 0, sizeof(sItem));
    }
};

class sTab : public UIHANDLE, public sGRAPHICS
{
public:
    sItem* Items;
    UIHANDLE** handles;
    unsigned char noItems, noHandles, maxItems;
    char scroll;
    D3DHOOK_API sTab() : UIHANDLE(sizeof(sTab))
    {
        Name="Test Tab";
        maxItems=20;
        Items = new sItem[maxItems];
        handles = (UIHANDLE**)malloc(4*maxItems);
        for (int i = 0; i < maxItems; i++)
            handles[i] = new UIHANDLE();
    }

    D3DHOOK_API sTab(PCHAR name, unsigned char maxItem=20) : UIHANDLE(sizeof(sTab))
    {    
        Name = name;
        maxItems=maxItem;
        
        m_pFont = new CD3DFont("Arial", 9);
        Items = new sItem[maxItem];
        handles = (UIHANDLE**)malloc(4*maxItems);
        for (int i = 0; i < maxItems; i++)
            handles[i] = new UIHANDLE();
    }

    D3DHOOK_API~sTab()
    {
        memset(this, 0, sizeof(sTab));
    }
    
    D3DHOOK_API void Show(LPDIRECT3DDEVICE9 pDevice);

    D3DHOOK_API void AddButton(UIHANDLE** obj)
    {
        if (noItems>=maxItems)return;        
        handles[noHandles]  = *obj;
        noHandles++;
    }

    D3DHOOK_API void AddText(char* _Name, char* options)
    {
        if (noItems>=maxItems)return;
        Items[noItems].Name = _Name;
        Items[noItems].Value = 0;
        Items[noItems].Options = (char**)options;
        Items[noItems].MaxValue = 0;
        Items[noItems].desc = 0;
        Items[noItems].type = ITEM_TEXT;
        
        handles[noHandles]  = &Items[noItems];
        noHandles++;
        noItems++;
    }

    D3DHOOK_API void AddColor(char* _Name, DWORD* color)
    {
        if (noItems>=maxItems)return;
        Items[noItems].Name = _Name;
        Items[noItems].Value = 0;
        Items[noItems].Options = (char**)color;
        Items[noItems].MaxValue = 0;
        Items[noItems].desc = 0;
        Items[noItems].type = ITEM_COLOR;
        handles[noHandles]  = &Items[noItems];
        noHandles++;
        noItems++;
    }

    D3DHOOK_API void AddItem(char* _Name, unsigned char* _Value, char** options, char* desc=0, unsigned char maxValue=2)
    {
        if (noItems>=maxItems)return;
        *_Value = 0;
        Items[noItems].Name = _Name;
        Items[noItems].Value = _Value;
        Items[noItems].Options = options;
        Items[noItems].MaxValue = maxValue;
        Items[noItems].desc = desc;
        Items[noItems].type = ITEM_NORMAL;
        handles[noHandles]  = &Items[noItems];
        noHandles++;
        noItems++;
    }
};


struct sVertex
{
    
    float x, y, z, RHW;
    DWORD color;
    
    enum FVF
    {
        FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
    };
};

class cMenu : public UIHANDLE, sGRAPHICS
{
    
    short X, Y, W, H;
    HWND wHandle;
    sTab* Tabs;
    POINT bmp;
    bool herebefore;
    unsigned char noTabs;
    CD3DFont* fTitle, *fItem;
    bool release;
    // functions
    void DrawTitleBar(LPDIRECT3DDEVICE9 pDevice);
    bool isClicked();
    void MouseHover( UIHANDLE* sender );
    void DrawTabs(LPDIRECT3DDEVICE9 pDevice);
    void KeyBoardNav();
public:
    D3DHOOK_API cMenu(void);
    D3DHOOK_API cMenu(PCHAR name, short x=30, short y=100, short w=200,unsigned char maxTabs=3);
    D3DHOOK_API ~cMenu(void);
    //
//    D3DHOOK_API void DrawBox(LPDIRECT3DDEVICE9 pDevice, short x, short y, short w, short h, DWORD color);
    //
    D3DHOOK_API void AddTab(sTab tab);
    D3DHOOK_API void Show(LPDIRECT3DDEVICE9);
};
/*
struct taskBuff 
{
    UIHANDLE *butInfo;
    BYTE noButtons;
};
taskBuff taBuf;*/

class explorer : public UIHANDLE,  public sGRAPHICS 
{
public:
    D3DHOOK_API explorer();
    D3DHOOK_API ~explorer() {}
    DWORD scLength, scWidth;
    bool Menu,init;
    sTab* startMenu;
    LPDIRECT3DTEXTURE9 startTex;
    UIHANDLE **butInfo, **startInfo;
    char noButtons, startItems;
    CD3DFont* m_pFont;
    DWORD* trackIds;
    BYTE noTIds;
    D3DHOOK_API void StartUI(UIHANDLE**);
    D3DHOOK_API void AddToStartMenu(UIHANDLE**);


    D3DHOOK_API void Show(LPDIRECT3DDEVICE9);
};
D3DHOOK_API extern explorer Explorer;
#pragma pack(pop)
cMenu.cpp
Code:
#include "cMenu.h"
#include "textures.h"

#include <d3dx9.h>

D3DHOOK_API cMenu::cMenu(void) : UIHANDLE(sizeof(cMenu))
{    
    Name = "Topblast Menu Window v1.0";
    X= Y = 30;
    W = 250;    
    char process[512];
    //GetModuleFileNameA(GetModuleHandle(0), process, sizeof(process));
    //PathStripPathA(process);
    GetWindowTextA(GetForegroundWindow(),process, sizeof(process));
    wHandle = FindWindowA(0, process);

    herebefore = false;
    char* font = "Arial";
    fTitle = new CD3DFont(font, 10, D3DFONT_BOLD);
    fItem = new CD3DFont(font, 10);
    m_pFont = new CD3DFont("Info", 10);
    Tabs = new sTab[3];
}

D3DHOOK_API cMenu::cMenu(PCHAR name, short x, short y, short w, unsigned char maxTabs) : UIHANDLE(sizeof(cMenu))
{
    
    Input = 0;
    Name = name;
    X= x;Y = y;
    W = w;

    herebefore = false;

    char process[512];
    //GetModuleFileNameA(GetModuleHandle(0), process, sizeof(process));
    //PathStripPathA(process);
    GetWindowTextA(GetForegroundWindow(),process, sizeof(process));
    wHandle = FindWindowA(0, process);

    char* font = "Arial";
    fTitle = new CD3DFont(font, 10, D3DFONT_BOLD);
    fItem = new CD3DFont(font, 10);
    m_pFont = new CD3DFont("Info", 10);
    Tabs = new sTab[maxTabs];
}


D3DHOOK_API  cMenu::~cMenu(void)// : ~UIHANDLE()
{
    // Clean up
    for(BYTE i = 0; i < noTabs; i++)
    {
        if(this->Tabs)
        {
            for( BYTE e = 0; e < Tabs[i].noItems; e++ )
            {
                Tabs[i].Items[e].~sItem();
            }
        }
    }
    if(fTitle)
        fTitle ->~CD3DFont();
    if(fItem)
        fItem  ->~CD3DFont();
    if(m_pFont)
        m_pFont->~CD3DFont();
    // then
    memset(this, 0, sizeof(cMenu));
}

// Menu Starting Up Process

D3DHOOK_API  void cMenu::AddTab(sTab tab)
{
    this->Tabs[noTabs] = tab;
    
    noTabs++;
}


// Input Controls

void cMenu::MouseHover( UIHANDLE* sender ) 
{

}

bool cMenu::isClicked()
{

    if(Input->MouseButtonDown( DIMOUSE_LEFTBUTTON ))//GetAsyncKeyState(VK_LBUTTON))
    {    
        if (this->release == true)
        {    
            this->release = false;
            return true;
        }else{
            return false;
        }
    }
    this->release = true;
    return false;
}

bool rig = false, lef = false;

void cMenu::KeyBoardNav()
{
    if(Input->KeyPressed(DIK_HOME))
    {
        if(Input->KeyPressed(DIK_UP))
            Y=Y-5;
        else if(Input->KeyPressed(DIK_DOWN))
            Y=Y+5;
        if(Input->KeyPressed(DIK_LEFT))
            this->X = X-5;
        else if(Input->KeyPressed(DIK_RIGHT))
            X= X+5;

    }
    else if(Input->KeyPressed(DIK_LSHIFT))
    {
        if(Input->KeyPressed(DIK_LEFT))
        {
            if (this->Selected != 0 && (!lef))
            {
                this->Selected=this->Selected -1;
            }
            lef = true;
        }
        else 
            lef = false;
        if(Input->KeyPressed(DIK_RIGHT))
        {    
            if (this->Selected < this->noTabs &&(!rig))
            {
                this->Selected=this->Selected +1;
                if(this->Selected == this->noTabs)
                    this->Selected=this->Selected -1;
            }
            rig = true;
        }
        else 
            rig = false;
    }        
    else
    {
        if (Input->KeyPressed(DIK_UP)&1)
        {
            Tabs[this->Selected].Selected--;
            if (Tabs[this->Selected].Selected < 0) Tabs[this->Selected].Selected = Tabs[this->Selected].noItems-1;
        }
        else if (Input->KeyPressed(DIK_DOWN)&1)
        {
            Tabs[this->Selected].Selected++;
            if (Tabs[this->Selected].Selected >= Tabs[this->Selected].noItems ) Tabs[this->Selected].Selected = 0;
        }
        else{
            sTab & Tab = Tabs[this->Selected];
            sItem& Item = Tab.Items[Tab.Selected];
            if (Input->KeyPressed(DIK_LEFT)&1)
            {
                Item.Dec();
            }
            else if (Input->KeyPressed(DIK_RIGHT)&1)
            {
                Item.Inc();
            }
        }
    }
}

// D3D Function

sVertex new_sVertex(DWORD x, DWORD y, DWORD color)
{
    float fx = float(x);
    float fy = float(y);
    float fz = float(0);
    float RHW = float(0);
    sVertex ret = {fx,fy,fz,RHW, color};
    return ret;
}

void sGRAPHICS::DrawBox(LPDIRECT3DDEVICE9 pDevice, DWORD x, DWORD y, DWORD w, DWORD h, DWORD color)
{
    sVertex Veri[4] =
    {
        new_sVertex(x,y,color),
        new_sVertex(x+w,y,color),
        new_sVertex(x,y+h,color),
        new_sVertex(x+w,y+h,color)
    };

    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
}

void sGRAPHICS::DrawTexBox(LPDIRECT3DDEVICE9 pDevice,
                LPDIRECT3DTEXTURE9 pTexture,
                int x,
                int y,
                int w,
                int h)
{
        struct tVertex
        {
                float X, Y, Z, RHW;
                float IU, IV;
                 enum FVF
                {
                        FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_TEX1)
                };
       
        };
 
        tVertex Veri[4] =
        {
                {(float)x               ,(float)y               , 0.0f, 1.0f, 0.0f, 0.0f },
                {(float)(x+w)   ,(float)y               , 0.0f, 1.0f, 1.0f, 0.0f },
                {(float)x               ,(float)(y+h)   , 0.0f, 1.0f, 0.0f, 1.0f },
                {(float)(x+w)   ,(float)(y+h)   , 0.0f, 1.0f, 1.0f, 1.0f },
        };
       
        pDevice->SetTexture( 0, pTexture );
        //
        // Credit mmbob for helping fixing the problem
        //
        pDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
        pDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        pDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_TEXTURE );
        pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_SELECTARG1  );
        pDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE );
        //
        // Credit mmbob for helping fixing the problem
        //
        pDevice->SetTextureStageState( 1, D3DTSS_COLOROP,   D3DTOP_DISABLE );
        pDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );
        ////////////////////////////////////
 
        pDevice->SetRenderState( D3DRS_LIGHTING, FALSE);
        pDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW);
        pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
        pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
        pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
        pDevice->SetRenderState( D3DRS_FOGENABLE, false );
 
        pDevice->SetFVF( tVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(tVertex));
        pDevice->SetTexture(0,0);
}

void cMenu::DrawTitleBar(LPDIRECT3DDEVICE9 pDevice)
{
    DWORD BarColor = TitleBarColor;
    if(Minimized)
        BarColor = TitleBarInactiveColor;
    
    // ToDO Mouse Move TitleBar
    if (Input->IsEnable())
    {
        if(Input->IsMouseHere(X, Y, W-30, 24))
        {
            if (Input->MouseButtonDown( DIMOUSE_LEFTBUTTON ))
            {
                if(!herebefore)
                {
                    bmp.x = Input->GetWindowsX() - X;
                    bmp.y = Input->GetWindowsY() - Y;
                    herebefore = true;
                }
                bX=X = short(Input->GetWindowsX() - bmp.x);
                bY=Y = short(Input->GetWindowsY() - bmp.y);
            }
            else
                herebefore=false;        
        }
        if (herebefore)
        {
            X = short(Input->GetWindowsX() - bmp.x);
            Y = short(Input->GetWindowsY() - bmp.y);
        } 
    }
    else
        herebefore=false;
    sVertex Veri[] =
    {
        new_sVertex(X+6,Y,        BarColor),
        new_sVertex(X+W-6,Y,    BarColor),
        new_sVertex(X+3,Y+2,    BarColor),
        new_sVertex(X+W-3,Y+2,    BarColor),
        new_sVertex(X+1,Y+4,    BarColor),
        new_sVertex(X+W-1,Y+4,    BarColor),
        new_sVertex(X,Y+6,        BarColor),
        new_sVertex(X+W,Y+6,    BarColor),
        new_sVertex(X,Y+24,        BarColor),
        new_sVertex(X+W,Y+24,    BarColor),
    };
    DWORD color = MinButtonColor;
    if (Input->IsMouseHere(X+W-30,Y+2, 20, 20) || Input->KeyPressed(DIK_LCONTROL))
    {
        if(this->isClicked())
            Minimized=!Minimized;
        color = MinButtonHighlightColor;
        
    }
    sVertex Min[] =
    {
        new_sVertex(X+W-30,Y+2,    color),
        new_sVertex(X+W-10,Y+2,    color),
        new_sVertex(X+W-30,Y+22,color),
        new_sVertex(X+W-10,Y+22,color),
    };
    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,8,Veri,sizeof(sVertex));
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Min,sizeof(sVertex));
    DrawBox(pDevice, X+W-26,Y+12,12, 2, 0xffffffff);
    if(this->Name)
    {
        DWORD fcolor = 0xffffffff;
        if (Minimized)
            fcolor = 0xffcccccc;
        fTitle->DrawText(float(X+10), float(Y+3), 0xffffffff, this->Name, D3DFONT_SHADOW);

    }
}


void cMenu::DrawTabs(LPDIRECT3DDEVICE9 pDevice)
{
    pDevice->SetTexture(0,0);
    pDevice->SetRenderState(D3DRS_LIGHTING, false);
    
    short width = (W-6) / noTabs;
    for(unsigned char i = 0; i < this->noTabs; i++)
    {
#pragma region Tab_D3D_Workup
        H=0;
        DWORD tabColor = TabInactiveColor;
        if( Input->IsMouseHere(X+(width*i)-2, Y+30, width, 20) )
        {
            if(isClicked())
                this->Selected = i;
            tabColor = TabMouseActiveColor;
        }
        if(i == this->Selected)
            tabColor = TabActiveColor;
        sVertex TabBox[] =
        {
            new_sVertex(X+(width*i)+2        ,    Y+30,    tabColor),
            new_sVertex(X+(width*i)-2+width    ,    Y+30,    tabColor),
            new_sVertex(X+(width*i)+2        ,    Y+50,    tabColor),
            new_sVertex(X+(width*i)+4+width    ,    Y+50,    tabColor),
        };
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,TabBox,sizeof(sVertex));
        fItem->DrawText(float(X+(width*i)+2+(width/2)),float(Y+33), 0xFFFFFFFF,Tabs[i].Name, D3DFONT_SHADOW | D3DFONT_CENTERED);
        H += 250;
        if(i != this->Selected) goto next;
#pragma endregion Tab_D3D_Workup
        DrawBox(pDevice, X+5, Y+60,W-10, 160, 0x30888888);
        while( Tabs[i].Selected < Tabs[i].scroll) Tabs[i].scroll--;
        while( Tabs[i].Selected >= (Tabs[i].scroll+10)) Tabs[i].scroll++;
        BYTE max =Tabs[i].noItems;
        
        int scrolled = (int)Input->GetRelativeZ() /60;

        if (Input->IsMouseHere(X+5, Y+60,W-10, 160))
        {
            Tabs[i].scroll -= scrolled;        
            if ((Tabs[i].scroll)>Tabs[i].noItems-10)
                Tabs[i].scroll = Tabs[i].noItems-10;
            if (Tabs[i].scroll < 0 )
                Tabs[i].scroll = 0;
        }
        if ((Tabs[i].scroll+10)<max)
            max = Tabs[i].scroll+10;
        for( unsigned char e=Tabs[i].scroll ; e<max; e++)
        {
            DWORD itemColor = ItemFontColor;
            if (Input->IsMouseHere(X+5, Y+65+(e*15-(Tabs[i].scroll*15)),200, 15))
            {
                Tabs[i].Selected = e;
                if(isClicked())
                {
                    Tabs[i].Items[e].ClickInc();
                    
                    
                }
            }
            
            
            if (e== Tabs[i].Selected)
            {
                DrawBox(pDevice, X+5,  Y+65+(e*15-(Tabs[i].scroll*15)), W-10, 15, 0x30454545);
                itemColor = ItemSelectedFontColor;

            }
            fItem->DrawText(float( X+10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, Tabs[i].Items[e].Name , D3DFONT_SHADOW | D3DFONT_FILTERED);
            if(Tabs[i].Items[e].type == ITEM_NORMAL)
            {
                if(Tabs[i].Items[e].Options)
                {    
                    fItem->DrawText(float( X+W-10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, Tabs[i].Items[e].Options[(Tabs[i].Items[e].GetValue())] , D3DFONT_SHADOW | D3DFONT_RIGHT | D3DFONT_FILTERED);
                }
                else
                {                    
                    char val[0x10];
                    sprintf_s(val, "%d", Tabs[i].Items[e].GetValue());
                    fItem->DrawText(float( X+W-10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, val , D3DFONT_SHADOW | D3DFONT_RIGHT | D3DFONT_FILTERED);
                }
                SIZE siz;
                if (Tabs[i].Items[e].desc && e== Tabs[i].Selected)
                {
                    m_pFont->GetTextExtent(Tabs[i].Items[e].desc, &siz);
                    DrawBox(pDevice, short( X+W+10), short(Y+65+(e*15-(Tabs[i].scroll*15))), short(siz.cx + 5), short(siz.cy +5), 0xF0484848);
                    m_pFont->DrawText(float( X+W+10),float(Y+65+(e*15-(Tabs[i].scroll*15))),0xFFFFFF00, Tabs[i].Items[e].desc,D3DFONT_SHADOW | D3DFONT_FILTERED);
                }
            }
            else if (Tabs[i].Items[e].type == ITEM_TEXT)
            {
                fItem->DrawText(float( X+W-10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, (char*)Tabs[i].Items[e].Options , D3DFONT_SHADOW | D3DFONT_RIGHT | D3DFONT_FILTERED);
            }
            else if (Tabs[i].Items[e].type == ITEM_COLOR)
            {
                DrawBox(pDevice, X+W-25, Y+65+(e*15-(Tabs[i].scroll*15)), 15, 15, Tabs[i].Items[e].GetColor() );
                if (e== Tabs[i].Selected)
                {
                    this->Draw(pDevice,(int)X+5, (int)Y+225,(int) W-10, (int)47);//this->DrawTexBox(pDevice, this->GetTex(), X+5, Y+225, W-10, 100);
                    if (Input->IsMouseHere((int)X+5, (int)Y+245, (int)W-10, 100))
                    {
                        if (GetAsyncKeyState(VK_LBUTTON))
                        {
                            if (Tabs[i].Items[e].Options)
                                *Tabs[i].Items[e].Options = (char*)GetColor((int)Input->GetWindowsX() -int(X+5), (int)Input->GetWindowsY() - int(Y+225));
                        }
                    }
                }
            }
        }
        
next:
        i = i;
    }
}

D3DHOOK_API void cMenu::Show(LPDIRECT3DDEVICE9 pDevice)
{    
    if (m_pDevice != pDevice) 
    {
        m_pDevice = pDevice;

        D3DVIEWPORT9 vp;
        pDevice->GetViewport(&vp);
        Input = new CInput(vp.Height, vp.Width);
        Input->UpdateDevice(pDevice);
        
        if (fTitle != 0)
        {
            fTitle->InvalidateDeviceObjects();
            fTitle->DeleteDeviceObjects();
        }
        fTitle->InitDeviceObjects(pDevice);
        fTitle->RestoreDeviceObjects();
        if (fItem != 0)
        {
            fItem->InvalidateDeviceObjects();
            fItem->DeleteDeviceObjects();
        }
        fItem->InitDeviceObjects(pDevice);
        fItem->RestoreDeviceObjects();
        
        if (m_pFont != 0)
        {
            m_pFont->InvalidateDeviceObjects();
            m_pFont->DeleteDeviceObjects();
        }
        m_pFont->InitDeviceObjects(pDevice);
        m_pFont->RestoreDeviceObjects();

        
    }

    bX=X;
    bY=Y;
    bH=H+24;
    bW=W;

    if(Input->IsEnable())
    {
        Input->Update();    
        KeyBoardNav();
    }

    DrawTitleBar(pDevice);
    
    if (Minimized) return;

    sVertex Background[] =
    {
        new_sVertex(X,Y+24,    0xc0484848),
        new_sVertex(X+W,Y+24,    0xc0484848),
        new_sVertex(X,Y+24+H,0xc0484848),
        new_sVertex(X+W,Y+24+H,0xc0484848),
    };
    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Background,sizeof(sVertex));

    DrawTabs(pDevice);
    //TO do Keyboard Controls
}

void D3DColorSpectrum::Draw(LPDIRECT3DDEVICE9 pDevice, int x, int y, int _Width, int _Height)
{
    Width = _Width;
    Height = _Height;
    for (DWORD i = 0; i < Width; i+=5)
    {
        for (DWORD j = 0; j < Height; j+=7)
        {
            if ((!((i+5) > Width) ) && !((j+7) > Height))
            {
                sVertex pixel[] =
                {
                    new_sVertex(x+i,y+j,    GetColor((int)i,(int)j)),
                    new_sVertex(x+i+5,y+j,    GetColor((int)i+5,(int)j)),
                    new_sVertex(x+i,y+j+7,  GetColor((int)i,(int)j+7)),
                    new_sVertex(x+i+5,y+j+7,GetColor((int)i+5,(int)j+7)),
                };
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,pixel,sizeof(sVertex));
            }
        }
    }
}

D3DCOLOR D3DColorSpectrum::HSLToRGB(float H, float S, float L)
{
    float Q;
    if (L < 0.5f)
        Q = L * (S + 1.0f);
    else
        Q = L + S - (L * S);

    float P = 2 * L - Q;

    float RGBs[3];
    RGBs[0] = H + (1.0f / 3.0f);
    RGBs[1] = H;
    RGBs[2] = H - (1.0f / 3.0f);

    for (int i = 0; i < 3; ++i)
    {
        if (RGBs[i] < 0)
            RGBs[i] += 1.0f;
        if (RGBs[i] > 1)
            RGBs[i] -= 1.0f;

        if (RGBs[i] < (1.0f / 6.0f))
            RGBs[i] = P + ((Q - P) * 6 * RGBs[i]);
        else if (RGBs[i] < 0.5f)
            RGBs[i] = Q;
        else if (RGBs[i] < (2.0f / 3.0f))
            RGBs[i] = P + ((Q - P) * 6 * ((2.0f / 3.0f) - RGBs[i]));
        else
            RGBs[i] = P;
    }

    return D3DCOLOR_XRGB(int(RGBs[0] * 255.0f), int(RGBs[1] * 255.0f), int(RGBs[2] * 255.0f));
}

D3DCOLOR D3DColorSpectrum::GetColor(int X, int Y)
{
    float H = X * (1.0f / Width);
    float S = 0.99f;
    float L = 1.0f - Y * (1.0f / Height);
    return HSLToRGB(H, S, L);
}

D3DHOOK_API void sTab::Show(LPDIRECT3DDEVICE9 pDevice)
{
    
#pragma region Reset
    if (m_pDevice != pDevice) 
    {
        D3DVIEWPORT9 vp;
        m_pDevice = pDevice;
        pDevice->GetViewport(&vp);
        if (Input)
        {
            Input->~CInput();
            Input=0;            
        }
        Input = new CInput(vp.Height, vp.Width);
        Input->Enable();
        Input->UpdateDevice(pDevice);
        if (m_pFont != 0)
        {
            m_pFont->InvalidateDeviceObjects();
            m_pFont->DeleteDeviceObjects();
        }
        m_pFont->InitDeviceObjects(pDevice);
        m_pFont->RestoreDeviceObjects();
    }
    Input->Update();
#pragma endregion Reset
#pragma region Tab_D3D_Workup
    SIZE siz;
    m_pFont->GetTextExtent(Name, &siz);
    sVertex TabBox[] =
    {
        new_sVertex(bX                ,    bY    ,    0x44FFFFFF),
        new_sVertex(bX+2+siz.cx        ,    bY    ,    0x44FFFFFF),
        new_sVertex(bX                ,    bY+30,    0x44FFFFFF),
        new_sVertex(bX+6+siz.cx     ,    bY+30,    0x44FFFFFF),
    };
    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,TabBox,sizeof(sVertex));
    m_pFont->DrawText(float(bX+2+(float(siz.cx)/2)),float(bY+2), 0xFFFFFFFF,this->Name, D3DFONT_SHADOW | D3DFONT_CENTERED);
#pragma endregion Tab_D3D_Workup
#pragma region DRAW _CALCULATION
    for (BYTE i = 0, e = 0; i < noItems, e < noHandles; i++, e++)
    {
        if(this->Items[i].type == ITEM_NORMAL)
        {
            DWORD itemColor = ItemFontColor;
            if (Input->IsMouseHere(bX+5, bY+65+(i*15-(this->scroll*15)),200, 15))
            {
                this->Selected = i;
                if(Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))                
                    this->Items[i].ClickInc();
            }
                        
            if (i== this->Selected)
            {
                DrawBox(pDevice, bX+5,  bY+65+(i*15-(this->scroll*15)), bW-10, 15, 0x30454545);
                itemColor = ItemSelectedFontColor;
            
            }
            m_pFont->DrawText(float( bX+10), float(bY+65+(i*15-(this->scroll*15))),itemColor, this->Items[i].Name , D3DFONT_SHADOW);
            if(this->Items[i].Options)
            {    
                m_pFont->DrawText(float( bX+bW), float(bY+65+(i*15-(this->scroll*15))),itemColor, this->Items[i].Options[(this->Items[i].GetValue())] , D3DFONT_SHADOW | D3DFONT_RIGHT);
            }
            else
            {                    
                char val[0x10];
                sprintf_s(val, "%d", this->Items[i].GetValue());
                m_pFont->DrawText(float( bX+bW-10), float(bY+65+(i*15-(this->scroll*15))),itemColor, val , D3DFONT_SHADOW | D3DFONT_RIGHT);
            }
            SIZE siz;
            if (this->Items[i].desc && i== this->Selected)
            {
                m_pFont->GetTextExtent(this->Items[i].desc, &siz);
                DrawBox(pDevice, bX, short(bY+bH), short(siz.cx + 5), short(siz.cy +5), 0x90484848);
                m_pFont->DrawText(float(bX+5),float(bY+bH+3),0xFFFFFF00, this->Items[i].desc,D3DFONT_SHADOW);
            }            
        }
        else 
        {
            {
                DWORD x1 = bX,
                      y1 =  bY + 30,
                      w1 = bW,
                      h1 = bH-30;
                sVertex Veri[4] =
                {
                    new_sVertex(x1,y1,0x44FFFFFF),
                    new_sVertex(x1+w1,y1,0x90000000),
                    new_sVertex(x1,y1+h1,0x90000000),
                    new_sVertex(x1+w1,y1+h1,0x90000000)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
            }
            DWORD x1 = bX+10,
                      y1 =  DWORD(bY+35+(i*25-(this->scroll*15))),
                      w1 = bW-20,
                      h1 = 25;
            if (!Input->IsMouseHere(x1, y1, w1, h1))
            {
                
                sVertex Veri[4] =
                {
                    new_sVertex(x1,y1,0x44FFFFFF),
                    new_sVertex(x1+w1,y1,0x44999999),
                    new_sVertex(x1,y1+h1,0x44999999),
                    new_sVertex(x1+w1,y1+h1,0x44999999)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
            }
            else
            {
                sVertex Veri[4] =
                {
                    new_sVertex(x1,y1,0x44FFFFFF),
                    new_sVertex(x1+w1,y1,0x55999999),
                    new_sVertex(x1,y1+h1,0x55999999),
                    new_sVertex(x1+w1,y1+h1,0x55999999)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
                if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
                {
                    if(!this->handles[e]->Running)
                    {
                        Explorer.StartUI(&this->handles[e]);
                        this->noHandles--;
                        this->handles[this->noHandles] = 0;
                    }
                }
            }
            
            m_pFont->DrawText(float( x1), float(y1),0xffffffff, this->handles[i]->Name , D3DFONT_SHADOW);
        }

    }
    
#pragma endregion _CALCULATION
}

D3DHOOK_API explorer::explorer() : UIHANDLE(sizeof(explorer))
{
    
    Name = "Blast OS";
    Input = 0;
    
    //startMenu->AddItem(("Shot Gun Gpread")  ,  0   , 0    , "WHAT IS THIS?");
    m_pFont = new CD3DFont("Arial", 9);
    butInfo = (UIHANDLE**)malloc(4*10);
    for (int i = 0; i < 10; i++)
        butInfo[i] = new UIHANDLE();

    startInfo = (UIHANDLE**)malloc(4*10);
    for (int i = 0; i < 10; i++)
        startInfo[i] = new UIHANDLE();

    trackIds = new DWORD[10];
}

D3DHOOK_API void explorer::Show(LPDIRECT3DDEVICE9 pDevice)
{    
    if(!init)
    {
        startMenu = new sTab("bOS");
        startMenu->bX = 0;
        startMenu->bY = 500;
        startMenu->bW = 200;
        startMenu->bH = 300;
        for (BYTE i = 0; i < startItems; i++)
        {
            startMenu->AddButton(&startInfo[i]);
        }
        Menu = true;
        init = true;
    }
    static bool update = false;
    pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
    pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
    pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
    pDevice->SetRenderState( D3DRS_SRCBLEND,   D3DBLEND_SRCALPHA );
    pDevice->SetRenderState( D3DRS_DESTBLEND,  D3DBLEND_INVSRCALPHA );
    pDevice->SetRenderState( D3DRS_ALPHAREF,         0x08 );
    pDevice->SetRenderState( D3DRS_ALPHAFUNC,  D3DCMP_GREATEREQUAL );
    pDevice->SetRenderState( D3DRS_CULLMODE,   D3DCULL_CCW );
    pDevice->SetRenderState( D3DRS_STENCILENABLE,    FALSE );
    pDevice->SetRenderState( D3DRS_CLIPPING,         TRUE );
    pDevice->SetRenderState( D3DRS_CLIPPLANEENABLE,  FALSE );
    pDevice->SetRenderState( D3DRS_VERTEXBLEND,      D3DVBF_DISABLE );
    pDevice->SetRenderState( D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE );
    D3DVIEWPORT9 vp;
    if (m_pDevice != pDevice) 
    {
        m_pDevice = pDevice;
        pDevice->GetViewport(&vp);
        scLength = vp.Height;
        scWidth = vp.Width;
        if (Input)
        {
            Input->~CInput();
            Input=0;            
        }
        Input = new CInput(scLength, scWidth);
        Input->Enable();
        Input->UpdateDevice(pDevice);
        if (m_pFont != 0)
        {
            m_pFont->InvalidateDeviceObjects();
            m_pFont->DeleteDeviceObjects();
        }
        m_pFont->InitDeviceObjects(pDevice);
        m_pFont->RestoreDeviceObjects();
        if (startTex != 0)
        {
            startTex->Release();
            startTex = NULL;
        }
        HRESULT hr;
        hr=D3DXCreateTextureFromResource(pDevice, 
                                        NULL,   
                                        MAKEINTRESOURCE(IDB_PNG1),
                                        &startTex);
        if(FAILED(hr))
        {
            if(FAILED(D3DXCreateTextureFromFileInMemory(pDevice, &myFile, sizeof(myFile), &startTex)))
                MessageBoxA(0, "Texture Creation Fail", 0, 0);
        }
    }
    
    DWORD size = DWORD(scWidth* 0.05) + 2;
    {
        DWORD x1 = 0,
              y1 =  scLength - DWORD(scLength* 0.05),
              w1 = scWidth,
              h1 = DWORD(scLength* 0.05);
        sVertex Veri[4] =
        {
            new_sVertex(x1,y1,0xc0FF0000),
            new_sVertex(x1+w1,y1,0xc0FF0000),
            new_sVertex(x1,y1+h1,0xc0000000),
            new_sVertex(x1+w1,y1+h1,0xc0000000)
        };
        
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
    }
    
//    DrawBox(pDevice, 0, scLength - DWORD(scLength* 0.05), scWidth, DWORD(scLength* 0.05), 0xFFff0000);
    for (char i = 0; i < noButtons; i++)
    {
        
        if(noButtons > 0)
        {
            butInfo[i]->Running = true;
            if(!butInfo[i]->Minimized)
            {
                if (i == this->Selected)
                {
                    if (butInfo[i]->Input)
                        butInfo[i]->Input->Enable();
                }
                else
                {
                    if (butInfo[i]->Input)
                    {
                        butInfo[i]->Input->Disable();
                        if(butInfo[Selected]->Minimized)
                            Selected = i;
                        if(butInfo[i]->ObjectsInterset(*butInfo[Selected]))
                        {
                            butInfo[i]->Input->Enable();
                            if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
                            {                        
                                butInfo[Selected]->Input->Disable();
                                Selected = i;
                                Menu = false;
                            }
                        }
                    }
                    DWORD x = butInfo[i]->bX ,
                        y =  butInfo[i]->bY,
                        w = butInfo[i]->bW ,
                        h = butInfo[i]->bH;
                    sVertex Veri[4] =
                    {
                        new_sVertex(x,y,0x66FFFFFF),
                        new_sVertex(x+w,y,0x66000000),
                        new_sVertex(x,y+h,0x66000000),
                        new_sVertex(x+w,y+h,0x66000000)
                    };
                    pDevice->SetFVF( sVertex::FVF_Flags  );
                    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
                    butInfo[i]->Show(pDevice);
                
                    pDevice->SetFVF( sVertex::FVF_Flags  );
                    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
                }            
            }
            SIZE tsize;
            m_pFont->GetTextExtent(butInfo[i]->Name, &tsize);
            static DWORD tWidth=0; 
            
            DWORD x = (size)+(i*(tWidth+6)),
                y =  scLength - DWORD(scLength* 0.05);
            tWidth= tsize.cx;
            DWORD     w = tWidth+4,
                h = DWORD(scLength* 0.05);
        
            if (i == Selected && !butInfo[i]->Minimized)
            {
                sVertex Veri[4] =
                {
                    new_sVertex(x,y,0x30FFFFFF),
                    new_sVertex(x+w,y,0x99FFFFFF),
                    new_sVertex(x,y+h,0x99FFFFFF),
                    new_sVertex(x+w,y+h,0x99FFFFFF)
                };

                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));

    //            DrawBox(pDevice, (size)+(i*(tWidth+6)), scLength - DWORD(scLength* 0.05), tWidth+4, DWORD(scLength* 0.05), 0x9900FFFF);
            }
            else if((i!= Selected || butInfo[Selected]->Minimized ) && Input->IsMouseHere((size)+(i*(tWidth+6)),scLength - DWORD(scLength* 0.05),tWidth+4, DWORD(scLength* 0.05)))
            {
            /*    DWORD x = (size)+(i*(tWidth+6)),
                    y =  scLength - DWORD(scLength* 0.05),
                    w = tWidth+4,
                    h = DWORD(scLength* 0.05);*/
                sVertex Veri[4] =
                {
                    new_sVertex(x,y,0x66FFFFFF),
                    new_sVertex(x+w,y,0x66FFFFFF),
                    new_sVertex(x,y+h,0x66000000),
                    new_sVertex(x+w,y+h,0x66000000)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
            //    DrawBox(pDevice, (size)+(i*(tWidth+6)), scLength - DWORD(scLength* 0.05), tWidth+4, DWORD(scLength* 0.05), 0x6644FFFF);
                if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
                {
                    butInfo[i]->Input->Enable();
                    butInfo[i]->Minimized = false;
                    butInfo[Selected]->Input->Disable();
                    Selected = i;
                    
                }
            }
            else
            {/*
                DWORD x = (size)+(i*(tWidth+6)),
                    y =  scLength - DWORD(scLength* 0.05),
                    w = tWidth+4,
                    h = DWORD(scLength* 0.05);*/
                sVertex Veri[4] =
                {
                    new_sVertex(x,y,0x44FFFFFF),
                    new_sVertex(x+w,y,0x44FFFFFF),
                    new_sVertex(x,y+h,0x44000000),
                    new_sVertex(x+w,y+h,0x44000000)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
    //            DrawBox(pDevice, (size)+(i*(tWidth+6)), scLength - DWORD(scLength* 0.05), tWidth+4, DWORD(scLength* 0.05), 0x4400FFFF);
            }
            if(noButtons != 0 && butInfo && butInfo[i])
                m_pFont->DrawText(float(x + 2 ), float(y)+ float(scLength* 0.05)/2.0f,0xffffffff,  butInfo[i]->Name, D3DFONT_SHADOW );
        
            if( !update) 
            {
                if( Input->IsMouseHere(size+i*(tWidth+6),scLength - DWORD(scLength* 0.05),tWidth+4, DWORD(scLength* 0.05) )  )
                {
                    if (Input->MouseButtonDown(DIMOUSE_RIGHTBUTTON))
                    {
                        if (!update)
                        {
                            butInfo[i]->Running = false;
                            Selected = 0;
                            for (BYTE I = i; I < noButtons; I++)
                            {
                                if( (I+1) < noButtons)
                                {
                                    butInfo[I] = butInfo[I+1];
                                    Selected = i+1;
                                }
                                else if (I == i && noButtons == 1 )
                                {
                                    butInfo[I] = 0;
                                    butInfo[0] = 0;
                                    noButtons = 0;
                                    update = true;
                                    break;
                                    return;
                                }
                                else if ( i-1 < 0)
                                    
                                    Selected = 0;
                                else
                                    Selected = i-1;

                            }
                            noButtons --;
                            update = true;
                        }
                        else
                            update = false;
                        
                    }
                    else
                        update = false;
                }
            }
            else if (!Input->IsMouseHere(size+i*(tWidth+6),scLength - DWORD(scLength* 0.05),tWidth+4, DWORD(scLength* 0.05))
                || !Input->MouseButtonDown(DIMOUSE_RIGHTBUTTON))
                update = false;
            
                //size+= tWidth+6;
            Input->Update();
        }
    }
    DWORD x = 0,
        y =  scLength - DWORD(scLength* 0.05),
        w = DWORD(scWidth* 0.05),
        h = DWORD(scLength* 0.05);
    if (Input->IsMouseHere(x, y, w, h))
    {
        sVertex Veri[4] =
        {
            new_sVertex(x,y,0x44FFFFFF),
            new_sVertex(x+w,y,0x40ffffff),
            new_sVertex(x,y+h,0x40ffffff),
            new_sVertex(x+w,y+h,0x40ffffff)
        };
        
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
        DrawTexBox(pDevice, startTex, x, y, w, h);
        if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
        {
            Menu =true;
        //    StartUI((UIHANDLE**)&startMenu);
        }
    }
    else
    {
        sVertex Veri[4] =
        {
            new_sVertex(x,y,0x44FFFFFF),
            new_sVertex(x+w,y,0x44FFFFFF),
            new_sVertex(x,y+h,0x90000000),
            new_sVertex(x+w,y+h,0x90000000)
        };
        
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
        DrawTexBox(pDevice, startTex, x, y, w, h);
        
    }

    if(noButtons > 0 && butInfo && butInfo[Selected])
    {
        if(butInfo[Selected]->Input)
            butInfo[Selected]->Input->Enable();
        butInfo[Selected]->Show(pDevice);
        DWORD x2 = butInfo[Selected]->bX ,
            y2 =  butInfo[Selected]->bY,
            w2 = butInfo[Selected]->bW ,
            h2 = butInfo[Selected]->bH;
        sVertex Veri[4] =
        {
            new_sVertex(x2,y2,0x34FFFFFF),
            new_sVertex(x2+w2,y2,0x34000000),
            new_sVertex(x2,y2+h2,0x34000000),
            new_sVertex(x2+w2,y2+h2,0x34000000)
        };
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
    }
    if (Menu) 
    {
        startMenu->bX = 0;
        startMenu->bY = DWORD(scLength - float(scLength* 0.45));
        startMenu->bW = DWORD(scLength* 0.20);
        startMenu->bH = DWORD((scLength -startMenu->bY) - float(scLength* 0.05));
        startMenu->Show(pDevice);

    }
//    DrawBox(pDevice, 0, scLength - DWORD(scLength* 0.05), DWORD(scLength* 0.05), DWORD(scLength* 0.05), 0xF4FfFFFF);
}

D3DHOOK_API void explorer::StartUI(UIHANDLE** obj)
{        
    if( obj != 0)
    {
        butInfo[noButtons] = *obj;    
        AddToStartMenu(obj);
        Selected = noButtons;
        
        noButtons++;    
    }    
}

D3DHOOK_API void explorer::AddToStartMenu(UIHANDLE** obj)
{
    
    if( obj != 0)
    {
        startInfo[startItems] = (*obj);
        startItems++;    
        if (init)
        {
            startMenu->AddButton(obj);
        }
    }
}
VirusTotal - Free Online Virus, Malware and URL Scanner
Menu.rar197 KB · 38 downloads Scanning…
Quote Originally Posted by topblast View Post


LOL i already explained it in the post about, it was a simple logic error from doing over the source i use for Hydra, fool.

They are 8bits in a bool, they are no registers smaller than 8bit so they cant store it, Please ur going into memory where I live and make my babies dont try me.

oh the difference between signed and unsigned is 8th bit.
in signed if the 8th bit is 1 then number is negitive but in unsigned it doesnt matter it uses all.
non specification cannot be from -128 to 255, because its a byte of 8bits, had u known the reason between signed and unsigned u would know thats not possible.


---------- Post added at 12:30 PM ---------- Previous post was at 12:23 PM ----------



u can hook any function in CA, even in the functions that calls present


---------- Post added at 12:32 PM ---------- Previous post was at 12:30 PM ----------



well, i wont say he is just a business man, he did code in his old days, when IBM offered him the chance to make an OS



PS: I am on ubuntu, hmm, its kinda slow... it sticks a lot and it talking up a lot of my CPU I GOT A PHENON II x4(knew i should of spent the $50 for the damn 6core)

---------- Post added at 11:47 AM ---------- Previous post was at 11:32 AM ----------



That was not the menu, that was in the part of the hack of which i did not code. It is a g-force hack, the team member contributed.

Beside, just because it used extra lines does not mean ur a bad code, U guys got this shit when coding u are trying to get the task done not work on the least codes, then u check over for that stuff, I dont have time to check over, it workss BLAME!

This is my menu (it a little hectic because i didnt finish

cMenu.h
Code:
#pragma once

#include <windows.h>
#include <d3d9.h>
#include <stdio.h>
#include <shlwapi.h>
#include "d3dfont9.h"
#include "cInput.h"
#include "resource.h"
//#include "textures.h"

#ifdef MENU_EXPORT
    #define D3DHOOK_API __declspec(dllexport)
#else
    #define D3DHOOK_API __declspec(dllimport)
#endif

#pragma pack(push, 1)
class cMenu;
//
#define TitleBarColor                0x904848cc
#define TitleBarInactiveColor        0x90888888
#define MinButtonColor                0x90FFA8A8
#define MinButtonHighlightColor        0xFFFF0000
#define TabInactiveColor            0x337575FF
#define TabActiveColor                0x334545FF
#define TabMouseActiveColor            0x33B5B5FF

#define ItemFontColor                0xFFFFFFFF
#define ItemSelectedFontColor        0xFF00FFFF

struct UIHANDLE
{
public:
    char* Name;
    char Selected; 

    bool Minimized, Running;
    DWORD UID;
    int bX, bY, bH, bW;
    CInput* Input;
    CD3DFont* m_pFont;
    LPDIRECT3DDEVICE9 m_pDevice;
    D3DHOOK_API UIHANDLE ( )
    {        
        UID = (DWORD)this;
        m_pFont =0;
    }

    D3DHOOK_API UIHANDLE (DWORD size )
    {
        memset(this, 0, size);
        UID = (DWORD)this;
    }

    D3DHOOK_API bool ObjectsInterset( UIHANDLE handle)
    {
        if(handle.Input)
        {
            if(handle.Input->IsMouseHere(handle.bX, handle.bY, handle.bW, handle.bH))
            {
                return false;
            }
            else 
            {
                if(handle.Input->IsMouseHere(this->bX, this->bY, this->bW, this->bH))
                    return true;
            }
        }
        else
        {
            Input->Enable();
            if(Input->IsMouseHere(handle.bX, handle.bY, handle.bW, handle.bH))
            {
                Input->Disable();
                return false;
            }
            else 
            {
                if(Input->IsMouseHere(this->bX, this->bY, this->bW, this->bH))
                {
                    Input->Disable();
                    return true;
                }
            }
        }
        return false;
                
    }
    
    virtual D3DHOOK_API void Show(LPDIRECT3DDEVICE9)
    {
    }
protected:
    virtual void MouseHover( UIHANDLE* sender ) 
    {

    }

};

class D3DColorSpectrum
{
    DWORD Width;
    DWORD Height;
    
    D3DCOLOR HSLToRGB(float H, float S, float L);
public:
    void Draw( LPDIRECT3DDEVICE9 pDevice, int x, int y, int w, int h);
    D3DCOLOR GetColor(int X, int Y);
};

class sGRAPHICS : public D3DColorSpectrum
{
public:
    virtual D3DHOOK_API void DrawBox(LPDIRECT3DDEVICE9 pDevice, DWORD x, DWORD y, DWORD w, DWORD h, DWORD color);
    virtual D3DHOOK_API void DrawTexBox(LPDIRECT3DDEVICE9 pDevice, LPDIRECT3DTEXTURE9 pTexture, int x, int y, int w, int h);
};

enum ITEM_TYPE
{
    ITEM_TEXT = 0, 
    ITEM_NORMAL = 1,
    ITEM_COLOR = 2,
    ITEM_BUTTON = 3
};

struct sItem : public UIHANDLE
{
public:
    char* Name;
    unsigned char* Value;

    unsigned char MaxValue;
    unsigned char type;
    char** Options;
    char* desc;
    void ClickInc()
    {
        if(Value)
        {
            if ((*Value) == (MaxValue-1))
                (*Value) = 0;
            else if ((*Value) < (MaxValue-1))
                (*Value)++;
        }
    }
    void Inc()
    {
        if (Value)
            if ((*Value) < (MaxValue-1))
                (*Value)++;
        
    }

    void Dec()
    {
        if (Value)
            if ((*Value) > 0)
                (*Value)--;        
    }

    unsigned char GetValue() 
    {

        if (Value)
            return (*Value); 
        else 
            return 0;
    }

    D3DCOLOR GetColor()
    {
        if(Options)
            return (DWORD)*Options;
        else
            return 0;
    }


    sItem() : UIHANDLE(sizeof(sItem))
    {
    }

    ~sItem()
    {
        memset(this, 0, sizeof(sItem));
    }
};

class sTab : public UIHANDLE, public sGRAPHICS
{
public:
    sItem* Items;
    UIHANDLE** handles;
    unsigned char noItems, noHandles, maxItems;
    char scroll;
    D3DHOOK_API sTab() : UIHANDLE(sizeof(sTab))
    {
        Name="Test Tab";
        maxItems=20;
        Items = new sItem[maxItems];
        handles = (UIHANDLE**)malloc(4*maxItems);
        for (int i = 0; i < maxItems; i++)
            handles[i] = new UIHANDLE();
    }

    D3DHOOK_API sTab(PCHAR name, unsigned char maxItem=20) : UIHANDLE(sizeof(sTab))
    {    
        Name = name;
        maxItems=maxItem;
        
        m_pFont = new CD3DFont("Arial", 9);
        Items = new sItem[maxItem];
        handles = (UIHANDLE**)malloc(4*maxItems);
        for (int i = 0; i < maxItems; i++)
            handles[i] = new UIHANDLE();
    }

    D3DHOOK_API~sTab()
    {
        memset(this, 0, sizeof(sTab));
    }
    
    D3DHOOK_API void Show(LPDIRECT3DDEVICE9 pDevice);

    D3DHOOK_API void AddButton(UIHANDLE** obj)
    {
        if (noItems>=maxItems)return;        
        handles[noHandles]  = *obj;
        noHandles++;
    }

    D3DHOOK_API void AddText(char* _Name, char* options)
    {
        if (noItems>=maxItems)return;
        Items[noItems].Name = _Name;
        Items[noItems].Value = 0;
        Items[noItems].Options = (char**)options;
        Items[noItems].MaxValue = 0;
        Items[noItems].desc = 0;
        Items[noItems].type = ITEM_TEXT;
        
        handles[noHandles]  = &Items[noItems];
        noHandles++;
        noItems++;
    }

    D3DHOOK_API void AddColor(char* _Name, DWORD* color)
    {
        if (noItems>=maxItems)return;
        Items[noItems].Name = _Name;
        Items[noItems].Value = 0;
        Items[noItems].Options = (char**)color;
        Items[noItems].MaxValue = 0;
        Items[noItems].desc = 0;
        Items[noItems].type = ITEM_COLOR;
        handles[noHandles]  = &Items[noItems];
        noHandles++;
        noItems++;
    }

    D3DHOOK_API void AddItem(char* _Name, unsigned char* _Value, char** options, char* desc=0, unsigned char maxValue=2)
    {
        if (noItems>=maxItems)return;
        *_Value = 0;
        Items[noItems].Name = _Name;
        Items[noItems].Value = _Value;
        Items[noItems].Options = options;
        Items[noItems].MaxValue = maxValue;
        Items[noItems].desc = desc;
        Items[noItems].type = ITEM_NORMAL;
        handles[noHandles]  = &Items[noItems];
        noHandles++;
        noItems++;
    }
};


struct sVertex
{
    
    float x, y, z, RHW;
    DWORD color;
    
    enum FVF
    {
        FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_DIFFUSE)
    };
};

class cMenu : public UIHANDLE, sGRAPHICS
{
    
    short X, Y, W, H;
    HWND wHandle;
    sTab* Tabs;
    POINT bmp;
    bool herebefore;
    unsigned char noTabs;
    CD3DFont* fTitle, *fItem;
    bool release;
    // functions
    void DrawTitleBar(LPDIRECT3DDEVICE9 pDevice);
    bool isClicked();
    void MouseHover( UIHANDLE* sender );
    void DrawTabs(LPDIRECT3DDEVICE9 pDevice);
    void KeyBoardNav();
public:
    D3DHOOK_API cMenu(void);
    D3DHOOK_API cMenu(PCHAR name, short x=30, short y=100, short w=200,unsigned char maxTabs=3);
    D3DHOOK_API ~cMenu(void);
    //
//    D3DHOOK_API void DrawBox(LPDIRECT3DDEVICE9 pDevice, short x, short y, short w, short h, DWORD color);
    //
    D3DHOOK_API void AddTab(sTab tab);
    D3DHOOK_API void Show(LPDIRECT3DDEVICE9);
};
/*
struct taskBuff 
{
    UIHANDLE *butInfo;
    BYTE noButtons;
};
taskBuff taBuf;*/

class explorer : public UIHANDLE,  public sGRAPHICS 
{
public:
    D3DHOOK_API explorer();
    D3DHOOK_API ~explorer() {}
    DWORD scLength, scWidth;
    bool Menu,init;
    sTab* startMenu;
    LPDIRECT3DTEXTURE9 startTex;
    UIHANDLE **butInfo, **startInfo;
    char noButtons, startItems;
    CD3DFont* m_pFont;
    DWORD* trackIds;
    BYTE noTIds;
    D3DHOOK_API void StartUI(UIHANDLE**);
    D3DHOOK_API void AddToStartMenu(UIHANDLE**);


    D3DHOOK_API void Show(LPDIRECT3DDEVICE9);
};
D3DHOOK_API extern explorer Explorer;
#pragma pack(pop)
cMenu.cpp
Code:
#include "cMenu.h"
#include "textures.h"

#include <d3dx9.h>

D3DHOOK_API cMenu::cMenu(void) : UIHANDLE(sizeof(cMenu))
{    
    Name = "Topblast Menu Window v1.0";
    X= Y = 30;
    W = 250;    
    char process[512];
    //GetModuleFileNameA(GetModuleHandle(0), process, sizeof(process));
    //PathStripPathA(process);
    GetWindowTextA(GetForegroundWindow(),process, sizeof(process));
    wHandle = FindWindowA(0, process);

    herebefore = false;
    char* font = "Arial";
    fTitle = new CD3DFont(font, 10, D3DFONT_BOLD);
    fItem = new CD3DFont(font, 10);
    m_pFont = new CD3DFont("Info", 10);
    Tabs = new sTab[3];
}

D3DHOOK_API cMenu::cMenu(PCHAR name, short x, short y, short w, unsigned char maxTabs) : UIHANDLE(sizeof(cMenu))
{
    
    Input = 0;
    Name = name;
    X= x;Y = y;
    W = w;

    herebefore = false;

    char process[512];
    //GetModuleFileNameA(GetModuleHandle(0), process, sizeof(process));
    //PathStripPathA(process);
    GetWindowTextA(GetForegroundWindow(),process, sizeof(process));
    wHandle = FindWindowA(0, process);

    char* font = "Arial";
    fTitle = new CD3DFont(font, 10, D3DFONT_BOLD);
    fItem = new CD3DFont(font, 10);
    m_pFont = new CD3DFont("Info", 10);
    Tabs = new sTab[maxTabs];
}


D3DHOOK_API  cMenu::~cMenu(void)// : ~UIHANDLE()
{
    // Clean up
    for(BYTE i = 0; i < noTabs; i++)
    {
        if(this->Tabs)
        {
            for( BYTE e = 0; e < Tabs[i].noItems; e++ )
            {
                Tabs[i].Items[e].~sItem();
            }
        }
    }
    if(fTitle)
        fTitle ->~CD3DFont();
    if(fItem)
        fItem  ->~CD3DFont();
    if(m_pFont)
        m_pFont->~CD3DFont();
    // then
    memset(this, 0, sizeof(cMenu));
}

// Menu Starting Up Process

D3DHOOK_API  void cMenu::AddTab(sTab tab)
{
    this->Tabs[noTabs] = tab;
    
    noTabs++;
}


// Input Controls

void cMenu::MouseHover( UIHANDLE* sender ) 
{

}

bool cMenu::isClicked()
{

    if(Input->MouseButtonDown( DIMOUSE_LEFTBUTTON ))//GetAsyncKeyState(VK_LBUTTON))
    {    
        if (this->release == true)
        {    
            this->release = false;
            return true;
        }else{
            return false;
        }
    }
    this->release = true;
    return false;
}

bool rig = false, lef = false;

void cMenu::KeyBoardNav()
{
    if(Input->KeyPressed(DIK_HOME))
    {
        if(Input->KeyPressed(DIK_UP))
            Y=Y-5;
        else if(Input->KeyPressed(DIK_DOWN))
            Y=Y+5;
        if(Input->KeyPressed(DIK_LEFT))
            this->X = X-5;
        else if(Input->KeyPressed(DIK_RIGHT))
            X= X+5;

    }
    else if(Input->KeyPressed(DIK_LSHIFT))
    {
        if(Input->KeyPressed(DIK_LEFT))
        {
            if (this->Selected != 0 && (!lef))
            {
                this->Selected=this->Selected -1;
            }
            lef = true;
        }
        else 
            lef = false;
        if(Input->KeyPressed(DIK_RIGHT))
        {    
            if (this->Selected < this->noTabs &&(!rig))
            {
                this->Selected=this->Selected +1;
                if(this->Selected == this->noTabs)
                    this->Selected=this->Selected -1;
            }
            rig = true;
        }
        else 
            rig = false;
    }        
    else
    {
        if (Input->KeyPressed(DIK_UP)&1)
        {
            Tabs[this->Selected].Selected--;
            if (Tabs[this->Selected].Selected < 0) Tabs[this->Selected].Selected = Tabs[this->Selected].noItems-1;
        }
        else if (Input->KeyPressed(DIK_DOWN)&1)
        {
            Tabs[this->Selected].Selected++;
            if (Tabs[this->Selected].Selected >= Tabs[this->Selected].noItems ) Tabs[this->Selected].Selected = 0;
        }
        else{
            sTab & Tab = Tabs[this->Selected];
            sItem& Item = Tab.Items[Tab.Selected];
            if (Input->KeyPressed(DIK_LEFT)&1)
            {
                Item.Dec();
            }
            else if (Input->KeyPressed(DIK_RIGHT)&1)
            {
                Item.Inc();
            }
        }
    }
}

// D3D Function

sVertex new_sVertex(DWORD x, DWORD y, DWORD color)
{
    float fx = float(x);
    float fy = float(y);
    float fz = float(0);
    float RHW = float(0);
    sVertex ret = {fx,fy,fz,RHW, color};
    return ret;
}

void sGRAPHICS::DrawBox(LPDIRECT3DDEVICE9 pDevice, DWORD x, DWORD y, DWORD w, DWORD h, DWORD color)
{
    sVertex Veri[4] =
    {
        new_sVertex(x,y,color),
        new_sVertex(x+w,y,color),
        new_sVertex(x,y+h,color),
        new_sVertex(x+w,y+h,color)
    };

    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
}

void sGRAPHICS::DrawTexBox(LPDIRECT3DDEVICE9 pDevice,
                LPDIRECT3DTEXTURE9 pTexture,
                int x,
                int y,
                int w,
                int h)
{
        struct tVertex
        {
                float X, Y, Z, RHW;
                float IU, IV;
                 enum FVF
                {
                        FVF_Flags = (D3DFVF_XYZRHW | D3DFVF_TEX1)
                };
       
        };
 
        tVertex Veri[4] =
        {
                {(float)x               ,(float)y               , 0.0f, 1.0f, 0.0f, 0.0f },
                {(float)(x+w)   ,(float)y               , 0.0f, 1.0f, 1.0f, 0.0f },
                {(float)x               ,(float)(y+h)   , 0.0f, 1.0f, 0.0f, 1.0f },
                {(float)(x+w)   ,(float)(y+h)   , 0.0f, 1.0f, 1.0f, 1.0f },
        };
       
        pDevice->SetTexture( 0, pTexture );
        //
        // Credit mmbob for helping fixing the problem
        //
        pDevice->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
        pDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        pDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_TEXTURE );
        pDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP,   D3DTOP_SELECTARG1  );
        pDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE );
        //
        // Credit mmbob for helping fixing the problem
        //
        pDevice->SetTextureStageState( 1, D3DTSS_COLOROP,   D3DTOP_DISABLE );
        pDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );
        ////////////////////////////////////
 
        pDevice->SetRenderState( D3DRS_LIGHTING, FALSE);
        pDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW);
        pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
        pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
        pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
        pDevice->SetRenderState( D3DRS_FOGENABLE, false );
 
        pDevice->SetFVF( tVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(tVertex));
        pDevice->SetTexture(0,0);
}

void cMenu::DrawTitleBar(LPDIRECT3DDEVICE9 pDevice)
{
    DWORD BarColor = TitleBarColor;
    if(Minimized)
        BarColor = TitleBarInactiveColor;
    
    // ToDO Mouse Move TitleBar
    if (Input->IsEnable())
    {
        if(Input->IsMouseHere(X, Y, W-30, 24))
        {
            if (Input->MouseButtonDown( DIMOUSE_LEFTBUTTON ))
            {
                if(!herebefore)
                {
                    bmp.x = Input->GetWindowsX() - X;
                    bmp.y = Input->GetWindowsY() - Y;
                    herebefore = true;
                }
                bX=X = short(Input->GetWindowsX() - bmp.x);
                bY=Y = short(Input->GetWindowsY() - bmp.y);
            }
            else
                herebefore=false;        
        }
        if (herebefore)
        {
            X = short(Input->GetWindowsX() - bmp.x);
            Y = short(Input->GetWindowsY() - bmp.y);
        } 
    }
    else
        herebefore=false;
    sVertex Veri[] =
    {
        new_sVertex(X+6,Y,        BarColor),
        new_sVertex(X+W-6,Y,    BarColor),
        new_sVertex(X+3,Y+2,    BarColor),
        new_sVertex(X+W-3,Y+2,    BarColor),
        new_sVertex(X+1,Y+4,    BarColor),
        new_sVertex(X+W-1,Y+4,    BarColor),
        new_sVertex(X,Y+6,        BarColor),
        new_sVertex(X+W,Y+6,    BarColor),
        new_sVertex(X,Y+24,        BarColor),
        new_sVertex(X+W,Y+24,    BarColor),
    };
    DWORD color = MinButtonColor;
    if (Input->IsMouseHere(X+W-30,Y+2, 20, 20) || Input->KeyPressed(DIK_LCONTROL))
    {
        if(this->isClicked())
            Minimized=!Minimized;
        color = MinButtonHighlightColor;
        
    }
    sVertex Min[] =
    {
        new_sVertex(X+W-30,Y+2,    color),
        new_sVertex(X+W-10,Y+2,    color),
        new_sVertex(X+W-30,Y+22,color),
        new_sVertex(X+W-10,Y+22,color),
    };
    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,8,Veri,sizeof(sVertex));
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Min,sizeof(sVertex));
    DrawBox(pDevice, X+W-26,Y+12,12, 2, 0xffffffff);
    if(this->Name)
    {
        DWORD fcolor = 0xffffffff;
        if (Minimized)
            fcolor = 0xffcccccc;
        fTitle->DrawText(float(X+10), float(Y+3), 0xffffffff, this->Name, D3DFONT_SHADOW);

    }
}


void cMenu::DrawTabs(LPDIRECT3DDEVICE9 pDevice)
{
    pDevice->SetTexture(0,0);
    pDevice->SetRenderState(D3DRS_LIGHTING, false);
    
    short width = (W-6) / noTabs;
    for(unsigned char i = 0; i < this->noTabs; i++)
    {
#pragma region Tab_D3D_Workup
        H=0;
        DWORD tabColor = TabInactiveColor;
        if( Input->IsMouseHere(X+(width*i)-2, Y+30, width, 20) )
        {
            if(isClicked())
                this->Selected = i;
            tabColor = TabMouseActiveColor;
        }
        if(i == this->Selected)
            tabColor = TabActiveColor;
        sVertex TabBox[] =
        {
            new_sVertex(X+(width*i)+2        ,    Y+30,    tabColor),
            new_sVertex(X+(width*i)-2+width    ,    Y+30,    tabColor),
            new_sVertex(X+(width*i)+2        ,    Y+50,    tabColor),
            new_sVertex(X+(width*i)+4+width    ,    Y+50,    tabColor),
        };
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,TabBox,sizeof(sVertex));
        fItem->DrawText(float(X+(width*i)+2+(width/2)),float(Y+33), 0xFFFFFFFF,Tabs[i].Name, D3DFONT_SHADOW | D3DFONT_CENTERED);
        H += 250;
        if(i != this->Selected) goto next;
#pragma endregion Tab_D3D_Workup
        DrawBox(pDevice, X+5, Y+60,W-10, 160, 0x30888888);
        while( Tabs[i].Selected < Tabs[i].scroll) Tabs[i].scroll--;
        while( Tabs[i].Selected >= (Tabs[i].scroll+10)) Tabs[i].scroll++;
        BYTE max =Tabs[i].noItems;
        
        int scrolled = (int)Input->GetRelativeZ() /60;

        if (Input->IsMouseHere(X+5, Y+60,W-10, 160))
        {
            Tabs[i].scroll -= scrolled;        
            if ((Tabs[i].scroll)>Tabs[i].noItems-10)
                Tabs[i].scroll = Tabs[i].noItems-10;
            if (Tabs[i].scroll < 0 )
                Tabs[i].scroll = 0;
        }
        if ((Tabs[i].scroll+10)<max)
            max = Tabs[i].scroll+10;
        for( unsigned char e=Tabs[i].scroll ; e<max; e++)
        {
            DWORD itemColor = ItemFontColor;
            if (Input->IsMouseHere(X+5, Y+65+(e*15-(Tabs[i].scroll*15)),200, 15))
            {
                Tabs[i].Selected = e;
                if(isClicked())
                {
                    Tabs[i].Items[e].ClickInc();
                    
                    
                }
            }
            
            
            if (e== Tabs[i].Selected)
            {
                DrawBox(pDevice, X+5,  Y+65+(e*15-(Tabs[i].scroll*15)), W-10, 15, 0x30454545);
                itemColor = ItemSelectedFontColor;

            }
            fItem->DrawText(float( X+10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, Tabs[i].Items[e].Name , D3DFONT_SHADOW | D3DFONT_FILTERED);
            if(Tabs[i].Items[e].type == ITEM_NORMAL)
            {
                if(Tabs[i].Items[e].Options)
                {    
                    fItem->DrawText(float( X+W-10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, Tabs[i].Items[e].Options[(Tabs[i].Items[e].GetValue())] , D3DFONT_SHADOW | D3DFONT_RIGHT | D3DFONT_FILTERED);
                }
                else
                {                    
                    char val[0x10];
                    sprintf_s(val, "%d", Tabs[i].Items[e].GetValue());
                    fItem->DrawText(float( X+W-10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, val , D3DFONT_SHADOW | D3DFONT_RIGHT | D3DFONT_FILTERED);
                }
                SIZE siz;
                if (Tabs[i].Items[e].desc && e== Tabs[i].Selected)
                {
                    m_pFont->GetTextExtent(Tabs[i].Items[e].desc, &siz);
                    DrawBox(pDevice, short( X+W+10), short(Y+65+(e*15-(Tabs[i].scroll*15))), short(siz.cx + 5), short(siz.cy +5), 0xF0484848);
                    m_pFont->DrawText(float( X+W+10),float(Y+65+(e*15-(Tabs[i].scroll*15))),0xFFFFFF00, Tabs[i].Items[e].desc,D3DFONT_SHADOW | D3DFONT_FILTERED);
                }
            }
            else if (Tabs[i].Items[e].type == ITEM_TEXT)
            {
                fItem->DrawText(float( X+W-10), float(Y+65+(e*15-(Tabs[i].scroll*15))),itemColor, (char*)Tabs[i].Items[e].Options , D3DFONT_SHADOW | D3DFONT_RIGHT | D3DFONT_FILTERED);
            }
            else if (Tabs[i].Items[e].type == ITEM_COLOR)
            {
                DrawBox(pDevice, X+W-25, Y+65+(e*15-(Tabs[i].scroll*15)), 15, 15, Tabs[i].Items[e].GetColor() );
                if (e== Tabs[i].Selected)
                {
                    this->Draw(pDevice,(int)X+5, (int)Y+225,(int) W-10, (int)47);//this->DrawTexBox(pDevice, this->GetTex(), X+5, Y+225, W-10, 100);
                    if (Input->IsMouseHere((int)X+5, (int)Y+245, (int)W-10, 100))
                    {
                        if (GetAsyncKeyState(VK_LBUTTON))
                        {
                            if (Tabs[i].Items[e].Options)
                                *Tabs[i].Items[e].Options = (char*)GetColor((int)Input->GetWindowsX() -int(X+5), (int)Input->GetWindowsY() - int(Y+225));
                        }
                    }
                }
            }
        }
        
next:
        i = i;
    }
}

D3DHOOK_API void cMenu::Show(LPDIRECT3DDEVICE9 pDevice)
{    
    if (m_pDevice != pDevice) 
    {
        m_pDevice = pDevice;

        D3DVIEWPORT9 vp;
        pDevice->GetViewport(&vp);
        Input = new CInput(vp.Height, vp.Width);
        Input->UpdateDevice(pDevice);
        
        if (fTitle != 0)
        {
            fTitle->InvalidateDeviceObjects();
            fTitle->DeleteDeviceObjects();
        }
        fTitle->InitDeviceObjects(pDevice);
        fTitle->RestoreDeviceObjects();
        if (fItem != 0)
        {
            fItem->InvalidateDeviceObjects();
            fItem->DeleteDeviceObjects();
        }
        fItem->InitDeviceObjects(pDevice);
        fItem->RestoreDeviceObjects();
        
        if (m_pFont != 0)
        {
            m_pFont->InvalidateDeviceObjects();
            m_pFont->DeleteDeviceObjects();
        }
        m_pFont->InitDeviceObjects(pDevice);
        m_pFont->RestoreDeviceObjects();

        
    }

    bX=X;
    bY=Y;
    bH=H+24;
    bW=W;

    if(Input->IsEnable())
    {
        Input->Update();    
        KeyBoardNav();
    }

    DrawTitleBar(pDevice);
    
    if (Minimized) return;

    sVertex Background[] =
    {
        new_sVertex(X,Y+24,    0xc0484848),
        new_sVertex(X+W,Y+24,    0xc0484848),
        new_sVertex(X,Y+24+H,0xc0484848),
        new_sVertex(X+W,Y+24+H,0xc0484848),
    };
    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Background,sizeof(sVertex));

    DrawTabs(pDevice);
    //TO do Keyboard Controls
}

void D3DColorSpectrum::Draw(LPDIRECT3DDEVICE9 pDevice, int x, int y, int _Width, int _Height)
{
    Width = _Width;
    Height = _Height;
    for (DWORD i = 0; i < Width; i+=5)
    {
        for (DWORD j = 0; j < Height; j+=7)
        {
            if ((!((i+5) > Width) ) && !((j+7) > Height))
            {
                sVertex pixel[] =
                {
                    new_sVertex(x+i,y+j,    GetColor((int)i,(int)j)),
                    new_sVertex(x+i+5,y+j,    GetColor((int)i+5,(int)j)),
                    new_sVertex(x+i,y+j+7,  GetColor((int)i,(int)j+7)),
                    new_sVertex(x+i+5,y+j+7,GetColor((int)i+5,(int)j+7)),
                };
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,pixel,sizeof(sVertex));
            }
        }
    }
}

D3DCOLOR D3DColorSpectrum::HSLToRGB(float H, float S, float L)
{
    float Q;
    if (L < 0.5f)
        Q = L * (S + 1.0f);
    else
        Q = L + S - (L * S);

    float P = 2 * L - Q;

    float RGBs[3];
    RGBs[0] = H + (1.0f / 3.0f);
    RGBs[1] = H;
    RGBs[2] = H - (1.0f / 3.0f);

    for (int i = 0; i < 3; ++i)
    {
        if (RGBs[i] < 0)
            RGBs[i] += 1.0f;
        if (RGBs[i] > 1)
            RGBs[i] -= 1.0f;

        if (RGBs[i] < (1.0f / 6.0f))
            RGBs[i] = P + ((Q - P) * 6 * RGBs[i]);
        else if (RGBs[i] < 0.5f)
            RGBs[i] = Q;
        else if (RGBs[i] < (2.0f / 3.0f))
            RGBs[i] = P + ((Q - P) * 6 * ((2.0f / 3.0f) - RGBs[i]));
        else
            RGBs[i] = P;
    }

    return D3DCOLOR_XRGB(int(RGBs[0] * 255.0f), int(RGBs[1] * 255.0f), int(RGBs[2] * 255.0f));
}

D3DCOLOR D3DColorSpectrum::GetColor(int X, int Y)
{
    float H = X * (1.0f / Width);
    float S = 0.99f;
    float L = 1.0f - Y * (1.0f / Height);
    return HSLToRGB(H, S, L);
}

D3DHOOK_API void sTab::Show(LPDIRECT3DDEVICE9 pDevice)
{
    
#pragma region Reset
    if (m_pDevice != pDevice) 
    {
        D3DVIEWPORT9 vp;
        m_pDevice = pDevice;
        pDevice->GetViewport(&vp);
        if (Input)
        {
            Input->~CInput();
            Input=0;            
        }
        Input = new CInput(vp.Height, vp.Width);
        Input->Enable();
        Input->UpdateDevice(pDevice);
        if (m_pFont != 0)
        {
            m_pFont->InvalidateDeviceObjects();
            m_pFont->DeleteDeviceObjects();
        }
        m_pFont->InitDeviceObjects(pDevice);
        m_pFont->RestoreDeviceObjects();
    }
    Input->Update();
#pragma endregion Reset
#pragma region Tab_D3D_Workup
    SIZE siz;
    m_pFont->GetTextExtent(Name, &siz);
    sVertex TabBox[] =
    {
        new_sVertex(bX                ,    bY    ,    0x44FFFFFF),
        new_sVertex(bX+2+siz.cx        ,    bY    ,    0x44FFFFFF),
        new_sVertex(bX                ,    bY+30,    0x44FFFFFF),
        new_sVertex(bX+6+siz.cx     ,    bY+30,    0x44FFFFFF),
    };
    pDevice->SetFVF( sVertex::FVF_Flags  );
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,TabBox,sizeof(sVertex));
    m_pFont->DrawText(float(bX+2+(float(siz.cx)/2)),float(bY+2), 0xFFFFFFFF,this->Name, D3DFONT_SHADOW | D3DFONT_CENTERED);
#pragma endregion Tab_D3D_Workup
#pragma region DRAW _CALCULATION
    for (BYTE i = 0, e = 0; i < noItems, e < noHandles; i++, e++)
    {
        if(this->Items[i].type == ITEM_NORMAL)
        {
            DWORD itemColor = ItemFontColor;
            if (Input->IsMouseHere(bX+5, bY+65+(i*15-(this->scroll*15)),200, 15))
            {
                this->Selected = i;
                if(Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))                
                    this->Items[i].ClickInc();
            }
                        
            if (i== this->Selected)
            {
                DrawBox(pDevice, bX+5,  bY+65+(i*15-(this->scroll*15)), bW-10, 15, 0x30454545);
                itemColor = ItemSelectedFontColor;
            
            }
            m_pFont->DrawText(float( bX+10), float(bY+65+(i*15-(this->scroll*15))),itemColor, this->Items[i].Name , D3DFONT_SHADOW);
            if(this->Items[i].Options)
            {    
                m_pFont->DrawText(float( bX+bW), float(bY+65+(i*15-(this->scroll*15))),itemColor, this->Items[i].Options[(this->Items[i].GetValue())] , D3DFONT_SHADOW | D3DFONT_RIGHT);
            }
            else
            {                    
                char val[0x10];
                sprintf_s(val, "%d", this->Items[i].GetValue());
                m_pFont->DrawText(float( bX+bW-10), float(bY+65+(i*15-(this->scroll*15))),itemColor, val , D3DFONT_SHADOW | D3DFONT_RIGHT);
            }
            SIZE siz;
            if (this->Items[i].desc && i== this->Selected)
            {
                m_pFont->GetTextExtent(this->Items[i].desc, &siz);
                DrawBox(pDevice, bX, short(bY+bH), short(siz.cx + 5), short(siz.cy +5), 0x90484848);
                m_pFont->DrawText(float(bX+5),float(bY+bH+3),0xFFFFFF00, this->Items[i].desc,D3DFONT_SHADOW);
            }            
        }
        else 
        {
            {
                DWORD x1 = bX,
                      y1 =  bY + 30,
                      w1 = bW,
                      h1 = bH-30;
                sVertex Veri[4] =
                {
                    new_sVertex(x1,y1,0x44FFFFFF),
                    new_sVertex(x1+w1,y1,0x90000000),
                    new_sVertex(x1,y1+h1,0x90000000),
                    new_sVertex(x1+w1,y1+h1,0x90000000)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
            }
            DWORD x1 = bX+10,
                      y1 =  DWORD(bY+35+(i*25-(this->scroll*15))),
                      w1 = bW-20,
                      h1 = 25;
            if (!Input->IsMouseHere(x1, y1, w1, h1))
            {
                
                sVertex Veri[4] =
                {
                    new_sVertex(x1,y1,0x44FFFFFF),
                    new_sVertex(x1+w1,y1,0x44999999),
                    new_sVertex(x1,y1+h1,0x44999999),
                    new_sVertex(x1+w1,y1+h1,0x44999999)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
            }
            else
            {
                sVertex Veri[4] =
                {
                    new_sVertex(x1,y1,0x44FFFFFF),
                    new_sVertex(x1+w1,y1,0x55999999),
                    new_sVertex(x1,y1+h1,0x55999999),
                    new_sVertex(x1+w1,y1+h1,0x55999999)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
                if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
                {
                    if(!this->handles[e]->Running)
                    {
                        Explorer.StartUI(&this->handles[e]);
                        this->noHandles--;
                        this->handles[this->noHandles] = 0;
                    }
                }
            }
            
            m_pFont->DrawText(float( x1), float(y1),0xffffffff, this->handles[i]->Name , D3DFONT_SHADOW);
        }

    }
    
#pragma endregion _CALCULATION
}

D3DHOOK_API explorer::explorer() : UIHANDLE(sizeof(explorer))
{
    
    Name = "Blast OS";
    Input = 0;
    
    //startMenu->AddItem(("Shot Gun Gpread")  ,  0   , 0    , "WHAT IS THIS?");
    m_pFont = new CD3DFont("Arial", 9);
    butInfo = (UIHANDLE**)malloc(4*10);
    for (int i = 0; i < 10; i++)
        butInfo[i] = new UIHANDLE();

    startInfo = (UIHANDLE**)malloc(4*10);
    for (int i = 0; i < 10; i++)
        startInfo[i] = new UIHANDLE();

    trackIds = new DWORD[10];
}

D3DHOOK_API void explorer::Show(LPDIRECT3DDEVICE9 pDevice)
{    
    if(!init)
    {
        startMenu = new sTab("bOS");
        startMenu->bX = 0;
        startMenu->bY = 500;
        startMenu->bW = 200;
        startMenu->bH = 300;
        for (BYTE i = 0; i < startItems; i++)
        {
            startMenu->AddButton(&startInfo[i]);
        }
        Menu = true;
        init = true;
    }
    static bool update = false;
    pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
    pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCCOLOR);
    pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
    pDevice->SetRenderState( D3DRS_SRCBLEND,   D3DBLEND_SRCALPHA );
    pDevice->SetRenderState( D3DRS_DESTBLEND,  D3DBLEND_INVSRCALPHA );
    pDevice->SetRenderState( D3DRS_ALPHAREF,         0x08 );
    pDevice->SetRenderState( D3DRS_ALPHAFUNC,  D3DCMP_GREATEREQUAL );
    pDevice->SetRenderState( D3DRS_CULLMODE,   D3DCULL_CCW );
    pDevice->SetRenderState( D3DRS_STENCILENABLE,    FALSE );
    pDevice->SetRenderState( D3DRS_CLIPPING,         TRUE );
    pDevice->SetRenderState( D3DRS_CLIPPLANEENABLE,  FALSE );
    pDevice->SetRenderState( D3DRS_VERTEXBLEND,      D3DVBF_DISABLE );
    pDevice->SetRenderState( D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE );
    D3DVIEWPORT9 vp;
    if (m_pDevice != pDevice) 
    {
        m_pDevice = pDevice;
        pDevice->GetViewport(&vp);
        scLength = vp.Height;
        scWidth = vp.Width;
        if (Input)
        {
            Input->~CInput();
            Input=0;            
        }
        Input = new CInput(scLength, scWidth);
        Input->Enable();
        Input->UpdateDevice(pDevice);
        if (m_pFont != 0)
        {
            m_pFont->InvalidateDeviceObjects();
            m_pFont->DeleteDeviceObjects();
        }
        m_pFont->InitDeviceObjects(pDevice);
        m_pFont->RestoreDeviceObjects();
        if (startTex != 0)
        {
            startTex->Release();
            startTex = NULL;
        }
        HRESULT hr;
        hr=D3DXCreateTextureFromResource(pDevice, 
                                        NULL,   
                                        MAKEINTRESOURCE(IDB_PNG1),
                                        &startTex);
        if(FAILED(hr))
        {
            if(FAILED(D3DXCreateTextureFromFileInMemory(pDevice, &myFile, sizeof(myFile), &startTex)))
                MessageBoxA(0, "Texture Creation Fail", 0, 0);
        }
    }
    
    DWORD size = DWORD(scWidth* 0.05) + 2;
    {
        DWORD x1 = 0,
              y1 =  scLength - DWORD(scLength* 0.05),
              w1 = scWidth,
              h1 = DWORD(scLength* 0.05);
        sVertex Veri[4] =
        {
            new_sVertex(x1,y1,0xc0FF0000),
            new_sVertex(x1+w1,y1,0xc0FF0000),
            new_sVertex(x1,y1+h1,0xc0000000),
            new_sVertex(x1+w1,y1+h1,0xc0000000)
        };
        
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
    }
    
//    DrawBox(pDevice, 0, scLength - DWORD(scLength* 0.05), scWidth, DWORD(scLength* 0.05), 0xFFff0000);
    for (char i = 0; i < noButtons; i++)
    {
        
        if(noButtons > 0)
        {
            butInfo[i]->Running = true;
            if(!butInfo[i]->Minimized)
            {
                if (i == this->Selected)
                {
                    if (butInfo[i]->Input)
                        butInfo[i]->Input->Enable();
                }
                else
                {
                    if (butInfo[i]->Input)
                    {
                        butInfo[i]->Input->Disable();
                        if(butInfo[Selected]->Minimized)
                            Selected = i;
                        if(butInfo[i]->ObjectsInterset(*butInfo[Selected]))
                        {
                            butInfo[i]->Input->Enable();
                            if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
                            {                        
                                butInfo[Selected]->Input->Disable();
                                Selected = i;
                                Menu = false;
                            }
                        }
                    }
                    DWORD x = butInfo[i]->bX ,
                        y =  butInfo[i]->bY,
                        w = butInfo[i]->bW ,
                        h = butInfo[i]->bH;
                    sVertex Veri[4] =
                    {
                        new_sVertex(x,y,0x66FFFFFF),
                        new_sVertex(x+w,y,0x66000000),
                        new_sVertex(x,y+h,0x66000000),
                        new_sVertex(x+w,y+h,0x66000000)
                    };
                    pDevice->SetFVF( sVertex::FVF_Flags  );
                    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
                    butInfo[i]->Show(pDevice);
                
                    pDevice->SetFVF( sVertex::FVF_Flags  );
                    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
                }            
            }
            SIZE tsize;
            m_pFont->GetTextExtent(butInfo[i]->Name, &tsize);
            static DWORD tWidth=0; 
            
            DWORD x = (size)+(i*(tWidth+6)),
                y =  scLength - DWORD(scLength* 0.05);
            tWidth= tsize.cx;
            DWORD     w = tWidth+4,
                h = DWORD(scLength* 0.05);
        
            if (i == Selected && !butInfo[i]->Minimized)
            {
                sVertex Veri[4] =
                {
                    new_sVertex(x,y,0x30FFFFFF),
                    new_sVertex(x+w,y,0x99FFFFFF),
                    new_sVertex(x,y+h,0x99FFFFFF),
                    new_sVertex(x+w,y+h,0x99FFFFFF)
                };

                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));

    //            DrawBox(pDevice, (size)+(i*(tWidth+6)), scLength - DWORD(scLength* 0.05), tWidth+4, DWORD(scLength* 0.05), 0x9900FFFF);
            }
            else if((i!= Selected || butInfo[Selected]->Minimized ) && Input->IsMouseHere((size)+(i*(tWidth+6)),scLength - DWORD(scLength* 0.05),tWidth+4, DWORD(scLength* 0.05)))
            {
            /*    DWORD x = (size)+(i*(tWidth+6)),
                    y =  scLength - DWORD(scLength* 0.05),
                    w = tWidth+4,
                    h = DWORD(scLength* 0.05);*/
                sVertex Veri[4] =
                {
                    new_sVertex(x,y,0x66FFFFFF),
                    new_sVertex(x+w,y,0x66FFFFFF),
                    new_sVertex(x,y+h,0x66000000),
                    new_sVertex(x+w,y+h,0x66000000)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
            //    DrawBox(pDevice, (size)+(i*(tWidth+6)), scLength - DWORD(scLength* 0.05), tWidth+4, DWORD(scLength* 0.05), 0x6644FFFF);
                if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
                {
                    butInfo[i]->Input->Enable();
                    butInfo[i]->Minimized = false;
                    butInfo[Selected]->Input->Disable();
                    Selected = i;
                    
                }
            }
            else
            {/*
                DWORD x = (size)+(i*(tWidth+6)),
                    y =  scLength - DWORD(scLength* 0.05),
                    w = tWidth+4,
                    h = DWORD(scLength* 0.05);*/
                sVertex Veri[4] =
                {
                    new_sVertex(x,y,0x44FFFFFF),
                    new_sVertex(x+w,y,0x44FFFFFF),
                    new_sVertex(x,y+h,0x44000000),
                    new_sVertex(x+w,y+h,0x44000000)
                };
                
                pDevice->SetFVF( sVertex::FVF_Flags  );
                pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
    //            DrawBox(pDevice, (size)+(i*(tWidth+6)), scLength - DWORD(scLength* 0.05), tWidth+4, DWORD(scLength* 0.05), 0x4400FFFF);
            }
            if(noButtons != 0 && butInfo && butInfo[i])
                m_pFont->DrawText(float(x + 2 ), float(y)+ float(scLength* 0.05)/2.0f,0xffffffff,  butInfo[i]->Name, D3DFONT_SHADOW );
        
            if( !update) 
            {
                if( Input->IsMouseHere(size+i*(tWidth+6),scLength - DWORD(scLength* 0.05),tWidth+4, DWORD(scLength* 0.05) )  )
                {
                    if (Input->MouseButtonDown(DIMOUSE_RIGHTBUTTON))
                    {
                        if (!update)
                        {
                            butInfo[i]->Running = false;
                            Selected = 0;
                            for (BYTE I = i; I < noButtons; I++)
                            {
                                if( (I+1) < noButtons)
                                {
                                    butInfo[I] = butInfo[I+1];
                                    Selected = i+1;
                                }
                                else if (I == i && noButtons == 1 )
                                {
                                    butInfo[I] = 0;
                                    butInfo[0] = 0;
                                    noButtons = 0;
                                    update = true;
                                    break;
                                    return;
                                }
                                else if ( i-1 < 0)
                                    
                                    Selected = 0;
                                else
                                    Selected = i-1;

                            }
                            noButtons --;
                            update = true;
                        }
                        else
                            update = false;
                        
                    }
                    else
                        update = false;
                }
            }
            else if (!Input->IsMouseHere(size+i*(tWidth+6),scLength - DWORD(scLength* 0.05),tWidth+4, DWORD(scLength* 0.05))
                || !Input->MouseButtonDown(DIMOUSE_RIGHTBUTTON))
                update = false;
            
                //size+= tWidth+6;
            Input->Update();
        }
    }
    DWORD x = 0,
        y =  scLength - DWORD(scLength* 0.05),
        w = DWORD(scWidth* 0.05),
        h = DWORD(scLength* 0.05);
    if (Input->IsMouseHere(x, y, w, h))
    {
        sVertex Veri[4] =
        {
            new_sVertex(x,y,0x44FFFFFF),
            new_sVertex(x+w,y,0x40ffffff),
            new_sVertex(x,y+h,0x40ffffff),
            new_sVertex(x+w,y+h,0x40ffffff)
        };
        
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
        DrawTexBox(pDevice, startTex, x, y, w, h);
        if (Input->MouseButtonDown(DIMOUSE_LEFTBUTTON))
        {
            Menu =true;
        //    StartUI((UIHANDLE**)&startMenu);
        }
    }
    else
    {
        sVertex Veri[4] =
        {
            new_sVertex(x,y,0x44FFFFFF),
            new_sVertex(x+w,y,0x44FFFFFF),
            new_sVertex(x,y+h,0x90000000),
            new_sVertex(x+w,y+h,0x90000000)
        };
        
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
        DrawTexBox(pDevice, startTex, x, y, w, h);
        
    }

    if(noButtons > 0 && butInfo && butInfo[Selected])
    {
        if(butInfo[Selected]->Input)
            butInfo[Selected]->Input->Enable();
        butInfo[Selected]->Show(pDevice);
        DWORD x2 = butInfo[Selected]->bX ,
            y2 =  butInfo[Selected]->bY,
            w2 = butInfo[Selected]->bW ,
            h2 = butInfo[Selected]->bH;
        sVertex Veri[4] =
        {
            new_sVertex(x2,y2,0x34FFFFFF),
            new_sVertex(x2+w2,y2,0x34000000),
            new_sVertex(x2,y2+h2,0x34000000),
            new_sVertex(x2+w2,y2+h2,0x34000000)
        };
        pDevice->SetFVF( sVertex::FVF_Flags  );
        pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Veri,sizeof(sVertex));
    }
    if (Menu) 
    {
        startMenu->bX = 0;
        startMenu->bY = DWORD(scLength - float(scLength* 0.45));
        startMenu->bW = DWORD(scLength* 0.20);
        startMenu->bH = DWORD((scLength -startMenu->bY) - float(scLength* 0.05));
        startMenu->Show(pDevice);

    }
//    DrawBox(pDevice, 0, scLength - DWORD(scLength* 0.05), DWORD(scLength* 0.05), DWORD(scLength* 0.05), 0xF4FfFFFF);
}

D3DHOOK_API void explorer::StartUI(UIHANDLE** obj)
{        
    if( obj != 0)
    {
        butInfo[noButtons] = *obj;    
        AddToStartMenu(obj);
        Selected = noButtons;
        
        noButtons++;    
    }    
}

D3DHOOK_API void explorer::AddToStartMenu(UIHANDLE** obj)
{
    
    if( obj != 0)
    {
        startInfo[startItems] = (*obj);
        startItems++;    
        if (init)
        {
            startMenu->AddButton(obj);
        }
    }
}
VirusTotal - Free Online Virus, Malware and URL Scanner
ugh threw up from that code, btw you're wrong its 1 bit .2 bytes so um you're babies must be deformed and stupid.. kthnxbai

and be4 u flip one, heres some proof http://screensnapr.com/v/psodoC.png (this is from the iltmessage class from the fear sdk) so... unless they're wrong and you're smarter then paid professionals... yeah you might want to rethink how pro you are

p.s ur right i may be wrong about the data type, last type i read a c++ book ( like 2 years ago? ) the non specified data type took on both ranges of signed and unsigned, but like i said its been 2 years so thats a lil fuzzy... can still run circles around ur ass though so i dont really care
Quote Originally Posted by ~FALLEN~ View Post
ugh threw up from that code, btw you're wrong its 1 bit .2 bytes so um you're babies must be deformed and stupid.. kthnxbai

and be4 u flip one, heres some proof View psodoC.png on ScreenSnapr (this is from the iltmessage class from the fear sdk) so... unless they're wrong and you're smarter then paid professionals... yeah you might want to rethink how pro you are

p.s ur right i may be wrong about the data type, last type i read a c++ book ( like 2 years ago? ) the non specified data type took on both ranges of signed and unsigned, but like i said its been 2 years so thats a lil fuzzy... can still run circles around ur ass though so i dont really care
LOL only 1 bit is USED! but it is 8 bits, Are they any 1bit registers? are they and way a computer can process 1bit at a time.

If u look at anything with a hex editor they are all in bytes, not bits, This is why it is 8bits or 1 byte
Quote Originally Posted by topblast View Post


LOL only 1 bit is USED! but it is 8 bits, Are they any 1bit registers? are they and way a computer can process 1bit at a time.

If u look at anything with a hex editor they are all in bytes, not bits, This is why it is 8bits or 1 byte
yeah... and i asked you how many bits are to a bool... 1.. only 1 is in use so therefore it is 1 bit, learn to read... comon dude seriously stop you just look like a tard that doesnt know how to read lol... and it increments as follows 1 byte <- bool, char 2 bytes, short, 4 bytes, int long float, 8 double, 2d vector is 8 bytes, 3d is 12 bytes 4d is 16 bytes and so on and so forth its simple arithmetic dude seriously y r u even trying? like ur menu code is just terrible it looks absolutely fking terrible my menu can port from d3d8 -> d3d9 with a flag in my compiler options, along with the rest of the framework.. im able to switch from game to game with a flag in the compiler options, im able to generate an sdk with another flag.. u kno all that good and fun stuff... my code is highly optimized and p.s i noticed you're using hans font class.. lol and the way you do your prims is just terrible, you do know u could do something like this right
Code:
class cDrawing
{
public:

	#pragma region Interface Objects

	#ifdef D3D9
	IDirect3DDevice9* pDevice;
	#endif

	#ifdef D3D8
	IDirect3DDevice8* pDevice;
	#endif

	ID3DXFont* pFont;
	ID3DXSprite* pSprite;

	#pragma endregion

	#pragma region Drawing Functions

	void SetRenderStates( void );

	void DrawLine( unsigned int x, unsigned int y, unsigned int x2, unsigned int y2, unsigned long color );
	void DrawRect( unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned long color, bool fill);
	void DrawGradient( unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned long color, unsigned long color2 );
	void DrawString( unsigned int x, unsigned int y, const char* text, unsigned long color );

	#pragma endregion

private:

	#pragma region Drawing Structures

	struct LineVertex
	{

		float x, y, z, rhw;
		unsigned long color;

	};

	struct TriVertex
	{

		float x, y, z, h;
		unsigned long color;
		float u,v;

	};

	#pragma endregion

protected:
};
but w/e lol p.p.s i will be adding support for dx 11 later

optimized & clean code.. is great code just sayin'
Quote Originally Posted by ~FALLEN~ View Post
yeah... and i asked you how many bits are to a bool... 1.. only 1 is in use so therefore it is 1 bit, learn to read... comon dude seriously stop you just look like a tard that doesnt know how to read lol... and it increments as follows 1 byte <- bool, char 2 bytes, short, 4 bytes, int long float, 8 double, 2d vector is 8 bytes, 3d is 12 bytes 4d is 16 bytes and so on and so forth its simple arithmetic dude seriously y r u even trying? like ur menu code is just terrible it looks absolutely fking terrible my menu can port from d3d8 -> d3d9 with a flag in my compiler options, along with the rest of the framework.. im able to switch from game to game with a flag in the compiler options, im able to generate an sdk with another flag.. u kno all that good and fun stuff... my code is highly optimized and p.s i noticed you're using hans font class.. lol and the way you do your prims is just terrible, you do know u could do something like this right
Code:
class cDrawing
{
public:

    #pragma region Interface Objects

    #ifdef D3D9
    IDirect3DDevice9* pDevice;
    #endif

    #ifdef D3D8
    IDirect3DDevice8* pDevice;
    #endif

    ID3DXFont* pFont;
    ID3DXSprite* pSprite;

    #pragma endregion

    #pragma region Drawing Functions

    void SetRenderStates( void );

    void DrawLine( unsigned int x, unsigned int y, unsigned int x2, unsigned int y2, unsigned long color );
    void DrawRect( unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned long color, bool fill);
    void DrawGradient( unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned long color, unsigned long color2 );
    void DrawString( unsigned int x, unsigned int y, const char* text, unsigned long color );

    #pragma endregion

private:

    #pragma region Drawing Structures

    struct LineVertex
    {

        float x, y, z, rhw;
        unsigned long color;

    };

    struct TriVertex
    {

        float x, y, z, h;
        unsigned long color;
        float u,v;

    };

    #pragma endregion

protected:
};
but w/e lol p.p.s i will be adding support for dx 11 later

optimized & clean code.. is great code just sayin'
t 03:34 PM ---------- Previous post was at 03:32 PM ----------

i dont have time to be switching around, All the games i hack are directx9, i dont know anygame that still uses directx 8 and my onboard graphics dont support dx10 nor 11

ok, u got me with the reading thing ^^ have fun, but u cant say i am a noob, the thing about programming is to get it done. All my coding start of oh so clean but as i get lazy i start doing stupidness, its fun try it some time.

lol to use this input class, i had to get the HWND from inside the device, took me a whole 10 mins on msdn lol finding the right function researching all the functions. but it was worth it, now i can get the HWND and use a GREAT input class made for games and not windows api
Code:
class CInput
{
public:
                            CInput(DWORD,DWORD);
                            ~CInput(void);
    bool                    InitDirectInput(void);
    bool                    InitKeyboard(void);
    bool                    InitMouse(void);
    bool                    Update(void);

    bool                    KeyPressed(int);

    void                    DrawCursor(void);
    void                    SetCursor(const char*,int,int,DWORD);
    void                    SetAttributes(bool,float);
    void                    SetCursorPosition(float,float);
    void                    Disable();
    void                    Enable();
    void                    UpdateDevice(LPDIRECT3DDEVICE9);

    float                    GetRelativeX(void);
    float                    GetRelativeY(void);
    float                    GetRelativeZ(void);
    float                    GetAbsoluteX(void);
    float                    GetAbsoluteY(void);

    long                    GetWindowsX(void);
    long                    GetWindowsY(void);

    bool                    MouseButtonDown(int);
    bool                    IsEnable(void);
    bool                    IsMouseHere(int,int,int,int);

private:
    HWND                    wHandle;    
    RECT                    winPosi;
    LPDIRECT3DDEVICE9        m_pDevice;
    LPDIRECTINPUT8            m_pDIObject;
    LPDIRECTINPUTDEVICE8    m_pDIKeyboardDevice;
    LPDIRECTINPUTDEVICE8    m_pDIMouseDevice;

    char                    m_KeyBuffer[256];

    LPDIRECT3DTEXTURE9        m_pCursorTexture;
    DIMOUSESTATE2            m_MouseState;
    bool                    m_bInverted, m_enable;
    POINT                    mp;
    float                    m_fSensitivity,
                            m_fCursorX,
                            m_fCursorY;
    int                        m_iHotSpotX,
                            m_iHotSpotY;
    DWORD                    m_dwAxes,
                            m_dwButtons,
                            m_dwCursorColor,
                            m_dwScreenWidth,
                            m_dwScreenHeight;
};
Quote Originally Posted by topblast View Post

i dont have time to be switching around, All the games i hack are directx9, i dont know anygame that still uses directx 8 and my onboard graphics dont support dx10 nor 11

ok, u got me with the reading thing ^^ have fun, but u cant say i am a noob, the thing about programming is to get it done. All my coding start of oh so clean but as i get lazy i start doing stupidness, its fun try it some time.
Code:
class CInput
{
public:
							CInput(DWORD,DWORD);
							~CInput(void);
	bool					InitDirectInput(void);
	bool					InitKeyboard(void);
	bool					InitMouse(void);
	bool					Update(void);

	bool					KeyPressed(int);

	void					DrawCursor(void);
	void					SetCursor(const char*,int,int,DWORD);
	void					SetAttributes(bool,float);
	void					SetCursorPosition(float,float);
	void					Disable();
	void					Enable();
	void					UpdateDevice(LPDIRECT3DDEVICE9);

	float					GetRelativeX(void);
	float					GetRelativeY(void);
	float					GetRelativeZ(void);
	float					GetAbsoluteX(void);
	float					GetAbsoluteY(void);

	long					GetWindowsX(void);
	long					GetWindowsY(void);

	bool					MouseButtonDown(int);
	bool					IsEnable(void);
	bool					IsMouseHere(int,int,int,int);

private:
	HWND					wHandle;	
	RECT					winPosi;
	LPDIRECT3DDEVICE9		m_pDevice;
	LPDIRECTINPUT8			m_pDIObject;
	LPDIRECTINPUTDEVICE8	m_pDIKeyboardDevice;
	LPDIRECTINPUTDEVICE8	m_pDIMouseDevice;

	char					m_KeyBuffer[256];

	LPDIRECT3DTEXTURE9		m_pCursorTexture;
	DIMOUSESTATE2			m_MouseState;
	bool					m_bInverted, m_enable;
	POINT					mp;
	float					m_fSensitivity,
							m_fCursorX,
							m_fCursorY;
	int						m_iHotSpotX,
							m_iHotSpotY;
	DWORD					m_dwAxes,
							m_dwButtons,
							m_dwCursorColor,
							m_dwScreenWidth,
							m_dwScreenHeight;
};


---------- Post added at 03:34 PM ---------- Previous post was at 03:32 PM ----------

i dont have time to be switching around, All the games i hack are directx9, i dont know anygame that still uses directx 8 and my onboard graphics dont support dx10 nor 11

ok, u got me with the reading thing ^^ have fun, but u cant say i am a noob, the thing about programming is to get it done. All my coding start of oh so clean but as i get lazy i start doing stupidness, its fun try it some time.

lol to use this input class, i had to get the HWND from inside the device, took me a whole 10 mins on msdn lol finding the right function researching all the functions. but it was worth it, now i can get the HWND and use a GREAT input class made for games and not windows api
Code:
class CInput
{
public:
							CInput(DWORD,DWORD);
							~CInput(void);
	bool					InitDirectInput(void);
	bool					InitKeyboard(void);
	bool					InitMouse(void);
	bool					Update(void);

	bool					KeyPressed(int);

	void					DrawCursor(void);
	void					SetCursor(const char*,int,int,DWORD);
	void					SetAttributes(bool,float);
	void					SetCursorPosition(float,float);
	void					Disable();
	void					Enable();
	void					UpdateDevice(LPDIRECT3DDEVICE9);

	float					GetRelativeX(void);
	float					GetRelativeY(void);
	float					GetRelativeZ(void);
	float					GetAbsoluteX(void);
	float					GetAbsoluteY(void);

	long					GetWindowsX(void);
	long					GetWindowsY(void);

	bool					MouseButtonDown(int);
	bool					IsEnable(void);
	bool					IsMouseHere(int,int,int,int);

private:
	HWND					wHandle;	
	RECT					winPosi;
	LPDIRECT3DDEVICE9		m_pDevice;
	LPDIRECTINPUT8			m_pDIObject;
	LPDIRECTINPUTDEVICE8	m_pDIKeyboardDevice;
	LPDIRECTINPUTDEVICE8	m_pDIMouseDevice;

	char					m_KeyBuffer[256];

	LPDIRECT3DTEXTURE9		m_pCursorTexture;
	DIMOUSESTATE2			m_MouseState;
	bool					m_bInverted, m_enable;
	POINT					mp;
	float					m_fSensitivity,
							m_fCursorX,
							m_fCursorY;
	int						m_iHotSpotX,
							m_iHotSpotY;
	DWORD					m_dwAxes,
							m_dwButtons,
							m_dwCursorColor,
							m_dwScreenWidth,
							m_dwScreenHeight;
};
[/SIZE][/COLOR][/FONT]
yeah... I went a bit overboard you really aren't a nub, so sorry bout that.. and i get ya like theres times i dont even code cuz im in a fkit mode, but then i binge code for like a week straight lol, anyways.. check ur pms in a second
Menu/File is clean, Approved.
this fight is over
Quote Originally Posted by DaRk View Post
this fight is over

IT WAS FUN
Quote Originally Posted by topblast View Post



IT WAS FUN
Ahaha lol xD
Quote Originally Posted by DaRk View Post
this fight is over
yea lol
they were fighting in another thread too
Quote Originally Posted by giniyat101 View Post
yea lol
they were fighting in another thread too
O.o Where?? i enjoyed as a comic Book ...jk...jk
Posts 31–45 of 60 · Page 3 of 4
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us