Did .Net 2.0 decrease how much we need API?

NeuralJack

Centurion
Joined
Jul 28, 2005
Messages
138
I use API a lot..
But only because .Net doesnt have functions to do what some of the API functions do. Or if they do have a function similar in .Net 1.0 some of those functions were slower than the API version.
Does anyone know if they increased the amount of functions available in 2.0 so that you need less API? Keep in mind I use these functions because I interact with other programs on my desktop.. these are not the same program as my program. Basically Im controlling things like Notepad with my program.. this is why I cant use some of the more basic 2.0 functions.

Here's some example of API functions i curently use:
MoveWindow
GetPixel
mouse_event
keybd_event
SetForegroundWindow
GetForegroundWindow
 
Alot of API functions can be avoided one way or another with DotNet 2.0. For instance, there are certain things that can be done with the NativeWindow class, and certain popular API functions have been wrapped, such as ExtractAssociatedIcon. Features commonly implemented through the API might possibly be doable through the WndProc method (which was present in earlier versions of DotNet as well) or something similar.

The fact of the matter, though, is that if you are using an application that is heavy on (various) API calls, there isn't much point to going through your code and removing all the API calls. Generally, what new DotNet methods there are are simply wrappers and if your application isn't 100% API free then there is no gain to be had by reducing API dependancy (except, possibly, Windows version issues).
 
Alot of API functions can be avoided one way or another with DotNet 2.0. For instance, there are certain things that can be done with the NativeWindow class, and certain popular API functions have been wrapped, such as ExtractAssociatedIcon. Features commonly implemented through the API might possibly be doable through the WndProc method (which was present in earlier versions of DotNet as well) or something similar.

The fact of the matter, though, is that if you are using an application that is heavy on (various) API calls, there isn't much point to going through your code and removing all the API calls. Generally, what new DotNet methods there are are simply wrappers and if your application isn't 100% API free then there is no gain to be had by reducing API dependancy (except, possibly, Windows version issues).

Thanks Marble, I'll go through some of those suggestions and see if I can get rid of all my API's. If not i'll likely keep the API functions.
 
Back
Top