Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


New to C++

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NuclearPowered
Master Cheater
Reputation: 0

Joined: 30 Dec 2007
Posts: 345

PostPosted: Thu Jan 31, 2008 10:36 am    Post subject: New to C++ Reply with quote

I'm new to C++, I borrowed this C++ book from a friend but I know now that just going through the whole book isnt gonna teach me alot coz Ill forget alot anyway, it's better to just make program's and you'll learn from that, but the book doesnt explain how to make a graphics interfaced program, instead of just calculations through the console...
I just need a window and add some buttons to it which WriteProcessMemory.
Any tuts on that?
Thanks in advance.
Back to top
View user's profile Send private message
Losplagos
Expert Cheater
Reputation: 0

Joined: 21 Mar 2006
Posts: 172
Location: Knee deep in a c++ book

PostPosted: Thu Jan 31, 2008 10:42 am    Post subject: Reply with quote

Learn the basics first. For a basic window your using quite alot.
Code:

#include <windows.h>

const char g_szClassName[] = "myWindowClass";

// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    WNDCLASSEX wc;
    HWND hwnd;
    MSG Msg;

    //Step 1: Registering the Window Class
    wc.cbSize        = sizeof(WNDCLASSEX);
    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = g_szClassName;
    wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&wc))
    {
        MessageBox(NULL, "Window Registration Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    // Step 2: Creating the Window
    hwnd = CreateWindowEx(
        WS_EX_CLIENTEDGE,
        g_szClassName,
        "The title of my window",
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
        NULL, NULL, hInstance, NULL);

    if(hwnd == NULL)
    {
        MessageBox(NULL, "Window Creation Failed!", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

    // Step 3: The Message Loop
    while(GetMessage(&Msg, NULL, 0, 0) > 0)
    {
        TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }
    return Msg.wParam;
}

I got this code from this site's tutorial http://www.winprog.org/tutorial/simple_window.html

And remember learn the standard c++ then move to the windows api.

_________________

Earthbound = 31337
Back to top
View user's profile Send private message
Hans Henrik
Expert Cheater
Reputation: 0

Joined: 18 Feb 2007
Posts: 178

PostPosted: Thu Jan 31, 2008 10:43 am    Post subject: Reply with quote

lots of examples on Google Razz

btw, your not from Nuclear Winter Crew, are ya?

_________________
Im not around.

im almost never checking the forum anymore
Back to top
View user's profile Send private message MSN Messenger
NuclearPowered
Master Cheater
Reputation: 0

Joined: 30 Dec 2007
Posts: 345

PostPosted: Thu Jan 31, 2008 10:44 am    Post subject: Reply with quote

Nope.
I was formally known as Nuclear898 on this forum till I got banned.
Thanks for helping Very Happy
Back to top
View user's profile Send private message
Losplagos
Expert Cheater
Reputation: 0

Joined: 21 Mar 2006
Posts: 172
Location: Knee deep in a c++ book

PostPosted: Thu Jan 31, 2008 10:45 am    Post subject: Reply with quote

If your really going to learn c++ then Sams teach yourself c++ in 21 days is a good book.
_________________

Earthbound = 31337
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jan 31, 2008 10:46 am    Post subject: Reply with quote

if your gonna do C++ you learn functional programming.

if you want easy drag and drop gui's then you learn C#.NET

For C++ there is .NET but i dont recomend using that since C# is just right there.

theForger's Win32 API Tutorial:
http://www.winprog.org/tutorial/

Edit: haha, i missed like eveyrones post cuz i got distractd and never hit submit until like 5 minutes later loll

_________________
Back to top
View user's profile Send private message
Losplagos
Expert Cheater
Reputation: 0

Joined: 21 Mar 2006
Posts: 172
Location: Knee deep in a c++ book

PostPosted: Thu Jan 31, 2008 11:20 am    Post subject: Reply with quote

Vc++ 08 hates theForgers winapi tutorial!!

Quote:

error C2440: '=' : cannot convert from 'const char [14]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [28]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [14]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [24]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

_________________

Earthbound = 31337
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jan 31, 2008 11:35 am    Post subject: Reply with quote

nope, you just dont know how to define text as UNICODE Wink

see unless you change your project settings to "Use Multi-byte charecter set" you MUST add 1 of the 3 below because you are using UNICODE

1. an L before the string
Example: L"Hi My Name is Lurc"

2. defining it using TEXT
Example: TEXT("Hi My Name is Lurc")

3. Including tchar.h and then using _T (same as TEXT but shorter and neater)
Example: _T("Hi My Name is Lurc")

_________________


Last edited by lurc on Thu Jan 31, 2008 12:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Jan 31, 2008 12:30 pm    Post subject: Reply with quote

lurc wrote:
if you want easy drag and drop gui's then you learn C#.NET


dialogs. Smile

those tutorials go over them at some point.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Thu Jan 31, 2008 1:09 pm    Post subject: Reply with quote

yes dialogs are there for C++ but im talking EASY.

even using dialogs needs a bit of knowledge about what your doing, with C# its drag and drop, double click for event, etc. its simple and you can learn quickly since eveyrthings basically already given to u.

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Jan 31, 2008 6:07 pm    Post subject: Reply with quote

NuclearPowered wrote:
Nope.
I was formally known as Nuclear898 on this forum till I got banned.
Thanks for helping Very Happy


Probably because on one of your other 6 names you have registered under the same IP, you broke the rules of one the other sections. Wink

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites