views:

163

answers:

3

I'm a C# developer working with either Windows Forms or WPF. Sometimes I have to deal with unmanaged code, which I don't like. I think that the main reason why I dislike this is ignorance. I don't know the underlying Win API.

I think that I'm not the only person who has negative feelings against unmanaged Windows code.

Question: Should a Windows Forms\WPF developer start digging the WinAPI in order to be a better developer?

Sorry for not being very clear..

Thank you.

A: 

I think that looking at the WinAPI could be counter-productive to WPF, since it has a largely re-written stack. Even more so if you are looking at WPF in parallel to Silverlight.

It might be marginally useful occasionally for winforms - but I've been writing winforms for years, and have only once or twice needed lower level details. Every time I did, "google" did the job fine; or more recently, stackoverflow ;-p

If you were writing raw windows directly, then maybe. But that would be unusual for C#.

Marc Gravell
+1  A: 

No.

The WPF is a rewrite (almost) of the current Win32 api. It is not like WPF is built over Win32.

People learning Win32 were new to windows programming - it was required to learn the basic structure of a windows app: the winmain, messageloop, windows class etc. Now with WPF, you will be well off mastering similar concepts in WPF (and also concentrate in understanding XAML).

There will be lot of conceptually similar topics with win32, but you can just stay within WPF. You won't gain anything learning win32 for wpf.

Sesh
+1  A: 

I'll chime in to say that I agree with the two posts above. Use google - Petzold is overkill for what you're asking.

It would be useful if you were wanting to branch out and expand your knowledge (all learning is good learning), but not for what you've mentioned.

Travis