如何在FileDialog OnTypeChange事件中獲取FileDialog的FileTypeIndex?如何在TFileDialog.OnTypeChange事件中獲取piFileType
function TFileDialogEvent.OnTypeChange(const pfd: IFileDialog):
HResult; stdcall;
var
iCaption: string;
iFilename: PWideChar;
begin
{Get the current filename}
pfd.GetFileName(iFilename);
{Get the classname of the dialog to set the caption}
if FClassName = 'TIEWin7FileOpenDialog' then
iCaption := 'Open- ' + iFilename
else
iCaption := 'Save As- ' + iFilename;
pfd.SetTitle(PWideChar(iCaption));
FileTypeIndex := pfd.GetFileTypeIndex(???);
end;
'var FileTypeIndex:UINT;如果成功則開始(pfd.GetFileTypeIndex(FileTypeIndex))然後{你得到它}結束;'。 – TLama
這應該清楚從MSDN文檔。 –
仍然需要第二個問題的答案......我爲此開發了一個新問題。 – Bill