Guidance
指路人
g.yi.org
software / RapidQ / Examples / Devices / format.bas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
'API Windows
' Format.bas for RapidQ
' Coded by Gérald VERDIER - BinoclaR (°-°) software
' February 2004
' email : gerald.verdier@club-internet.fr
' PURPOSE : Format Floppy or HDD

     CONST SHFMT_ID_DEFAULT = 0

'********************************************************************************
     DECLARE FUNCTION SHFormatDrive LIB "shell32.dll" ALIAS "SHFormatDrive" ( hwnd AS LONG,  drive AS INTEGER,  fmtID AS INTEGER,  options AS INTEGER) AS LONG

     DECLARE SUB Button1Click (Sender AS QBUTTON)

     CREATE Form AS QFORM
      CAPTION = "Form1"
      Width = 320
      Height = 240
      Center
      CREATE Button1 AS QBUTTON
       CAPTION = "Format this floppy disk"
       Left = 20
       Top = 149
       width = 280
       OnClick = Button1Click
      END CREATE
     END CREATE

     Form.SHOWMODAL

     SUB Button1Click (Sender AS QBUTTON)
      DIM Réponse AS LONG
    '
    'Drives :
    '0 = A:
    '1 = B:
    '
    '2 = C:
    '...
    '
    'only SHFMT_ID_DEFAULT.
    '
    'Numéros des options :
    '0 =  complete
    '1 =  quick
    '2 = Floppy boot MS-DOS
    '
    'Certains options don't run

      Ret = SHFormatDrive(hwnd, 0, SHFMT_ID_DEFAULT, 0)
      IF Réponse = 0 THEN
       SHOWMESSAGE("Success !")
      ELSE
       SHOWMESSAGE("Impossible to do this operation" & CHR$(13) & "Error.")
      END IF
    '
    'Results :
    '0 = Success
    '-1 = Cancel or Error
     END SUB

掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2019-4-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:40:53