CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: format a disk

  1. #1
    Join Date
    Nov 1999
    Location
    France
    Posts
    29

    format a disk

    I want to format a 1.44Mo disk from a VB form.
    I wrote a code with the shell function:
    Call Shell("c:\winnt\system32\format.com a: /V:vol_32 ", vbNormalFocus)
    This method is not very smart and open a MSDOS prompt, which is not so cool in a windows application!!!
    Is there an ActiveX which can do that?
    How can i launch the format utility of the Explorer from a VB App??
    Thanks

    Fzz



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: format a disk

    to launch the shell's format function:

    option Explicit
    private Declare Function SHFormatDrive Lib "shell32.dll" (byval hwnd as Long, _
    byval drive as Long, _
    byval fmtid as Long, _
    byval options as Long) as Long
    private Sub Command1_Click()

    Dim l as Long
    l = SHFormatDrive(me.hwnd, 0, &HFFFF, 0)
    End Sub





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

Featured