DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   CreateDirectory (http://www.daniweb.com/forums/thread157070.html)

indian143 Nov 13th, 2008 6:03 am
CreateDirectory
 
Hi All,

I have to create a directory by using Windows API, can anybody give me small code snippet for this. I am able to do it File System Objet but want to do it by using Win API.
Can any body atleast tell me in which class or dll this will be available or a small code snippet if possible.

Thanks,
Aleem Mohammad.

Teme64 Nov 13th, 2008 2:37 pm
Re: CreateDirectory
 
Why don't you use
MkDir "C:\TempDir"
Ok. If you want to do it hard way:
Private Declare Function CreateDirectory Lib "shell32.dll" Alias "SHCreateDirectoryExA" (ByVal hwnd As Long, ByVal pszPath As String, ByVal psa As Any) As Long

CreateDirectory Me.hWnd, "C:\TempDir", Nothing
just make sure to check return value for errors.


All times are GMT -4. The time now is 8:43 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC