Hello
Can someone give me quick tutorial about how to call and use windows api calls within vb.net 2002? Maybe you could use ExitWindowsEx as an example?
Thanks
Printable View
Hello
Can someone give me quick tutorial about how to call and use windows api calls within vb.net 2002? Maybe you could use ExitWindowsEx as an example?
Thanks
Have a look at this link.
Hi,Quote:
Originally Posted by jesse_mac07
Here's a link with the explanation about ExitWindowsEx and an example;
http://msdn.microsoft.com/library/de...twindowsex.asp
Wkr,
sparrow1
The one big hurdle to get over are the declarations. There is several in my signature where you can get the correct API declarations. The one I use most is APIViewer 2004. It has a .NET mode (if you change it in the options), where it has all of the functions, constants, types, and enumerations all declared for you, you just copy and paste into where you need it. Then its just a matter of finding examples on the net by googling the function you are needing.
Thanks for that....Here is the code that ApiViewer gave me:Quote:
Originally Posted by gigemboy
VB Code:
Declare Function ExitWindowsEx Lib "user32.dll" ( _ ByVal uFlags As Int32, _ ByVal dwReserved As Int32) As Int32
I apologize but as far as api calls this is my first venture. So here are my next questions:
Where do I plug that into my app?
How do I call it from within a function?
Thanks!
You just paste that into your form outside of any declarations, then call the function with the parameters you want...
The ReturnValue, which you may need or not need, is then held in the variable...VB Code:
Dim ReturnValue as Integer = ExitWindowsEX(SomeInteger, SomeInteger)
It is a method declaration like any other. You put it anywhere you can put method declarations, like in a class or module definition, and you call it like you do any other method.
Thanks for the help I got it to work just like I wanted it to!
Cool. Don't forget to resolve your thread from the Thread Tools menu.