I found this one in the api veiwer tool.
It requirs :
1.pathname-easy
2.SECURITY_ATTRIBUTES
what do i write in the second one?
Public Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Printable View
I found this one in the api veiwer tool.
It requirs :
1.pathname-easy
2.SECURITY_ATTRIBUTES
what do i write in the second one?
Public Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
AS I put in your thread in General VB
Why not use MkDir
anyway answering ur question:
VB Code:
Private Declare Function CreateDirectory Lib "kernel32.dll" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long Private Type SECURITY_ATTRIBUTES nLength As Long lpSecurityDescriptor As Long bInheritHandle As Long End Type Private Sub Form_Load() Dim secAttr As SECURITY_ATTRIBUTES ' security attributes structure Dim retval As Long ' return value secAttr.nLength = Len(secAttr) ' size of the structure secAttr.lpSecurityDescriptor = 0 ' default (normal) level of security secAttr.bInheritHandle = 1 ' this is the default setting ' Create the directory. retval = CreateDirectory("C:\NewDir", secAttr) End Sub
da_silvy, since we're not really using SECURITY_ATTRIBUTES structure, you can shorten you code to this:
VB Code:
Private Declare Function CreateDirectory Lib "kernel32.dll" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As Any) As Long Private Sub Command1_Click() CreateDirectory "C:\NewDir", 0 End Sub
Cool,
Where can i find out more about the API and it's functions?
And MSDN is the best, but it's not aimed at VB.
I know those sites,
That's where i got the ^^^ above example.
I wanted sites which cut to the chase
etc.
MSDN is good, if you can work out how to put C++ in VB :rolleyes: