tags:

views:

351

answers:

7

I'm a long time Mac user, with a fair bit of programming experience and I wanted to try programming for windows. The thing is I don't know where to start, what should I learn first ? .Net, Win32 ?

[Clarification]: My ultimate goal would be to create a more or less complex application using the latest APIs however I like to know the underpinning of what I'm dealling with.

A: 

.Net is easier.

My ultimate goal would be to create a more or less complex application using the latest APIs

The latest APIs are .Net (Win32 is older).

however I like to know the underpinning of what I'm dealling with.

Win32 underpins .Net (although you might barely see Win32 artefacts when you're programming in the .Net environment ... for example the Mono project more-or-less-successfully ports the .Net API to non-windows).

ChrisW
+10  A: 

Start with the Bible, Programming Windows 5th Edition. It is still very relevant.

http://www.charlespetzold.com/pw5/

You'll start doing C with Win32. Once you understand that you can also learn .NET. Though some people may tell you to skip Win32 and go straight to .NET. However, doing Win32, you will understand a great deal about how Windows actually works.

BobbyShaftoe
I'm glad this answer is here. It saved me the trouble of doing a search for Petzold. Libraries that mask Win32 will only be frustrating if you don't have a feel for how Win32 works.
jmucchiello
The .Net framework is a great abstraction over the underlying Win32, though poorly-written .Net code can definitely fall afoul of Win32-related problems. This is more often a problem with maintenance than freshly-written code.
Greg D
@Greg-D, a great example of poorly written .NET code is the EventLog code in the .NET 1.1 API. It may still be bad in 2.0 and on as well. It's very slow because it calls LoadLibrary() for every message rather than caching the DLLs. I logged this bug but no one was interested at the time.
BobbyShaftoe
The biggest issues I've run into are application devs without a proper understanding of either Win32 or .Net violating basic premises of windows app design. E.g., trying to create and use UI before the call to Application.Run() (The message loop).
Greg D
Well, it depends on what kind of app he wants to do.
Danmaxis
+4  A: 

I'd be taking a look at getting a copy of one of the Visual Studio Express Editions and start there. It has all the tools you need to build windows / web applications on windows.

You could start at the win32 level however depending on what exactly you want to do, you may find you're able to do everything you need with .net and visual studio.

lomaxx
+2  A: 

Once you're finished with the suggested windows programming bible start reading The Old New Thing, Raymond Chen's blog.

There's a lot of interesting insight about inner workings of windows, why it is the way it is etc.

arul
Great blog. As long as you can ignore Chen's horrible personality, it is very informative.
BobbyShaftoe
His snarky attitude is half the entertainment!
Greg D
Horrible personality? Excuse me? I think he has a great personality.
Alex
+2  A: 

For rapid application development on windows, .NET seems to be the most efficient solution nowadays. But If you crave that extra ounce of performance out of your applications, I'd recommend giving Programming Windows and Windows via C/C++ a thorough read. Although some of the material is dated, a lot of it is still relevant with windows programming today. If you choose the .NET route some books to take a look at include Illustrated C# 2008, Accelerated C# 2008, and of course our own Jon Skeet's C# in Depth.

John T
A: 

I'd recommend starting to program in .NET (C# or any other .NET language) since that's the most modern general application platform for Microsoft. I personally like the Richter books, CLR via C# and Applied Microsoft .NET Programming. Great starting points even though the 2nd book is a bit old and doesn't contain newer .NET features.

To truly learn the Windows platform, I totally agree with Bobby's suggestion to read Petzold's Programming Windows.

C. Dragon 76
+1  A: 

Read the Petzold and see the Advanced Win32 api newsgroup for all undocumented stuff news://comp.os.ms-windows.programmer.win32 (source code for all Win32 apis...)