|
-
Apr 9th, 2006, 12:27 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [02/03] Windows API
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
Jesse Bunch
www.getbunch.com/
If I have helped you, please rate my posts!
Unless otherwise indicated, I am using the following Products:
Visual Studio .NET 2010
.NET Framework 4.0
-
Apr 9th, 2006, 01:05 PM
#2
Fanatic Member
Re: [02/03] Windows API
Have a look at this link.
Using VB.NET 2003/.NET 1.1/C# 2.0
http://del.icio.us/rajoo
Blow your mind, smoke gunpowder
Ashes to ashes, dust to dust
If God won't have you, the devil will. - Author unknown
Don't follow me, I'm lost too ...
-
Apr 9th, 2006, 01:10 PM
#3
Re: [02/03] Windows API
 Originally Posted by jesse_mac07
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
Hi,
Here's a link with the explanation about ExitWindowsEx and an example;
http://msdn.microsoft.com/library/de...twindowsex.asp
Wkr,
sparrow1
-
Apr 9th, 2006, 06:15 PM
#4
Re: [02/03] Windows API
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.
-
Apr 9th, 2006, 07:38 PM
#5
Thread Starter
Addicted Member
Re: [02/03] Windows API
 Originally Posted by gigemboy
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:
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!
Jesse Bunch
www.getbunch.com/
If I have helped you, please rate my posts!
Unless otherwise indicated, I am using the following Products:
Visual Studio .NET 2010
.NET Framework 4.0
-
Apr 9th, 2006, 07:47 PM
#6
Re: [02/03] Windows API
You just paste that into your form outside of any declarations, then call the function with the parameters you want...
VB Code:
Dim ReturnValue as Integer = ExitWindowsEX(SomeInteger, SomeInteger)
The ReturnValue, which you may need or not need, is then held in the variable...
-
Apr 9th, 2006, 07:49 PM
#7
Re: [02/03] Windows API
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.
-
Apr 9th, 2006, 08:47 PM
#8
Thread Starter
Addicted Member
Re: [02/03] Windows API
Thanks for the help I got it to work just like I wanted it to!
Jesse Bunch
www.getbunch.com/
If I have helped you, please rate my posts!
Unless otherwise indicated, I am using the following Products:
Visual Studio .NET 2010
.NET Framework 4.0
-
Apr 9th, 2006, 09:14 PM
#9
Re: [02/03] Windows API
Cool. Don't forget to resolve your thread from the Thread Tools menu.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|