Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Status
Not open for further replies.

SiaMeX

Programmer
Jul 31, 2003
28
0
0
US
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Is there any way to use win32 APIs in VB??? what i mean is importing and using it.if there is, would you please give a very simple code... thanks

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~SiaMeX~
 
It is easy to add Win32 API functions to VB. You need to find the declarations for the functions you want and add them your project. Look up "Accessing the Microsoft Windows API" in the help.

An excellent book on the subject is Dan Appleman's "Visual Basic Programmer's Guide to the Win32 API".

Hope this helps.

Daren


Must think of a witty signature
 
Mr. SiaMex ,
Please use a meaning subject in future for better response.

Good Luck

Vikram
 
Here is a complete sample code for sleep function of kernel32 library .just copy and past to your new vbproject

'This project needs a button
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Me.Caption = "Your system will sleep 5 sec."
'Sleep for 5000 milliseconds
Sleep 5000
Me.Caption = ""
End Sub
Private Sub Form_Load()
Me.Caption = ""
Command1.Caption = "Sleep ..."
End Sub

for detailed help search on this site is all about api.many tutorials and sample codes are available.you can download a software for api reference. in that you can get visual basic examples of almost all APIs.try this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top