What I can do using Windows API, that I can not do using native .NET code?


This may appear as a bit strange question, but I would really like to know the answer to it!

The question is:
Is there something that I can do using only Windows API (from say VB6), which I can not do using pure managed code (native code) in VB.NET or C#.NET?
Or put it the other way: Using VB.NET or C#.NET native managed code, can I do absolutely everything that I can do using Windows API?
In other words, do I have the ENTIRE functionality of the  Windows API, using pure VB.NET or C#.NET managed code (native code)?

Thank you.
Who is Participating?
iHadiConnect With a Mentor Commented:

There are a lot of things you cannot do using .NET managed code which you can using API.

Some functions will be:
Getting the handle of active window or other special windows like the desktop.
Sending messages and commands to other windows and applications.
Setting the cursor position to a specific point.
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
"In other words, do I have the ENTIRE functionality of the  Windows API, using pure VB.NET or C#.NET managed code (native code)?"

No, the .Net framework does NOT encapsulate every single Win API that is available in the operating system.

Some big ones:

(1) Global Keyboard and Mouse Hooking
(2) System Wide Hotkeys
(3) Hooking/Subclassing an External applications windows
(4) Manipulation of External application windows such as moving windows, changing window states, enumerating child controls of a specific window, etc...
(5) Many, many more...too many too list!
BigBossAuthor Commented:
iHadi, thank you for your comment! Greatly appreciated!
I would like to hear from some other experts, please!
Can anyone add to these indicated by iHadi?

Thank you.
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

I think the responses above are enough. Just would like to comment that despite these functionalities are not available when using managed code (.NET), you can still use P/INVOKE to call unmanaged code that does the work you need. Take a look at the System.Runtime.InteropServices namespace.
Bob LearnedCommented:
It is easier to know what it can do, than what it can't:

Microsoft Win32 to Microsoft .NET Framework API Map

This is an old article and applies to 1.1, but you get the idea.

BigBossAuthor Commented:
Many thanks to all of you...

Best regards.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.