Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › Jetamay's D3D Form Class

Jetamay's D3D Form Class

Posts 1–15 of 17 · Page 1 of 2
radnomguywfq3
radnomguywfq3
Jetamay's D3D Form Class
A class programmed by me(Jetamay) to render and manage forms in a D3D environment. When you make use of this class, please credit me.

Download + Project information & license :
http://code.google.com/p/jetatect-d3d-gui-creator/

Library can be downloaded in attachments. The header is here :
[php]#pragma once
#include "d3d9.h"
#include "d3dx9.h"


#define CONTROL_APPEND_TEXT 0x00000001
#define CONTROL_SET_TEXT 0x00000002
#define CONTROL_GET_TEXT 0x00000003
#define CONTROL_BUTTON_PRESS 0x00000004
#define GAME_ROOTDIR(pCharBuffer, len) GetCurrentDirectoryA(len, pCharBuffer)

typedef void (*FORMCALLBACK)(DWORD command, DWORD param1, DWORD param2); //P1 form name, p2 command
enum ControlType{Textbox = 1, Button = 2, Caption = 3, Password = 4};

struct Control {
RECT bounds; //LEAVE NULL ON INIT, SET WHEN RENDERED;
DWORD Command;

char name[300];
char text[300];
bool enabled;
int x, y;
int type;
};
class CForm {
private:
int hoverControlIndex, activeControlIndex;
int x, y, mouseX, mouseY;
int numControls;

Control controls[100];
LPDIRECT3DTEXTURE9 formTexture;
LPD3DXFONT d3dFont;

void SetText(int index, char* source);
void AppendText(int index, char* text);

bool NameInUse(char* name);
char* GetText(int index);
int GetControlIndex(char* name);
FORMCALLBACK formCallback;
public:
char name[300];
CForm(FORMCALLBACK callback, char* objName, int formX, int formY, char* bgrLocalDir, LPDIRECT3DDEVICE9 d3ddev, LPD3DXFONT font);
int CreateControl(char* name, char* text, int type, float x, float y, DWORD Command = 0, bool enabled = true);
void ProcessMouse(POINT* mousePos, bool leftDown);
void ProcessKey(char key);
void Callback(DWORD Command, DWORD param1, DWORD param2);
void MoveBy(int x, int y);
void MoveTo(int posX, int posY);
void Render(LPD3DXSPRITE d3dSprite);
void Update();
~CForm();
};[/php]Class Information :

CForm(Constructor)
Parameters
callback :
Pointer to callback method, read more in callback methods section
objName :
Parameter is useless without the CFormManager class, which will be posted in a couple hours. Use to name the form object, set to NULL if you're not using a method to manage numerous forms, or plan to use a different system to identify them.
formX :
Form's default X position to render all controls and the form itself. Control structure contains offset X cords to this number. Thus the X cords in the Control structure are relative to the form's X position.
formY :
Form's default Y position to render all controls and the form itself. Control structure contains offset Y cords to this number. Thus the Y cords in the Control structure are relative to the form's Y position.
bgrLocalDir :
Pointer to a string which is null terminated. This string is used to load the background of the form. This only works locally. E.X, if the executable is placed in C:\program\program.exe and you pass "\\background.png" the class will load the image at C:\Program\Background.png. Be sure to include the \ character.
d3ddev :
A pointer to an initialized D3D Device.
font :
A pointer to a d3d font interface.
Description :
This is the constructor for the CForm class. It will initialize the private members needed to create controls and render the form. This must be called.
CreateControl
Parameters
name :
Controls name. You use this to modify it's properties using the built in callback. Refer to Callback information section.
text :
Text of Control. This can be the caption of a button, label, or default text in a textbox & password textbox.
type :
Refer to the ControlType enumerator defined in the CForm header. Specifies which kind of control you wish to create it as.
x :
Controls x position which is relative to the forms X position.
y :
Controls y position which is relative to the forms y position.
Command :
DWORD that specified the controls command code, read callback section for more information on this parameter.
Enabled :
Useless without CGUIManager class. More description on this paremeter will be posted at later time. For now ignore, and allow the compile set it to true, or set it to true yourself.
Description :
Creates a desired control for the form. This form will then be rendered when the render method within the class is called.

ProcessKey
Parameters
key :
Key which was pressed to be processed. '%' character will cause a deletion of the last character.
Description :
Processes a given key. This can cause several actions to occur depending on the active control. It may sometimes be ignored.
Callback
Parameters
Read callback section of this post for information on these parameters.
Description :
Read callback section of this post for information on these parameters.
MoveBy
Parameters
x :
Amount to change X coordination by.
y :
Amount to change Y coordination by.
Description :
Moves forms XY coordinations by a desired amount.
MoveTo
Parameters
x :
Set X coordination.
y :
Set Y coordination.
Description :
Moves forms XY coordinations to a desired position.
Render
Parameters
d3dSprite :
Pointer to initialized sprite interface.
Description :
Renders form.
Update
Ignore, useless without CGUIManager.

Callback Methods
A callback method has three parameters, the first is generally the command or the name of an object. Here's an example callback I write that should explain everything you need to know about them.
Form Init :
[php] mainForm = new CForm(FormCallback, "Form1",0,0, "FormDatatexturesdefaultForm.PNG", pd3ddev, d3dFont);
mainForm->CreateControl("cap1", "Login Window", Caption, 5, 5, 0);
mainForm->CreateControl("cap2", "Username:", Caption, 100, 80, 0);
mainForm->CreateControl("cap3", "Password:", Caption, 100, 110, 0);
mainForm->CreateControl("txtUsername", "Insert Username", Textbox, 170, 80, 0);
mainForm->CreateControl("txtPassword", "Insert Password", Password, 170, 110, 0);
mainForm->CreateControl("btnSubmit", "Submit", Button, 230, 130, BTN_SUBMIT);
mainForm->CreateControl("btnTwo", "Quit", Button, 300, 130, BTN_QUIT);
[/php]Callback :
[php]
void FormCallback(DWORD command, DWORD p1, DWORD p2) {
if(command == CONTROL_BUTTON_PRESS) {
if(!strcmp(mainForm->name, (char*)p1)) {
switch(p2) {
case BTN_QUIT:
tinit();
break;
case BTN_SUBMIT:
break;
}
}

}
}[/php]

Built-in callback :
[php]
Callback(DWORD Command, DWORD param1, DWORD param2) {
switch(Command) {
case CONTROL_APPEND_TEXT:
AppendText(GetControlIndex((char*)param1), (char*) param2);
break;
case CONTROL_GET_TEXT:
memcpy((void*)param2,
(void*)GetText(GetControlIndex((char*)param1)),
4);
break;
case CONTROL_SET_TEXT:
SetText(GetControlIndex((char*)param1), (char*) param2);
break;
case CONTROL_BUTTON_PRESS:
formCallback(CONTROL_BUTTON_PRESS, (DWORD)this->name, (DWORD)param1);
break;
}
}

[/php]
#1 · edited 17y ago · 17y ago
arunforce
[MPGH]arunforce
:O

What kinda licensing does it have?
#2 · 17y ago
radnomguywfq3
radnomguywfq3
Download + Project information & license : jetatect-d3d-gui-creator - Google Code
#3 · 17y ago
MA
mastergeorge
If only I got this..
#4 · 17y ago
DjFunky
DjFunky
It is scripted wrongly. It takes to long... :s
#5 · 17y ago
radnomguywfq3
radnomguywfq3
Scripted wrongly? Wtf you talkin about boi? There is no scripting in this.
#6 · 17y ago
supernova2131
supernova2131
Quote Originally Posted by DjFunky View Post
It is scripted wrongly. It takes to long... :s
Dude you need patience to code =@
#7 · 17y ago
BO
bobyjoeson
Quote Originally Posted by supernova2131 View Post
Dude you need patience to code =@
PATIENCE!
well this is off my to do list
#8 · 16y ago
Thats the way it is
Thats the way it is
Link not working anymore + It says download is in attachment but there are no attachments ?
#9 · 16y ago
radnomguywfq3
radnomguywfq3
Sorry guys, I deleted that project from my computer a looooong time ago. It didn't take long to write though. I'll look at it a little later.
#10 · 16y ago
why06
why06
Weird I could have swore it was included one sec... Nope I didn't save it anywhere I can find... oh well. =/
#11 · 16y ago
HA
HazXoD3D
i have heard that people have done D3D menus in C++ with GUI o.O
its looks like you base is GUI but still not ?!

I have search google but i htink i have found it but im to newbie

Is there any SIMPLE base?, that is just a nav funchion, and the draw funchion just that just its a box and 3,4 rows of items.
#12 · 16y ago
crushed
crushed
Didn't this used to be stickied? O_o
#13 · 16y ago
Void
Void
Quote Originally Posted by crushed View Post
Didn't this used to be stickied? O_o
"Used to be"
#14 · 16y ago
crushed
crushed
Quote Originally Posted by Davidm44 View Post
"Used to be"
Then...why is unstickied now? ._.;;
I don't know, but I feel this is important?!
#15 · 16y ago
Posts 1–15 of 17 · Page 1 of 2

Post a Reply

Similar Threads

  • D3D Sprite ClassBy radnomguywfq3 in C++/C Programming
    0Last post 17y ago
  • [Tutorial]Change class without respawnBy vir2000 in Game Hacking Tutorials
    0Last post 20y ago
  • [Help] D3DBy SpiderByte in WarRock - International Hacks
    7Last post 20y ago
  • Guild Wars New ClassesBy Chronologix in General Gaming
    24Last post 20y ago
  • Heavy Weapons Class mine bug. I had no idea.By NukeAssault in General Gaming
    2Last post 20y ago

Tags for this Thread

#class#d3d#form#jetamay