D3D9 Menu

Posts 1–9 of 9 · Page 1 of 1
D3D9 Menu
Just thought I'd help out, so gonna post some snippets of some menu coding. Maybe It'll get you started..

Entry point: //always need it
Code:
//entry point
BOOL APIENTRY DllMain( HMODULE hModule,
					  DWORD dreason_for_call,
					  LPVOID lpReserved)
{
	return 0;
}
Some structs for the menu
Code:
struct items{
int firstitem;
int seconditem;
}; items Items;

//menu properties
struct menu{
	char *title;
	int x;
	int y;
	int width;
	int height;
	int maxitems;
}; menu Menu; // can refer to it by menu or Menu ;)
Setting your menu
Code:
void SetMenu(int x,int y, int width, int height, int maxitems, char* title)
{
	Menu.title = "D3D Menu Test";
	Menu.x = 10;
	Menu.y = 70;
	Menu.width = width;
	Menu.height = height;
	Menu.maxitems = 12;
}
Setting menu hotkeys:
Code:
void SetHotkeys(){
if(highlight[1] == 1 && (GetAsyncKeyState(VK_RIGHT)&1)) if(Items.firstitem <= 1){Items.firstitem++;}
	if(highlight[1] == 1 && (GetAsyncKeyState(VK_LEFT)&1)) if(Items.firstitem != 0){Items.firstitem--;}
	if(Items.firstitem>1)Items.firstitem=0;
}
Thats all I'm posting for now, Not posting how to render the menu, DrawStrings, Setting maximum highlights. etc.
I may later. Who knows.
Just thought It might help.
Have fun.

EDIT: Some D3D colors.
Code:
GenerateTexture(Device_Interface, &texGreen , D3DCOLOR_ARGB(255,0,255,0));
GenerateTexture(Device_Interface, &texRed , D3DCOLOR_ARGB(255,255,0,0));
GenerateTexture(Device_Interface, &texBlue , D3DCOLOR_ARGB(255,0,0,255));
GenerateTexture(Device_Interface, &texOrange , D3DCOLOR_ARGB(255,255,165,0));
GenerateTexture(Device_Interface, &texYellow , D3DCOLOR_ARGB(255,255,255,0));
GenerateTexture(Device_Interface, &texPink , D3DCOLOR_ARGB(255,255,192,203));
GenerateTexture(Device_Interface, &texCyan , D3DCOLOR_ARGB(255,0,255,255));
GenerateTexture(Device_Interface, &texPurple , D3DCOLOR_ARGB(255,160,32,240));
GenerateTexture(Device_Interface, &texBlack , D3DCOLOR_ARGB(255,0,0,0));
GenerateTexture(Device_Interface, &texWhite , D3DCOLOR_ARGB(255,255,255,255));
GenerateTexture(Device_Interface, &texSteelBlue , D3DCOLOR_ARGB(255,33,104,140));
GenerateTexture(Device_Interface, &texLightSteelBlue, D3DCOLOR_ARGB(255,201,255,255));
GenerateTexture(Device_Interface, &texLightBlue , D3DCOLOR_ARGB(255,26,140,306));
GenerateTexture(Device_Interface, &texSalmon , D3DCOLOR_ARGB(255,196,112,112));
GenerateTexture(Device_Interface, &texBrown , D3DCOLOR_ARGB(255,168,99,20));
GenerateTexture(Device_Interface, &texTeal , D3DCOLOR_ARGB(255,38,140,140));
GenerateTexture(Device_Interface, &texLime , D3DCOLOR_ARGB(255,50,205,50));
GenerateTexture(Device_Interface, &texElectricLime , D3DCOLOR_ARGB(255,204,255,0));
GenerateTexture(Device_Interface, &texGold , D3DCOLOR_ARGB(255,255, 215, 0));
GenerateTexture(Device_Interface, &texOrangeRed , D3DCOLOR_ARGB(255,255,69,0));
GenerateTexture(Device_Interface, &texGreenYellow , D3DCOLOR_ARGB(255,173,255,47));
GenerateTexture(Device_Interface, &texAquaMarine , D3DCOLOR_ARGB(255,127,255,212));
GenerateTexture(Device_Interface, &texSkyBlue , D3DCOLOR_ARGB(255,0,191,255));
GenerateTexture(Device_Interface, &texSlateBlue , D3DCOLOR_ARGB(255,132, 112, 255));
GenerateTexture(Device_Interface, &texCrimson , D3DCOLOR_ARGB(255,220,20,60));
GenerateTexture(Device_Interface, &texDarkOliveGreen, D3DCOLOR_ARGB(255,188,238,104 ));
GenerateTexture(Device_Interface, &texPaleGreen , D3DCOLOR_ARGB(255,154,255, 154));
GenerateTexture(Device_Interface, &texDarkGoldenRod , D3DCOLOR_ARGB(255,255, 185, 15 ));
GenerateTexture(Device_Interface, &texFireBrick , D3DCOLOR_ARGB(255,255,48,48));
GenerateTexture(Device_Interface, &texDarkBlue , D3DCOLOR_ARGB(255,0,0,204));
GenerateTexture(Device_Interface, &texDarkerBlue , D3DCOLOR_ARGB(255,0,0,153));
GenerateTexture(Device_Interface, &texDarkYellow , D3DCOLOR_ARGB(255,255,204,0));
GenerateTexture(Device_Interface, &texLightYellow , D3DCOLOR_ARGB(255,255,255,153));
Some pretty good colors, once again. Have fun.
How'd you learn this so fast?
xD Im a quick learner.
A lot of people use the Drawstring method to make menus, but you can make boxes and such too, it just really left up to your imagination. Since once ur .dll is injected if you have a pointer to the d3ddevice you can do anything you want. And correct me if Im wrong, but you don't exactly need one. I think you can just create ur own device. Im not sure if ur allowed to have two. Anyway. just take a look at shadow's base. He has a menu struct in there.
Yeah you can create boxes. Etc
DrawRect
Use it as bg.
I like D3D Because theres so many options.
But did this help anybody?
EDIT:
Congrats Why06
Should be able to run multiple D3D devices, not sure how well they're able to stack up on top of eachother tho
I one logged in on 12 rose online accounts from my PC, it didnt even lag very badly ;D
this is awesome man keep it up!
Mhm.
I'm not so good with 'detours', or bypass's. Nor Do I have any addies for a D3D9 Game. (Bypass wise)
So atm, It's pretty useless. :\
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?