Alex Rivera | Logout

Does it still make sense to learn low level WinAPI programming?

Asked 2008-08-08T00:29:13.963
55

Does it make sense, having all of the C#-managed-bliss, to go back to Petzold's Programming Windows and try to produce code w/ pure WinAPI?

What can be learn from it? Isn't it just too outdated to be useful?

Edit
Report

2 Answers

16

The native APIs are the "real" operating system APIs. The .NET library is (with few exceptions) nothing more than a fancy wrapper around them. So yes, I'd say that anybody who can understand .NET with all its complexity, can understand relatively mundane things like talking to the API without the benefit of a middle-man.

Just try to do DLL Injection from managed code. It can't be done. You will be forced to write native code for this, for windowing tweaks, for real subclassing, and a dozen other things.

So yes: you should (must) know both.

Edit: even if you plan to use P/Invoke.

answered 2008-08-08T00:53:24.663
3

I've seen low level Windows API code... it ain't pretty... I wish I could unlearn it. I think it benefits to learn low level as in C, as you gain a better understanding of the hardware architecture and how all that stuff works. Learning old Windows API... I think that stuff can be left to the people at Microsoft who may need to learn it to build higher level languages and API... they built it, let them suffer with it ;-)

However, if you happen to find a situation where you feel you just can't do what you need to do in a higher level language (few and far between), then perhaps start the dangerous dive into that world.

answered 2008-08-08T00:40:05.453

Your Answer