Click to See Complete Forum and Search --> : Books on windows API


potatoCode
March 12th, 2008, 09:17 PM
Hello guys,

I'm thinking about buying a book on Windows API.
I did some research and it seems that Windows Programming by Charles Petzlold is most recommended.

But, there was one review where it said,
this book is for Windows NT (regardless of what the ad says).
Is this true?
The book also tells you straight forward that it was written for C, and not C++. This is a problem for me because I'm new to C++ and I decided to take Bjarne's advice on how it is not necessarry to learn C before learning C++, so I didn't bother to learn C.

My questions are-
1. Is the book above appropriate for someone who's learning C++ and not C?
2. Is this book outdated and should be considered obsolete?
3. Can any of you recommend any other book that you, yourself have read and think it's good?
4. What's the difference between API and .NET Framework?

Thanks for your help.

aurora72
March 13th, 2008, 05:46 AM
Hi,

[Charles Petzlold's Windows Programming Book]

1. Is the book above appropriate for someone who's learning C++ and not C?

--> First, why should it be C++ and not C. C++ stemmed from C, and compatible with it. As for Win32 API, the main thing is the naming conventions , variable names.The C-type data structures (like the Window class) and the "function pointers" are just the old way of forming a decent C++ class :) You must come to terms with it.
In C++ you have properly designed Microsoft Foundation Classes which wraps all (almost) Win32 API functionalities and that's fine too.

I started exploring Windows programming first by MFC and then I went on to studying Win32 API. Both work well in parallel.
These lines from Microsoft Press' on Visual C++ 6.0 book make the case clear:

the Win32 API function ShowWindow
Lesson 1: Overview of MFC BOOL ShowWindow(HWND hWnd, int nCmdShow)

is encapsulated by the member function of the CWnd MFC class:

BOOL CWnd::ShowWindow(int nCmdShow);

Here you see, hWnd parameter is hidden inside the CWnd class because it 's handled inside of it.

Petzold's book covers all aspects of Win32 API but still, I need to support it by peeking into Internet because Petzold's contains extreme detail. That's fine of course, but sometimes you might miss the big picture and can't tell the forest from the trees.

2. Is this book outdated and should be considered obsolete?
--> Answer is clear: No it's NOT outdated simply because Windows is not outdated.

3. Can any of you recommend any other book that you, yourself have read and think it's good?

--> Supplement it with an MFC book and have a look at the articles at www.everything2.com (http://www.everything2.com). Especially take a look at "How to create a Window in Windows" (http://www.everything2.com/index.pl?node_id=1765971) where a comparison between C++ and C is made at the intro.

4. What's the difference between API and .NET Framework?

API as "Application Programming Interface" simply enables you to programm the application by providing an interface which consists of variables and functions. .NET FW provides advanced set of classes (C#, C++, ...) to do the same thing.

potatoCode
March 13th, 2008, 02:26 PM
Hm, I see.
Thanks alot for your input Aurora72.

Igor Vartanov
March 16th, 2008, 01:58 PM
I'm thinking about buying a book on Windows API.You have to know, that Petzold's book allows just to start doing WinAPI programming, since it touches UI stuff mostly. But Win32 API has lots of pits, caves and dark places like multithreading, security, services, interprocess communications, COM/OLE things, WMI, and so on, and so forth... Do not expect to find any of them in the book.

So be sure of need in buying quite a library eventually. :D :thumb: