Windows API is hard!!!!!

Posts 1–3 of 3 · Page 1 of 1
Windows API is hard!!!!!
And I thought learning the C++ syntax was the hard part. I spend months and months perfecting my syntax in C++ and now when I finally can start on the Windows API it completely rapes me from every possible direction. I mean COME ON! The first and easiest program you can ever make in the Windows API was introduced in a book, and I was completely blank on how it worked and why it worked at all. I mean seriously... And then later in the book the author even tells you it's normal to copy & paste code in Windows API, because you're not supposed to understand the syntax fully. WTF?! If you aren't supposed to understand how to write a program that opens a window through the API, why am I even wasting my time trying to learn it?


Sorry for this kind of rage thread. It's just that I am kind of frustrated how different it is from C++ syntax. Did I basicly perfect my C++ syntax for nothing? I won't be able to use it when hacking? Is the Windows API syntax completely different from C++?

I am wondering if games programming is actually easier than WIN32 programming. Is it?
Game programming will more than likely use some Windows API sooner or later. You wont avoid using it entirely. It is needed in a lot of cases so you are best off taking the time to learn it. You don't need to learn every single API in existance, just learn how to understand reading them. Learn how to understand the parameters that each can use, the difference between a referenced parameter, in/out values, etc.

You don't need to be able to write own every API from memory, but just grasp how to use them and the rest will come easy.

Check my post here:
http://www.mpgh.net/forum/31-c-c-pro...ml#post8170938
Quote Originally Posted by Kalist View Post
And I thought learning the C++ syntax was the hard part. I spend months and months perfecting my syntax in C++ and now when I finally can start on the Windows API it completely rapes me from every possible direction. I mean COME ON! The first and easiest program you can ever make in the Windows API was introduced in a book, and I was completely blank on how it worked and why it worked at all. I mean seriously... And then later in the book the author even tells you it's normal to copy & paste code in Windows API, because you're not supposed to understand the syntax fully. WTF?! If you aren't supposed to understand how to write a program that opens a window through the API, why am I even wasting my time trying to learn it?


Sorry for this kind of rage thread. It's just that I am kind of frustrated how different it is from C++ syntax. Did I basicly perfect my C++ syntax for nothing? I won't be able to use it when hacking? Is the Windows API syntax completely different from C++?

I am wondering if games programming is actually easier than WIN32 programming. Is it?
I don't see how it differs syntactically from C++ in the slightest...it's a C++ API.

When you're learning to use any API (Win32, generic Windows, Direct3D... or any third party library in general), it takes time to get used to the new functions and how to use them. It's just the way it is. Particularly large behemoths like Win32 will really take some time to get your head around, but when you consider how much of the work is being abstracted for you; it could be worse. If you think the Win32 API is hard, wait until you try Direct3D haha.

If you don't want to write raw Win32 to create complicated forms (and who would, honestly?), you can try the .NET framework which further abstracts the Win32 API and makes it a lot easier to get off the ground with GUI programs running under Windows,.

If you're writing an injectable hack designed to run inside of the victim processes address space, you don't need to know much of the Win32 API to begin with. You're not creating a form (unless you are, but it's not really that common), you're just getting into their process space and generally wreaking havoc on their memory.

Code:
#include <Windows.h>

BOOL APIENTRY DllMain(HMODULE hSelf, DWORD dwReason, LPVOID lpReserved) {
    switch(dwReason) {
    case DLL_PROCESS_ATTACH:
        MessageBoxW(NULL, L"Omg I'm running in a remote process", L"Loaded!", MB_OK); 
        break;
    case DLL_PROCESS_DETACH:
        if (lpReserved == NULL) {
            MessageBoxW(NULL, L"Aww man I got unloaded from the remote process", L"Rejected!", MB_OK);
        } 
        else {
            MessageBoxW(NULL, L"Process is shutting down", L"Unloaded!", MB_OK);
        }
        break;
    }
}
That alone is enough to constitute an injectable module, no scary Win32 code there, just a standard Windows entry point which is well documented here
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us