Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

MW-Menu

 

Free Visual BASIC Newsletter

Features

Tips

Sample Code

Newsletters

Products

ActiveX

Cool Links

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How to List the Drives on the Current System, the Easy Way

You can do this using the SendMessage API, like below:

Public Const LB_DIR = &H18D
Public Const DDL_DRIVES = &H4000

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Public Function AddDrives2ListBox(lhWnd As Long)
    Call SendMessage(lhWnd, LB_DIR, DDL_DRIVES, "*")
End Function


Call by using

AddDrives2ListBox(<ListBox>.hWnd)

Home

___________________________________________

Send Bugs, comments to the webmaster at webmaster@mwe.8m.com

Terms of Use

© 1999 MW Software, all rights reserved