Win32 API help

Hello, I am wondering if someone can give me a site or any help on making a program that does not use a command line (or whatever it's called...) and instead make a program that uses a actual window. I have looked on google but i found REALLY complicated things that don't help me a bit. I also looked at this and found something that is called Win32 API. Is this programming windows...or something else? Any help appreciated!

-DaPasta
Look under the articles section of this site. There is good stuff there.

Most folks here recommend the Forger's Win32 tutorial. Do a search on that. The best book on the topic is Charles Petzold's Windows Programming, 5th edition.

The very first thing you need to learn though, with which you might not be familiar, is the TCHAR data type and the tchar.h macros. Disch has an article on that here somewhere. Maybe someone can find the link and post it (I just looked quick, but didn't come up with it). I've written quite a bit of tutorial material that some folks have found worthwhile here...

http://www.jose.it-berater.org/smfforum/index.php?topic=3389.0

It takes some getting used to. Its quite different from console mode programming.

Good luck!

Ok, so what I have found from your sources are that they are for C not C++. Are they any different in the win 32 sense? And also, i don't really know any C so it might be kinda harder to learn with those.
Last edited on
?? If you know C++, you pretty much know C too. There are just a few differences. For example, you cannot overload operators in C and you just have the good ol' C style for type casting, meaning no reinterpret_cast<>, static_cast<>, dynamic_cast<>, and you also don't have templates. But basically you already know C.

Also note that the Windows API is written for C.

Ok, so what I have found from your sources are that they are for C not C++. Are they any different in the win 32 sense?


You couldn't have followed my sources and still be asking that question, because I addressed it specifically and exactly in the first several paragraphs of the above link. Until WinRT with Windows 8 goes mainstream, the lowest level interfaces to any of the operating systems we presently use are C based. If you can't deal with it at that level, then you need to adopt a class framework.
Last edited on
You could also use Qt or wxWidgets - I personally think they are easier to use than Win32, but "easy" is of course relative with GUI programming - the minimal code required to create a GUI pretty much always ends up being larger than for a console program.
I mgiht add, if you really digest freddie1's tutorial you will learn a lot about some of the internals you need for Win programming. I've bookmarked his tutorial to go back and reread at times.

You can send me a check later, freddie1. -:)

You can send me a check later, freddie1. -:)


Its in the mail!
@ OP: For what ever my opinion might be worth, I would actually recommend freddie1's article over many of the other ones you might find as a primer, assuming that you are already comfortable with C++. It might seem that he goes into an absurd amount of detail but it's all necessary so that you actually understand what you are doing, as oppossed to many other tutorials that say "Do this that way because it works".
Ok i didn't understand what you said...

@freddie1
You couldn't have followed my sources and still be asking that question, because I addressed it specifically and exactly in the first several paragraphs of the above link. Until WinRT with Windows 8 goes mainstream, the lowest level interfaces to any of the operating systems we presently use are C based. If you can't deal with it at that level, then you need to adopt a class framework.


@hasnt99
You could also use Qt or wxWidgets - I personally think they are easier to use than Win32, but "easy" is of course relative with GUI programming - the minimal code required to create a GUI pretty much always ends up being larger than for a console program.


Can you show me how to do that?

@webJose
?? If you know C++, you pretty much know C too. There are just a few differences. For example, you cannot overload operators in C and you just have the good ol' C style for type casting, meaning no reinterpret_cast<>, static_cast<>, dynamic_cast<>, and you also don't have templates. But basically you already know C.


I know C?!?

And freddie, with your article, i virtually didnt understand a word it said...Maybe i dont know enough in programming. But in that case, can you give me a good C++ learning source? Right now im just kinda switching between random sources and trying to find one that works for me. I just want something thats not a book unless its online and free. Also, i know classes are the best bet, but im not doing those yet!

-DaPasta
If you're going to program C or Windows, you need a sound founation in C/C++. You should therefore be willing to invest an little money and time in learning this foundation. Here is an excellent start --

http://www.amazon.com/Primer-Plus-5th-Stephen-Prata/dp/0672326973/ref=sr_1_1?ie=UTF8&qid=1316689733&sr=8-1

And freddie, with your article, i virtually didnt understand a word it said...


I'm sorry to here that DaPasta. I tried my best to explain things as well as I could. Maybe I could have done better.

Then too, I don't know how advanced you are with C or C++ coding. Windows GUI programming in C or C++ is a fairly advanced topic. Its actually quite a bit easier to get a window up and running in .NET or some other languages. In fact, in .NET about all you have to be able to do is fill in the name of a project in a dialog box and click a 'Run' button. Of course, I really hesitate to call that programming, but that's another story.

Also, I'm not sure how well one can learn without a few books. Just thought of something! Bruce Eckel's two "Thinking In C++" books are freely downloadable....

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

Perhaps there are others. However, they aren't Windows specific, but rather concentrate on standard C++. Mr. Eckel was on the C++ standards committee at one time.
Topic archived. No new replies allowed.