Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Learning the win32 API Worthwhile? [closed]

Tags:

winapi

I was certain that somebody would have specifically asked this question, but from what I can see no-one has (there's been a question about learning win32 but that doesn't cover whether it's worthwhile doing so).

I am very interested in gaining a deeper understanding of all the systems I use (I mostly program in C#, at least professionally), so I wondered, very simply - is learning win32 worthwhile, or is it overkill? Am I wasting my time? Is the knowledge I'd gain worth the effort?


Similar / related questions on StackOverflow:

Does it still make sense to learn low level WinAPI programming?
How relevant is Win32 programming to modern professionals?

like image 238
ljs Avatar asked Feb 22 '09 23:02

ljs


People also ask

Is Win32 API obsolete?

Obsolete? Not likely. There will always be a need for people who understand how Windows works at a lower level.

Should you learn Win32 API?

No. Win32 is used by so many applications (including those that ship with Windows), that it's going to be there for a long long time.

How do I learn Win32 API?

I believe the best way to approach Win32 is through "Programming Windows" by Charles Petzold. It's very clear to read and easy to understand. There are a lot of examples you can pick up and experiment on your own. After you learn the basic stuff, I recommend "Microsoft Windows Internals" by Mark Russinovich.

Is Win32 API C or C++?

Most Win Api is C. There are couple exceptions (dor example COM IFAIR). But almost every code in MSDN says C++.. @MarekR All the COM APIs are C compatible.


2 Answers

Having a working knowledge of how Win32 works at the lowest level will certainly be invaluable if you are planning on doing Windows development in the future. It gives you a level of insight into things like Windows, Messaging and GDI that are hidden by the time you get to the level of .NET.

I wouldn't recommend you try and use Win32 for writing all your applications, but I feel that any Windows developer would benefit from writing a simple Win32 application using C/C++.

This is less true for things like WPF where there is less dependency on Win32, but just knowing how Win32 works will help you understand or appreciate some of the design decisions in WPF.

like image 150
Andrew Grant Avatar answered Sep 25 '22 02:09

Andrew Grant


I advocate learning the concepts behind low level windows programming if all of the following are true.

  1. You are going to do any windows programming.
  2. You want to be the "go to" guy when the unexplainable happens.
  3. You love to learn.

Abstraction layers like .NET work create and allow developers to do incredible things without having to know a lot. However, when .NET is used in a way unanticipated by its authors which reveals one of its subtle bugs, then that is the time where some win32 API knowledge goes a long way.

Will you ever have to write a message pump? I doubt it. Can it help diagnose problems? You betcha!

like image 41
Glenn Avatar answered Sep 24 '22 02:09

Glenn