Beginning Win32 Programming

Started by
9 comments, last by valentin-galea 15 years, 11 months ago
Hello, So I want to learn to do windows programming, and I have been googling for tutorials on the basics, such as how to create a window, but when I do, the sites I find are not much help. I saw this book, and it got a lot of good reviews on it. I was wondering if anyone had this book and thinks its outdated by now. click Also, if you have any good sites for beginning win32 that you think might help me, please let me know. Thanks :]
Advertisement
The Petzold book is a great one (it's the one we used in college) for Win32!

It's a bit old, though; The .Net WinForms stuff is so much nicer to use for a typical application. For me, Win32 is still very good to know for the occasions where I need to do something down in the guts of windows that .Net lacks.

It'll also teach you about how to deal with handles (for things like files, icons, brushes, etc) -- even in .Net apps you can leak these resources if you don't understand how to use them.
For the purposes of general application development, Win32 itself is outdated. That book however is probably one of the better books you can get for Win32 development.

If you're instead wanting to learn to develop applications, I'd instead recommend looking into something like WinForms.

However, if all you're wanting to do is create a window, MSDN again has the best info on using the Win32 API to do that, such as here for the actual function and here for an example of using it.

EDIT:

Though, as Nypy says, it's still a Good Thing™ to understand.
I agree that the Petzold book is a must have if you want to learn Win32 programming. After you look through that book I highly recommend "Programming Applications for Windows" by Jeffrey Richter. It goes very in depth with Win32 and even helps you understand the OS.

http://www.amazon.com/Programming-Applications-Microsoft-Windows-General/dp/1572319968/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1210709895&sr=1-1
Start here:
About Messages and Message Queues [MSDN]
I am currently programming a Win32 sprite viewer and that book has been about 4 inches away from my mouse hand for about a month now.

If you are looking for a decent site, try this one.

http://winprog.org/tutorial/

Also, keep in mind that you are going to need to ask questions and read up on parts of the Win32 API on the MSDN on your own. Google and MSDN are your friend.

2 very good sites are Strom Code
and Function X

once you understand the basic concept of windows programing, MSDN and a little practice will get you everywhere you wanna go.

The Petzold book is very good, i bought it used on amazon, the one beef I have with it is that it spends alot of time in the beginning on things that would be better explored later in the book, but thats just my opinion.
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
I don't have a specific book to offer up, but I would suggest getting at least 1 or 2 books on .NET (for the latest version you can find on Amazon, used books perhaps) and 1 more on Win32.

The reason for this is that nearly every programming book I have read is:

- incomplete
- inaccurate
- confusing

This isn't a dig on any book, but only to point out that the subject matter (even scoped to something like Windows development) is very broad at its base.

I'm not sure what you want from Win32, but I do (as others have) encourage you to check out MSDN.com. MSDN can be incomplete, inaccurate, and confusing to someone new with the site, but I believe that you will eventually find it invaluable once you learn how it works. And, MSDN has taught me a lot about how Windows works.
~Argonaut________________________________Why "~Argonaut"? It's all just a mathematical expression denoting a close approximation of "Argonaut", which is irrational and can't be precisely defined.
Win32 is necessary because the WinForms abstraction leaks. Until Microsoft builds .NET as a Windows subsystem rather than a runtime (and an incomplete one) running on top of Win32, you'll need to know Win32 for the edge cases.

Petzold's book is good, but don't take everything he says as gospel. Wherever he speaks about software development practices or anything outside of the Windows OS and API, take his comments as merely advisory.
Quote:Original post by valentin-galea
Start here:
About Messages and Message Queues [MSDN]


I don't believe an MSDN article such as this is a good start for someone asking for advice in the beginners section of gamedev. I think the articles you pointed to may be a bit too overwhelming, and hence discouraging, to the OP.
~Argonaut________________________________Why "~Argonaut"? It's all just a mathematical expression denoting a close approximation of "Argonaut", which is irrational and can't be precisely defined.

This topic is closed to new replies.

Advertisement