Win32 API programming[suggestion needed]

Questions about programming languages and debugging
Post Reply
User avatar
DrVirus
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 383
Joined: 16 May 2007, 16:00
16
Contact:

Win32 API programming[suggestion needed]

Post by DrVirus »

Hey guys, i need your help. I'm trying to learn Win32 API coding. In the VC++ 2008 environment. But being a complete n00b in API I need your help. Can anyone suggest anything that I can or should read ??

I'm reading this at the moment http://www.winprog.org/tutorial/start.html. But if anyone has something better or more to offer please contribute.

Thanks in advance

DrV

User avatar
moudy
Technology Enthusiast
Technology Enthusiast
Posts: 688
Joined: 10 Feb 2009, 17:00
15
Location: Beirut, Lebanon

Post by moudy »

when I press on the lnk that you gave me this is what I get


Not Found

The requested URL /tutorial/start.html. was not found on this server.
Apache Server at www.winprog.org Port 80
mahmoud_shihab@hotmail.com

User avatar
leetnigga
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 447
Joined: 28 Jul 2009, 16:00
14

Post by leetnigga »

moudy wrote:when I press on the lnk that you gave me this is what I get


Not Found

The requested URL /tutorial/start.html. was not found on this server.
Apache Server at www.winprog.org Port 80
Yeah, you need to take off the dot at the end.

That said, it looks like a decent tutorial if you want to learn C++ with the Windows API. My question is: why do you want to learn C++ with the Windows API? In the majority of cases, especially on forums like this, using C++ is overkill.

User avatar
moudy
Technology Enthusiast
Technology Enthusiast
Posts: 688
Joined: 10 Feb 2009, 17:00
15
Location: Beirut, Lebanon

Post by moudy »

oh ok
thanks leet
mahmoud_shihab@hotmail.com

User avatar
f4Gg0t_43
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 245
Joined: 13 Sep 2008, 16:00
15
Contact:

Post by f4Gg0t_43 »

leetnigga wrote:In the majority of cases, especially on forums like this, using C++ is overkill.
What do you mean?

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Re: Win32 API programming[suggestion needed]

Post by ayu »

DrVirus wrote: I'm reading this at the moment http://www.winprog.org/tutorial/start.html. But if anyone has something better or more to offer please contribute.
That tutorial looks like a fine choice, but I would rather see that you got yourself a book on the subject (but that's just me) ^^

why do you want to learn C++ with the Windows API? In the majority of cases, especially on forums like this, using C++ is overkill.
Well, does he need a reason to learn it? More then the fact that he might think it's fun that is (which I will assume he does). Also I don't see why this forum wouldn't be fitting for this, we have a number of skilled coders here, and not to mention the fact that this could have been a forum for pink pandas, and it still wouldn't be a good reason for him to stop learning.
"The best place to hide a tree, is in a forest"

User avatar
IceDane
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 197
Joined: 12 Aug 2009, 16:00
14

Post by IceDane »

leetnigga wrote:
moudy wrote:when I press on the lnk that you gave me this is what I get


Not Found

The requested URL /tutorial/start.html. was not found on this server.
Apache Server at www.winprog.org Port 80
Yeah, you need to take off the dot at the end.

That said, it looks like a decent tutorial if you want to learn C++ with the Windows API. My question is: why do you want to learn C++ with the Windows API? In the majority of cases, especially on forums like this, using C++ is overkill.
I, too, would want to why C++ would be overkill. I'm starting to wonder if you have any idea whatsoever about half the things you say.

OP:

You are looking at the Windows API as if it's a special way of programming, or some design concept that you need to learn. It isn't like that. API is synonymous to "a collection of functions". When you are using any function that is provided by microsoft in their libraries, that's a part of their API. That includes programming using the WinSock libraries and anything else.

The winprog.org is a pretty good site, except that you will probably hardly ever find use for writing GUIs in the raw Windows API these days. You would have, a lot, when C was bigger than it is now, but it is simply overkill to do it now, especially when languages such as the .NET family and even C++ and its assorted class wrappers for the API facilitate it.

If you want to write GUI programs in C++, check this site out: http://www.functionx.com/visualc/

It teaches you how to use MFC for your GUI programs, which is a hundred times easier than writing it using the raw API(Which will always end up as pretty similar code, where the main difference between two applications' source codes would be what messages they are handling in the gigantic clusterfuck of a switch statement you'll need in the WndProc).

Obviously, learning the raw API for this isn't bad, but you'll find out that it's pretty fucking annoying to write such a fuckload of code for little work.

User avatar
leetnigga
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 447
Joined: 28 Jul 2009, 16:00
14

Post by leetnigga »

I see I've struck a nerve with the C++'ers here :P
f4Gg0t_43 wrote:What do you mean?
IceDane wrote:I, too, would want to why C++ would be overkill. I'm starting to wonder if you have any idea whatsoever about half the things you say.
I do, actually :)
IceDane wrote:you will probably hardly ever find use for writing GUIs in the raw Windows API these days. You would have, a lot, when C was bigger than it is now, but it is simply overkill to do it now, especially when languages such as the .NET family and even C++ and its assorted class wrappers for the API facilitate it.
IceDane wrote:Obviously, learning the raw API for this isn't bad, but you'll find out that it's pretty fucking annoying to write such a fuckload of code for little work.
Look at that! You answered your own question :)

Learning low level languages with low level APIs is certainly useful, but you only want to do it if you're interested in all that low level stuff. If you're just interested in GUI programming, you're much better off with a modern high level language with a nice new GUI library.
cats wrote:Well, does he need a reason to learn it? More then the fact that he might think it's fun that is (which I will assume he does).
I was just asking. Low level languages and APIs are nice, but you probably don't want to start out with them.
cats wrote:Also I don't see why this forum wouldn't be fitting for this, we have a number of skilled coders here, and not to mention the fact that this could have been a forum for pink pandas, and it still wouldn't be a good reason for him to stop learning.
What I meant was that it's very common to see people advocating C++ and saying it's the best thing since sliced bread on this kind of forums. People coming here asking about programming are usually just starting out, and I think hooking them up with C++ would be a mistake. Modern high level languages allow you to get a lot more done in a lot less code, and they have a much lower entry barrier. Let me illustrate that:

A "Hello world" program in C++, printing the text "Hello world" to the screen:

Code: Select all

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello world\n";
    return 0;
}
To understand this, you'll have to learn about the following:
  • Preprocessor macros
  • Namespaces
  • Functions
  • Blocks
  • Types
  • main() return conventions
  • Streams
  • Escape sequences
High level languages make an effort to hide all these things from you for simplicity, and well, sanity:

A "Hello world" program in Python:

Code: Select all

print 'Hello world'

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
18
Contact:

Post by ayu »

There are so many things I would like to say about that post leetnigger. But seeing that this is not the debate board and we are closing in on not answering the guys question.

DrVirus: Read through the post, take the path you think is the most fun. Don't let anything said in here change your opinion too much though because you might end up regretting it later, just follow your own path ^^
"The best place to hide a tree, is in a forest"

User avatar
leetnigga
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 447
Joined: 28 Jul 2009, 16:00
14

Post by leetnigga »

I wish DrVirus good luck with his C++ if he does choose to pursue it. I think the resource he listed is pretty decent for learning it.

I'll be opening a new thread in the debate board for all those things you have to say, cats :P

User avatar
IceDane
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 197
Joined: 12 Aug 2009, 16:00
14

Post by IceDane »

Leetnigga:

I agree whole-heartedly about using the right language for the job, however, that was not the discussion. This guy is learning C++, and he wants to get familiar with the windows API. Like I explained, the API is not just a collection of functions for the GUI. It is also every other function Microsoft has provided in their libraries.

On top of that, no one should ever start by learning a high-level language. If you intend on working with programming, or just being a geek who knows a lot of shit, starting out with a high level language that does everything for you, you will end up as an idiot without any knowledge of how everything works behind the scenes. If you intend on programming for windows, you should get familiar with the API, in which case, using a higher-level language, such as, say C# or any other .NET language, would not be the ideal choice.

There are still several things that cannot be done in the .NET languages, or are annoying to do, as Microsoft hasn't gotten around to port the API into .NET classes. Example would be hooking, modifying processes(OpenProcess and all that) and similar functions that deal with low-level stuff. You can use them, of course, but why would you use native, unsafe functions in a language that's good because it's type safe and cleans up your shit for you?
Remember all that about using the best language for the job?

You should try to avoid posting your opinions about stuff when you're going to post nonsense. If someone wouldn't have intervened, the OP would have gone off into the sunset thinking that using C++ for windows programming is stupid and that C is much better at it, or something along those lines.

User avatar
leetnigga
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 447
Joined: 28 Jul 2009, 16:00
14

Post by leetnigga »

Please move that post to the new thread: First programming language debate

User avatar
DNR
Digital Mercenary
Digital Mercenary
Posts: 6114
Joined: 24 Feb 2006, 17:00
18
Location: Michigan USA
Contact:

Post by DNR »

ah since leet already started his discussion the split will not work..

I did find it funny that a person that can write "Hello World" in Python
print "Hello World"
was implied to be smarter than someone that knows C/C+
To understand this, you'll have to learn about the following:

Preprocessor macros

Namespaces

Functions

Blocks

Types

main() return conventions

Streams

Escape sequences
To understand coding ya you should learn about namespaces,blocks, types, escape sequences - that sounds more like programming than high level "Do this, please"

Go to leets Rant/debate link IF you want to continue..

DNR
-
He gives wisdom to the wise and knowledge to the discerning. He reveals deep and hidden things; he knows what lies in Darkness, and Light dwells with him.

User avatar
f4Gg0t_43
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 245
Joined: 13 Sep 2008, 16:00
15
Contact:

Post by f4Gg0t_43 »

Quick suggestion, if you want gui programming, you should look into Qt or wxWidgets

User avatar
DrVirus
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 383
Joined: 16 May 2007, 16:00
16
Contact:

Post by DrVirus »

Wow !! I started a debate ! Without trying ! I'm good !!!

Jokes apart. Guys I want to learn API coding using C++ for a specific reason. And Thanks for the tip I am aware of MFC. It's easier. But let's face it MFC is built on the top of API.

Anyway I'm less interested in coding GUI and more interested it stuff like PE. But I want to learn it all :D. So thanks a lot. And keep contributing if you will.

Post Reply