在VFP 6.0利用API函数调用Windows格式化磁盘界面


本人在网上看到了用VB调用Windows格式化磁盘界面方法,经本人实践把它移植到 VFP下使用。

函数名:

SHFormatDrive(大小写敏感)

GetActiveWindow(大小写敏感)

SHFormatDrive参数:

SHFormatDrive(窗口句柄,盘符‘从0开始’,0,弹出界面 的功能‘参数为0-3’)

GetActiveWindow函数是获得窗口的句柄。

定义如下:

DECLARE INTEGER SHFormatDrive in "shell32.dll"

INTEGER,INTEGER,INTEGER,INTEGER

DECLARE INTEGER GetActiveWindow IN WIN32API

定义好函数后,即可调用。

例如:SHFormatDrive(getactivewindow(),0,65535,0) > 大家一试便知非常方便。

在Window98 VFP6.0调试通过。

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus