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 › Win32 Api Class [In Devolopment]

Win32 Api Class [In Devolopment]

Posts 1–15 of 16 · Page 1 of 2
zhaoyun333
zhaoyun333
Win32 Api Class [In Devolopment]
Hey MPGH C++ Coders!

I know Win32 API is really hard to get the hang of so I have been working a project that uses a class for the win32 api. What is win32 api? It is the stuff you use to make on of those fancy windows not those black console screens. Here is some exemplar code of how you will be able to use the class:

Code:
#include "menu.h"
#include <stdio.h>

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, 
				   LPSTR lpCmdLine, int nCmdShow){

Menu testMenu(200,200,300,500,"rofl");
testMenu.AddButton(25,25,200,25,"button");
testMenu.Show(1);

while(testMenu.Run()){
        if(testMenu.GetButton()==0)
MessageBox(NULL,"buttonclicked","buttonclicked",MB_OK);
}
return 0;
}
[IMG]http://i344.photobucke*****m/albums/p349/zhaoyun3/test.jpg[/IMG]
#1 · edited 16y ago · 16y ago
Liz
[MPGH]Liz
oh hai Zhaoyun, havent seen u in 4ever.
#2 · 16y ago
zhaoyun333
zhaoyun333
yeah i know ive been elsewhere
#3 · 16y ago
MO
monkey32's_backup
;D Could be helpful.
#4 · 16y ago
zhaoyun333
zhaoyun333
Im sorry...COULD BE? Normally this code would take 200 lines.
#5 · 16y ago
XG
XGelite
Quote Originally Posted by zhaoyun333 View Post
Im sorry...COULD BE? Normally this code would take 200 lines.
that 200 lines way is not the normal way anymore -.- ... its old way ; )
#6 · 16y ago
zhaoyun333
zhaoyun333
So whats the new way?
#7 · 16y ago
Matrix_NEO006
Matrix_NEO006
not my code
Code:
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>

// Global variables

// The main window class name.
static TCHAR szWindowClass[] = _T("win32app");

// The string that appears in the application's title bar.
static TCHAR szTitle[] = _T("Win32 Guided Tour Application");

HINSTANCE hInst;

// Forward declarations of functions included in this code module:
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow)
{
    WNDCLASSEX wcex;

    wcex.cbSize = sizeof(WNDCLASSEX);
    wcex.style          = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc    = WndProc;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
    wcex.hIcon          = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
    wcex.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+3);
    wcex.lpszMenuName   = NULL;
    wcex.lpszClassName  = szWindowClass;
    wcex.hIconSm        = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));

    if (!RegisterClassEx(&wcex))
    {
        MessageBox(NULL,
            _T("Call to RegisterClassEx failed!"),
            _T("Win32 Guided Tour"),
            NULL);

        return 1;
    }

    hInst = hInstance; // Store instance handle in our global variable

    // The parameters to CreateWindow explained:
    // szWindowClass: the name of the application
    // szTitle: the text that appears in the title bar
    // WS_OVERLAPPEDWINDOW: the type of window to create
    // CW_USEDEFAULT, CW_USEDEFAULT: initial position (x, y)
    // 500, 100: initial size (width, length)
    // NULL: the parent of this window
    // NULL: this application dows not have a menu bar
    // hInstance: the first parameter from WinMain
    // NULL: not used in this application
    HWND hWnd = CreateWindow(
        szWindowClass,
        szTitle,
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT,
        800, 600,
        NULL,
        NULL,
        hInstance,
        NULL
    );

    if (!hWnd)
    {
        MessageBox(NULL,
            _T("Call to CreateWindow failed!"),
            _T("Win32 Guided Tour"),
            NULL);

        return 1;
    }

    // The parameters to ShowWindow explained:
    // hWnd: the value returned from CreateWindow
    // nCmdShow: the fourth parameter from WinMain
    ShowWindow(hWnd,
        nCmdShow);
    UpdateWindow(hWnd);

    // Main message loop:
    MSG msg;
    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return (int) msg.wParam;
}

//
//  FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
//  PURPOSE:  Processes messages for the main window.
//
//  WM_PAINT    - Paint the main window
//  WM_DESTROY  - post a quit message and return
//
//
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    PAINTSTRUCT ps;
    HDC hdc;
    TCHAR greeting[] = _T("Hello, World!");

    switch (message)
    {
    case WM_PAINT:
        hdc = BeginPaint(hWnd, &ps);

        // Here your application is laid out.
        // For this introduction, we just print out "Hello, World!"
        // in the top left corner.
        TextOut(hdc,
            5, 5,
            greeting, _***len(greeting));
        // End application-specific layout section.

        EndPaint(hWnd, &ps);
        break;
    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
        break;
    }

    return 0;
}
#8 · 16y ago
ZE
zeco
Yep that's only 140 lines =D

Either-way, this API isn't something i'm likely to use cause i like the the hard way better.
#9 · 16y ago
zhaoyun333
zhaoyun333
Quote Originally Posted by zeco View Post
Yep that's only 140 lines =D

Either-way, this API isn't something i'm likely to use cause i like the the hard way better.
Buuuuuuuuut its sooooo much easier
#10 · 16y ago
ZE
zeco
Quote Originally Posted by zhaoyun333 View Post
Buuuuuuuuut its sooooo much easier
Yeah but the easy way isn't as fun or rewarding >_> . Plus what if i want do something outside the scope of your API <_< Then i would be left high and dry
#11 · 16y ago
XG
XGelite
or why cant you just use VC++ and just make all the windows and buttons and stuff by drag in and dropping like you do in VB. its a whole lot easier -.- why waist time coding that stuff when you could be spending the time on the program itself? unless your doing d3d then thers no point...
but im learning d3d right now and you have to do it the long/hard way -.- ... so i guess there is a point..lol :P
#12 · 16y ago
zhaoyun333
zhaoyun333
i have the express edition so I cant rly use it, besides i like actually coding it not like the VB stuff
#13 · 16y ago
ZE
zeco
Actually for writing gui's in windows you could use other API's like QT. It comes with a designer that allows you to do the drag and drop stuff. Though i ended up having to do most of the work anyway. I've only ever written on GUI actually. Well besides when i started learning win32 but what i wrote is too useless to be called a gui.
#14 · 16y ago
why06
why06
Well, I'm not sure exactly what your wrapper does, but It might be nice to use, for somethings, or for people who want to create Windows in C++, but don't yet know the API...

You know what would be real nice? If you wrapped up the WinMain for them, in your class so they wouldn't have to worry about it.
#15 · 16y ago
Posts 1–15 of 16 · Page 1 of 2

Post a Reply

Similar Threads

  • Fail API wrapper class, I need criticism..By Void in C++/C Programming
    12Last post 16y ago
  • [Tutorial]Change class without respawnBy vir2000 in Game Hacking Tutorials
    0Last post 20y ago
  • Guild Wars New ClassesBy Chronologix in General Gaming
    24Last post 20y ago
  • Not a valid win32 applicationBy terence in General Game Hacking
    1Last 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

#api#class#devolopment#win32