![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Окно свойств объекта файловой системы
DelphiN! © (2004-09-11 08:05:00)Как вызвать окно свойств(которое вызывается кликаньем на подменю Свойства контексного меню объекта), если известен путь к объекту
DelphiN! (2004-09-17 20:29:00) [1]Big Thx!
begin...end (2004-09-17 12:49:00) [2]Насколько я помню, для показа диалога свойств можно также использовать ShellExecuteEx (в структуре TShellExecuteInfo параметр lpVerb должен быть равен 'properties').
Например, вот так можно вывести диалог свойств для файла:
uses ShellAPI;
procedure ShowFileProperties(const FileName: String);
var
Info: TShellExecuteInfo;
begin
ZeroMemory(@Info, SizeOf(Info));
with Info do
begin
cbSize := SizeOf(Info);
lpFile := PChar(FileName);
lpVerb := 'properties';
fMask := SEE_MASK_INVOKEIDLIST;
end;
ShellExecuteEx(@Info);
end;
Конечно, желательно добавить там проверку значения, возвращаемого ShellExecuteEx.
DelphiN! (2004-09-17 07:49:00) [3]Ну же народ..
DelphiN! (2004-09-13 07:56:00) [4]Почему-то не работает ф-ия, нашел ее описание в MSDN:
BOOL SHObjectProperties(
HWND hwnd,
DWORD dwType,
LPCWSTR szObject,
LPCWSTR szPage
);
Parameters
hwnd
[in] The HWND of the window that will be the parent of the dialog box.
dwType
[in] A flag value that specifies the type of object, and whether the dialog box is modal.
SHOP_PRINTERNAME
szObject contains the friendly name of a printer.
SHOP_FILEPATH
szObject contains a fully qualified file name.
SHOP_VOLUMEGUID
szObject contains a volume globally unique identifier (GUID).
szObject
[in] A NULL-terminated Unicode string that contains the object name. The contents of the string are determined by which of the first three flags are set in dwType.
szPage
[in] A NULL-terminated Unicode string that contains the name of the property sheet page to be initially opened. Set this parameter to NULL to specify the default page.
Где узнать значение параметра SHOP_FILEPATH?
Вызов ф-ии с параметром(dwType) = 2 не дает никаких результатов(ф-ия возвращает false), с параметром = 4, вызывается пустое окно свойств. С каким параметром вызвать ф-ию, чтобы она работала, для файлов, путь к которым указан в szObject?
Так-же минимальной потдерживаемой ОС для ф-ии является Win2000, как осуществить тоже самое и для 9х?
GuAV (2004-09-11 10:25:00) [5]function SHObjectProperties(hwndOwner: HWND;
uFlags: Integer; lpstrName,
lpstrParameters: PChar): LongBool; stdcall;
external shell32 index 178;
procedure Properties(const FileName: string);
begin
SHObjectProperties(Application.Handle, 2,
PChar(FileName), nil);
end;