views:

227

answers:

4

I'm a little ashamed for asking this, because, you know, I've been very anti-MS for a long time. I have been fortunate enough as to make a living outside Visual Studio. As I grown older there are "some" things I would like to try, and to be very honest, this Q&A site has inspired me and I realize that VS and Windows Development doesn't suck that much. Hey, after all C# was designed after Java, and now Java is copying back some features from the child language. And Windows vista is the first decent version since windows came to light.

Anyway, to any +3,000 user in the audience, you may delete all the above crap and keep the following:

Do you have, links, resources, tutorial aimed to learn Windows development coming from strong Java background?

I'm very interested in Windows manipulation (that is the actual window, the frame, get the name, get foremost app etc., resize it programatically, etc.) and in Windows Search API among other minor API's. My interest after all is to integrate them with my Java apps through JNI or JNA.

I've read many tutorials and links over the MSDN, and I actually understand the API it self. I've grabbed a copy of C# and C++ Express and actually got some basic samples running.

My problem is I don't get the big picture of the whole architecture (because, well, it is big). The classes have hundreds of methods, and it not that clear to me who calls them. (I had this same opinion when I first look at the Java's Javadoc API.) I don't know some basic common objects, for instance HWCD (or something like that) that it turned out to be the very window handler, but every single tutorial I read give that for granted (as if WHCD or what ever it is, was a very descriptive name).

I don't know exactly the difference between Win32, COM, COM+, DCOM, Windows SDK ADO, and some other technologies. I mean, I know them at some degree and by common sense, but while reading the tutorials or the API I get confused. I've tried to grab some "beginner" tutorials, but they are aimed for absolute 0 programmers using Visual Basic (yiak! , THAT was the main reason I kept away from MS for so many years in first place.)

I do understand .NET framework, managed code, unmanaged code, C# basics, CLR and related stuff, because well, they are SO similar to the Java platform that it is almost transparent.

So, after all my rants and honest opinions about MS development:

What's the best way to learn Windows Development for a non absolute beginner (in programming) but absolute new to Windows APIs itself? What would be a good path?

+2  A: 

The Petzold is your new best friend, and MSDN is your new Javadocs. Make sure you have a good understanding of C before you dive into it though. The Forger has a great beginner tutorial too if you're interested. A great place to hang out while learning is #WinProg on efnet irc, plenty of win32 gurus ready to help.

John T
I think that Petzold should be largely irrelevant if you are focusing on .Net development. I agree with the recommendation of MSDN though
1800 INFORMATION
I know C ( or use to ) hopefully I cat get through that MSDN page again ( http://msdn.microsoft.com/en-us/library/bb266518(VS.85).aspx ) I can't figure out how to use JNA to call that. :S :S
@John T: I forgot to thank you.
@1800 - In multiple paragraphs he mentions he wants to learn Win32 API, so that's what I thought he was going for primarily. He mentions he is coming from a Java background so I assumed he had a grasp of how C# works. If he wants to learn C# more, then I will gladly edit my post with resources :)
John T
+1  A: 

I'm going to suggest an alternate path (with less resistance). Have you looked at WPF yet? It's the new GUI toolkit that lets you create sexy interfaces (like those found in Vista).

That may be enough to keep you interested while easing into more advanced development. From there you can jump into the jungle of the Win APIs (if you choose).

Just a thought, as that path would be more interesting for me. Your mileage may vary, of course.

Travis
+1  A: 

I strongly recommend getting yourself a copy of "Win32 Programming". It explains the basic DNA of WINDOWS - and this is valid if you are programming with the old C++ win32, the new C# WinForms and also the future Windows Presentation Foundation.

In a nutshell, a Windows program consists of a WinMain. When first started the app registers its window class with the system, initializes and then starts a message loop which continues till WM_QUIT is encountered. The system (OS) keeps pumping messages like keyboard or mouse click etc to the message Q of the application. In Windows, at any point of time there is only one active Window - so the OS knows whom to send the message to.

Well things like these are described in detail in the above book.

COM (COM+, DCOM) are not really related to Windows. When Word, Excel became popular and it was required to be able to access Excel from Word (viceversa) they came up with the AcitveX technology which is kind of the root for COM etc. You can get started with "Essential COM" by Don Box.

One warning: in the Microsoft world, there are two ways to program - to go the boiler plate way (write everything yourself) or use frameworks (MFC, ATL-COM....). It is recommended to do a bit of boiler plate so that you know the basics.

Sesh
Great answer, thanks
A: 

Having made the same conversion a year ago I can say that there's a lot of literature specifically for learning c# from a Java background. This was my first into which I found really useful for learning the important differences / features of C#:

C# from a Java developer's perspective

And there are also books which may be worth a look at (google 'c# for java programmers'). As JohnT said MSDN library is the equivalent of JavaDocs API, but I found it really frustrating to use. The best way to learn is to grab a copy of Visual Studio express and start playing around. Use intellisense to explore classes and methods. Find a small program you wrote in Java and try to reproduce it in C#. Start with simple problems, use google to solve them. You'll find it hard for the first week, but trust me, it will come to you surprisingly quickly!

James Allen
Yes, I find it very frustrating. Once I thought javadoc was too plain, now I see the advantage of that, is is easy to use. Well, that's an small detail anyway. :) C# is not that hard for me after all, my problem comes win the Windows technology overall. Thanks of the answer