API在VB中应用之技巧集锦[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 icemanpro 的 blog

     end function
    
    
     23、如何将文件放入回收站?
    
     **api函数声明
     public type shfileopstruct
     hwnd as long
     wfunc as long
     pfrom as string
     pto as string
     fflags as integer
     fanyoperationsaborted as long
     hnamemappings as long
     lpszprogresstitle as long
     end type
     public declare function shfileoperation lib _ "shell32.dll" alias "shfileoperationa" (lpfileop as shfileopstruct) as long
     public const fo_delete = &h3
     public const fof_allowundo = &h40
     注释:调用
     dim shop as shfileopstruct, strfile as string
     with shop
     .wfunc = fo_delete
     .pfrom = strfile + chr(0)
     .fflags = fof_allowundo
     end with
    
    
     24、vb中如何使用未安装的字体?
     declare function addfontresource lib "gdi32" alias "addfontresourcea" (byval lpfilename as string) as long
     declare function removefontresource lib "gdi32" alias "removefontresourcea" (byval lpfilename as string) as long
     增加字体:
     dim lresult as long
     lresult = addfontresource("c:myappmyfont.ttf")
     删除字体:
     dim lresult as long
     lresult = removefontresource("c:myappmyfont.ttf")


本文关键:API在VB中应用之技巧集锦
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top