I am writing a windows desktop application in C# 2010 that will be calling a windows api. The user will enter some information, hit the submit button, and the windows api will be called.
My question is would you show me code on how to call the windows api, tell the windows api what you are looking for, and return any optional values obtained from the windows api?
Loading
VulpesPosted Jun 13, 2013, 4:57 PM
http://www.pinvoke.net/#
Desktop functions are listed by the dll which contains them such as kernel32.dll and user32.dll.
Although all these API functions are documented on MSDN, they are written in C and it's not always a straightforward matter to call them from C# due to difference in types, pointers etc. The above site can therefore save you considerable time in figuring out what the equivalent C# signatures should be and, if you're lucky, there's a decent example of use too.
Sie StePosted Jun 13, 2013, 3:12 PM
Amit ChoudharyPosted Jun 13, 2013, 1:33 PM
Also there's an API to access the kernel functions known as WMI.
Check out this article here for more details about WMI and how to program with it.