tags:

views:

4763

answers:

13

Do you know of a good means of learning C++ win32 (not .Net/MFC/ATL/Wx/Qt..) GUI programming ? A book, a tutorial, an existing project, preferably a hands-on approach with realistic example.. I'm not a beginner, so I don't mind "advanced" starting points..

With thanks.

+19  A: 

Charles Petzolds book is the best.

Programming Windows

dicroce
"Programming Windows" does NOT contain C++ examples. It's a strictly C/Win32 guidebook.
ilitirit
If you can learn to do it in C, and you know C++, the jump is really trivial.
Eclipse
It is C - but that's what the Win32 SDK basically is, a C-style API. Anything with C++ starts to become a "framework" (junk over the raw API) - which OP says he doesn't want. Worth pointing out, however...
Aardvark
+3  A: 

Petzold's programming windows if you can find a copy. All the win32 gui stuff is still there underneath MFc/Winforms etc. http://www.charlespetzold.com/pw5/index.html

edit - as somebody mentioned, the win32 api is purely 'C' as are all the examples in Petzold. This doesn't really matter if you are calling them from C++ except that you will have to understand regular C strings.

Martin Beckett
+3  A: 

The Bible of all Win32 programming (including, but not restricted to GUI topics) is Petzold's book.

Make sure you get version 4 or above as previous versions are 16-bit!

gbjbaanb
So the versions prior to 3 do not cover win32?
Adam Davis
*ahem*, that's version 4 or above. No, previous to that there was no Win32. See my edited answer.
gbjbaanb
A: 

I've learned a lot about win32 GUI from Iczelion tutorials. They are basically for win32 assembly, so the source code samples are in MASM not C++, but yet the mechanicks of windows GUI described pretty well. And the API itself doesn't depend on the language anyway.

akalenuk
A: 

Thanks but Programming Windows comes with a ton of overhead (doesn't mean it's not a solid ref. though!)

I was thinking of a more narrow, practical, shorter path approach, like a tutorial around a dialog interface to a CLI prog. for starters (no MDI yet!)

I'm very good (and happy!) with the "learn by example" philosophy..

(What was I thinking?! I should have guessed PW would have been given as answer!)

Part of the learning process is liking and asking for more PAIN :). Its funny how people answered the shortest path is thru Petzold's book.
Gishu
The Petzold is distinctly not a reference work. It's complete, yes, but presented very much in 'tutorial' (a horrible word that nowadays seems to mean 'written by 16 year old with attention span of a walnut') style. You asked for it, you got the correct answer. How about only reading chapters of PW?
Roel
+2  A: 

The #Efnet WinProg channel has a decent tutorial and FAQ. It's not a strictly C++ guide though.

http://www.winprog.org/tutorial/

ilitirit
+8  A: 

There is no such thing as "C++ Win32 GUI programming". C++ is used for many wrapper libraries that you see around (QT and MFC come to mind). However, pure Win32 programming is entirely procedural in technique, if not in concept. It started out in Pascal, then got recast in C, and it has not gone anywhere since.

Arkadiy
TITCR. The OP's question is nonsensical, you cannot program win32 in C++ because win32 is a C API.
Roel
+1  A: 

You might also want to take a look at the WTL source code.

Heng-Cheong Leong
A: 

I guess I learned it the hard way -- entirely through studying VC6's help files. :-) I find VC8's files far less helpful for Win32 programming in general though, because they're riddled with MFC, COM, WinCE, and other things that you can't always filter out.

(I know this answer isn't all that helpful, I'm just saying how I learned.)

Head Geek
A: 
  • Petzold

  • MSDN

  • Advanced Win32 api newsgroup comp.os.ms-windows.programmer.win32 (undocumented apis and any Win32 api source code)

A: 

Here is a list of some online Win32 tutorials and here is a list of links to WIN32 SDK help files.

I personally like the Borland Win32 SDK in Winhelp format (from the link above) as it covers all the basics of Win32 and is easier to search than something like the MSDN.

The MSDN is great once you know what your're doing but I suspect it can be quite confusing to new comers.

jussij
A: 

why C++ why not just straight C and WIN32? Its so much easier... Petzold is your answer.

dwelch
+1  A: 

theForger's Win32 API Programming Tutorial describes itself as "attempts to get you started developing with the Win32 API as quickly and clearly as possible" and that it's projects and solutions are written for Visual C++. It's also available there as a PDF which is only 108 pages long.

Rob Kam