First of all: THANKS A LOT FOR THIS GREAT SOFTWARE!!!
I would like to have the new Windows Vista file dialog in PSPad. Can I do
anything to help implementing it?
Inside my own application, developed with Delphi 7.0 it works fine - also with
additional fields like "open readonly".
This is the code I'm using for it:
procedure ShowOpenDialog;
var
FileDialog: IFileDialog;
FileDialogCustomize: IFileDialogCustomize;
begin
CoCreateInstance(CLSID_FileOpenDialog, nil, CLSCTX_INPROC_SERVER,
IFileOpenDialog, FileDialog);
FileDialog.QueryInterface(
StringToGUID('{8016B7B3-3D49-4504-A0AA-2A37494E606F}'),
FileDialogCustomize);
FileDialogCustomize.AddText(1000, 'My first Test');
FileDialog.Show();
end;
Maybe this could be helpfull for PSPad too. If I can assist further more I would
be happy.
To use it I need the interface devinition:
{$HPPEMIT 'typedef System::DelphiInterface<IFileDialog>
_di_IFileDialog;'}
IFileDialog = interface;
{$EXTERNALSYM IFileDialogCustomize}
{$HPPEMIT 'typedef System::DelphiInterface<IFileDialogCustomize>
_di_IFileDialogCustomize;'}
IFileDialogCustomize = interface(IUnknown)
[SID_IFileDialogCustomize]
function EnableOpenDropDown(dwIDCtl: DWORD): HResult; stdcall;
function AddMenu(dwIDCtl: DWORD; pszLabel: LPCWSTR): HResult; stdcall;
function AddPushButton(dwIDCtl: DWORD; pszLabel: LPCWSTR): HResult;
stdcall;
function AddComboBox(dwIDCtl: DWORD): HResult; stdcall;
function AddRadioButtonList(dwIDCtl: DWORD): HResult; stdcall;
function AddCheckButton(dwIDCtl: DWORD; pszLabel: LPCWSTR; bChecked: BOOL):
HResult; stdcall;
function AddEditBox(dwIDCtl: DWORD; pszLabel: LPCWSTR): HResult; stdcall;
function AddSeparator(dwIDCtl: DWORD): HResult; stdcall;
function AddText(dwIDCtl: DWORD; pszText: LPCWSTR): HResult; stdcall;
function SetControlLabel(dwIDCtl: DWORD; pszLabel: LPCWSTR): HResult;
stdcall;
function GetControlState(dwIDCtl: DWORD; out pdwState: DWORD): HResult;
stdcall;
function SetControlState(dwIDCtl: DWORD; dwState: DWORD): HResult; stdcall;
function GetEditBoxText(dwIDCtl: DWORD; out ppszText: LPCWSTR): HResult;
stdcall;
function SetEditBoxText(dwIDCtl: DWORD; pszText: LPCWSTR): HResult;
stdcall;
function GetCheckButtonState(dwIDCtl: DWORD; out pbChecked: BOOL): HResult;
stdcall;
function SetCheckButtonState(dwIDCtl: DWORD; bChecked: BOOL): HResult;
stdcall;
function AddControlItem(dwIDCtl: DWORD; dwIDItem: DWORD; pszLabel: LPCWSTR):
HResult; stdcall;
function RemoveControlItem(dwIDCtl: DWORD; dwIDItem: DWORD): HResult;
stdcall;
function RemoveAllControlItems(dwIDCtl: DWORD): HResult; stdcall;
function GetControlItemState(dwIDCtl: DWORD; dwIDItem: DWORD; out pdwState:
DWORD): HResult; stdcall;
function SetControlItemState(dwIDCtl: DWORD; dwIDItem: DWORD; dwState:
DWORD): HResult; stdcall;
function GetSelectedControlItem(dwIDCtl: DWORD; out pdwIDItem: DWORD):
HResult; stdcall;
function SetSelectedControlItem(dwIDCtl: DWORD; dwIDItem: DWORD): HResult;
stdcall;
function StartVisualGroup(dwIDCtl: DWORD; pszLabel: LPCWSTR): HResult;
stdcall;
function EndVisualGroup(): HResult; stdcall;
function MakeProminent(dwIDCtl: DWORD): HResult; stdcall;
end;
{ IFileDialog }
TComdlgFilterSpecArray = array of TComdlgFilterSpec;
{$EXTERNALSYM IFileDialog}
IFileDialog = interface(IModalWindow)
[SID_IFileDialog]
function SetFileTypes(cFileTypes: UINT; rgFilterSpec:
TComdlgFilterSpecArray): HResult; stdcall;
function SetFileTypeIndex(iFileType: UINT): HResult; stdcall;
function GetFileTypeIndex(var piFileType: UINT): HResult; stdcall;
function Advise(const pfde: IFileDialogEvents; var pdwCookie: DWORD):
HResult; stdcall;
function Unadvise(dwCookie: DWORD): HResult; stdcall;
function SetOptions(fos: DWORD): HResult; stdcall;
function GetOptions(var pfos: DWORD): HResult; stdcall;
function SetDefaultFolder(const psi: IShellItem): HResult; stdcall;
function SetFolder(const psi: IShellItem): HResult; stdcall;
function GetFolder(var ppsi: IShellItem): HResult; stdcall;
function GetCurrentSelection(var ppsi: IShellItem): HResult; stdcall;
function SetFileName(pszName: LPCWSTR): HResult; stdcall;
function GetFileName(var pszName: LPCWSTR): HResult; stdcall;
function SetTitle(pszTitle: LPCWSTR): HResult; stdcall;
function SetOkButtonLabel(pszText: LPCWSTR): HResult; stdcall;
function SetFileNameLabel(pszLabel: LPCWSTR): HResult; stdcall;
function GetResult(var ppsi: IShellItem): HResult; stdcall;
function AddPlace(const psi: IShellItem; fdap: DWORD): HResult; stdcall;
function SetDefaultExtension(pszDefaultExtension: LPCWSTR): HResult;
stdcall;
function Close(hr: HResult): HResult; stdcall;
function SetClientGuid(const guid: TGUID): HResult; stdcall;
function ClearClientData: HResult; stdcall;
function SetFilter(const pFilter: IShellItemFilter): HResult; stdcall;
end;
--
<http://forum.pspad.com/read.php?2,45907,45907>
PSPad freeware editor http://www.pspad.com