[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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

Hello,

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.
0
BigBoss
Asked:
BigBoss
2 Solutions
 
iHadiCommented:
Hi

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.
...
0
 
Mike TomlinsonMiddle 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!
 
0
 
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.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
felipecslCommented:
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.
Links:
http://www.pinvoke.net/
http://www.codeproject.com/netcf/compframe1.asp
0
 
Bob LearnedCommented:
It is easier to know what it can do, than what it can't:

Microsoft Win32 to Microsoft .NET Framework API Map
http://msdn2.microsoft.com/en-us/library/aa302340.aspx

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

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

Best regards.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now