Guidance
指路人
g.yi.org
software / rapidq / Examples / File & Directory / Send to Recycle Bin.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'From:   "terranulli" Sun Jul 27, 2003  5:09 pm
'send file to Recycle Bin

     CONST FO_DELETE = &H3
     CONST FOF_NOCONFIRMATION = &H10
     CONST FOF_ALLOWUNDO = &H40

     TYPE SHFILEOPSTRUCT
      hWnd AS LONG
      wFunc AS LONG
      pFrom AS LONG
      pTo AS LONG
      fFlags AS INTEGER
      fAborted AS LONG
      hNameMaps AS LONG
      sProgress AS LONG
     END TYPE

     DECLARE FUNCTION SHFileOperationAPI LIB "shell32" ALIAS _
      "SHFileOperationA" (lpFileOp AS SHFILEOPSTRUCT) AS LONG

     DIM s AS STRING, t AS STRING
     s = FileName & NULL & NULL
     t = NULL & NULL

     DIM shOP AS SHFILEOPSTRUCT
     shOP.hwnd = Application.Handle
     shOP.wFunc = FO_DELETE
     shOP.fFlags = FOF_NOCONFIRMATION OR FOF_ALLOWUNDO
     shOP.pFrom = VARPTR(s)
     shOP.pTo = VARPTR(t)
     SHFileOperationAPI(shOP)
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2023-1-27  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2003-07-28 07:24:36