Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
  • Leaders
Posted

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).

[sIGPIC]e[/sIGPIC]
Posted
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.

Currently Using: Visual Basic.Net 2005, .Net Framework 2.0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...