Results 1 to 2 of 2

Thread: Calling a new procedure after API completes

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    USA
    Posts
    6

    Question

    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

  2. #2
    Guest
    Add a DoEvents.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width