Question about Windows API/SDK

Started by
13 comments, last by hplus0603 17 years, 11 months ago
I'd like to start programming windows applications, but I'm a little confused. I already know C++, but I've only used my programs through the command prompt. I don't know what the next step is. I'm trying to figure out which is the library that I need to use to create windows, buttons, menu bars etc. I know there is the Win32 API and the Windows SDK, but I don't know the difference between them (and thus, which one I'm supposed to read about). Any help is appreciated. (By the way, I don't want to use WYSIWIG tools like visual basic--I've used them before, and I don't like them).
Advertisement
You might want to try .Net it helps a bit. There is also MFC (Microsoft Foundation Classes). These both help develope Windows apps.

theTroll
While you certainly can use C++ to create Windows applications with menus, etc., the trend that seems to be prevelent is to use VB.net or C#. I'm not sure if you have tried any of these tools but what ever it was that turned you off to WYSIWYG tools may very well be resolved by these more modern languages - especially C# (since you are coming from a C++ background).
Thanks for the responses!

I know that .NET will make programming these applications easier, but I rather not have to learn another programming language (C#) since I just recently really began to be proficient in C++ (and I'd hate to start over again!). I'm also not fond of the idea of paying hundreds of dollars for the development tools. I'm a student and can't afford to spend that kind of money.

I read a little about the Microsoft Foundation Classes in wikipedia and it says there that these are Windows API portions wrapped in c++ classes. That seems to be more like what I needed. So I'm assuming the windows API is the one that defines windows, menus etc. What exactly, then, is the Windows SDK?
If you're interested, you can download Visual Studio Express Editions for free to try things out. I understand your feelings about learning a new language. But I found that once I learned one language, learning new ones was not nearly as hard. Of course, that doesn't mean that you would be proficient in all of them. We tend to be best at what we are currently using. I also certainly don't want to sound like a salesman for Microsoft, there are lots of free tools to download. VS Express tools are just really good tools to work with - especially the debugging tools. There's also a VC++ Express included. Not sure what your using for an IDE. Again, we're most proficient and comfortable with what we are currently using.

If you want to use the Windows SDK, this link will give you some good information.
I second what others have said about .NET - you can use C++ to work with .NET (though personally I consider it something of a monstrosity when languages like C# are available). That said I also appreciate your situation, and continuing with the Win32 API is OK, you just need to bear in mind at all times that there are nicer alternatives available.

The difference between the Win32API and the Windows SDK:

The Win32 API is a collection of functions, constants, structures, and definitions that programs can use to communicate with the Windows operating system. There's a function to create a window, a function to set the cursor, a function to play a sound, and so on. Note that the API itself isn't a concrete thing you can download or something - it's more like a standard that the OS conforms to.

The Windows SDK is a collection of headers, libraries, documentation, and sample code, that assist you in writing C or C++ code that uses the Win32 API. All the information about the signatures of the functions and the DLLs in which they reside is recorded. All the constants and structures are laid out. Instead of having to set things up in your own code, defining all the constants and stuff yourself, you use the SDK as a shortcut. (The number of symbols that the SDK defines for you is easily in the thousands, which is why everybody uses it instead of trying to do things by hand).

For the most part, the two terms are used interchangably; "Programming with Win32" and "Programming with the Windows SDK" generally mean the same thing, which is writing code that calls into Windows via the functions defined in the Win32 API, with your code assisted by the Windows SDK.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

<Offtopic>
It's interesting to see that in most threads were people ask for help with a language they have decided to use there are always people to tell them to change language :P
</Offtopic>
Imo, that observation seems somewhat on topic...

Here are a couple of books to get started with programming on windows.

Programming Windows, Fifth Edition. This is a classic. It uses C not C++ but that shouldn't be too much of a problem for you.

Programming Applications for Microsoft Windows (or Advanced Windows) Both of these are the same book, the author changed the name between the 3rd edition and the 4th edition. The 4th edition uses C++, the 3rd edition uses C. Amazon says the 4th edition isn't available but the 3rd edition is. That's just as well, I think the 3rd edition was better.

Getting a copy of the Platform SDK is a good idea too.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Once again thanks for the responses, you guys have been very helpful.

I'm going to take a look at the c++ resources, but I'll also give a quick look at C#. If that's where the trend is going, I'll probably have to learn it sooner or later. (oh well...)
MFC is most powerful on Windows. ".NET" is a bit simpliest,however well written program in MFC is better with quality,speed etc.

MFC is not a part of VS Express. For some reasons this is only a part of full VS2005/2003/etc.

( I don't wonder why,since most of quality apps I know is written in this api even now,I think... )

This topic is closed to new replies.

Advertisement