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")