PDA

Click to See Complete Forum and Search --> : Calling a new procedure after API completes


DG
Oct 31st, 2000, 03:25 PM
I am using the SHFormat drive API. I want to call a disk check routine when the API is complete. How can I postpone the call function until the API completes?

Code:
Private Sub Command5_Click()
Dim rtn As String
Dim Buffer As String
Dim WinPath As String

Buffer = String(255, 0)
rtn = GetWindowsDirectory(Buffer, Len(Buffer))
WinPath = Left(Trim(Buffer), rtn)
rtn = Shell(WinPath + "\rundll32.exe shell32.dll,SHFormatDrive", 1)
Call DiskCheck 'Need to wait here!!!!!
End Sub

Your help would be appreciated

Oct 31st, 2000, 06:44 PM
Add a DoEvents.

DoEvents will wait until all code above is processed before processing to the next code.