F
frogking
Unregistered / Unconfirmed
GUEST, unregistred user!
为了实现删除文件
我参考书上的例子代码为:
procedure TForm1.Button1Click(Sender: TObject);
var opStruct:TSHFileOpSTRUCT;
begin
with opStruct do begin
Wnd:=0;
wFunc:=FO_DELETE;
pFrom:=PChar(DirectoryListBox1.Directory+'/'+Edit1.Text);
fFlags:=FOF_ALLOWUNDO;
end;
showMessage(opStruct.pFrom);
SHFileOperation(opStruct);
end;
为了弄清代码含义
我查看Delphi的帮助Windows SDK中看到:
WINSHELLAPI int WINAPI SHFileOperation( LPSHFILEOPSTRUCT lpFileOp);
typedef struct _SHFILEOPSTRUCT { // shfos
HWND hwnd;
UINT wFunc;
LPCSTR pFrom;
LPCSTR pTo;
FILEOP_FLAGS fFlags;
BOOL fAnyOperationsAborted;
LPVOID hNameMappings;
LPCSTR lpszProgressTitle;
} SHFILEOPSTRUCT, FAR *LPSHFILEOPSTRUCT;
问题是我怎么知道
var opStruct:TSHFileOpSTRUCT;这一句?
我怎么知道Delphi中的数据类型与Windows API中的数据类型的对应关系?
恳请高手指导!
我参考书上的例子代码为:
procedure TForm1.Button1Click(Sender: TObject);
var opStruct:TSHFileOpSTRUCT;
begin
with opStruct do begin
Wnd:=0;
wFunc:=FO_DELETE;
pFrom:=PChar(DirectoryListBox1.Directory+'/'+Edit1.Text);
fFlags:=FOF_ALLOWUNDO;
end;
showMessage(opStruct.pFrom);
SHFileOperation(opStruct);
end;
为了弄清代码含义
我查看Delphi的帮助Windows SDK中看到:
WINSHELLAPI int WINAPI SHFileOperation( LPSHFILEOPSTRUCT lpFileOp);
typedef struct _SHFILEOPSTRUCT { // shfos
HWND hwnd;
UINT wFunc;
LPCSTR pFrom;
LPCSTR pTo;
FILEOP_FLAGS fFlags;
BOOL fAnyOperationsAborted;
LPVOID hNameMappings;
LPCSTR lpszProgressTitle;
} SHFILEOPSTRUCT, FAR *LPSHFILEOPSTRUCT;
问题是我怎么知道
var opStruct:TSHFileOpSTRUCT;这一句?
我怎么知道Delphi中的数据类型与Windows API中的数据类型的对应关系?
恳请高手指导!