Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.10.17;
Скачать: CL | DM;

Вниз

Окно свойств объекта файловой системы   Найти похожие ветки 

 
DelphiN! ©   (2004-09-11 08:05) [0]

Как вызвать окно свойств(которое вызывается кликаньем на подменю Свойства контексного меню объекта), если известен путь к объекту


 
GuAV ©   (2004-09-11 10:25) [1]

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;


 
DelphiN! ©   (2004-09-13 07:56) [2]

Почему-то не работает ф-ия, нашел ее описание в 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х?


 
DelphiN! ©   (2004-09-17 07:49) [3]

Ну же народ..


 
begin...end ©   (2004-09-17 12:49) [4]

Насколько я помню, для показа диалога свойств можно также использовать 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 20:29) [5]

Big Thx!



Страницы: 1 вся ветка

Текущий архив: 2004.10.17;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.036 c
8-1090686879
fess
2004-07-24 20:34
2004.10.17
Компоненты для работы с графикой


1-1095883102
Homa_Programer
2004-09-22 23:58
2004.10.17
delphi и Word


10-1050070965
Aleksandr
2003-04-11 18:22
2004.10.17
Ну не пойму я никак, как сделать разрешение/запрет на соединение!


3-1095927489
Иванов Сергей
2004-09-23 12:18
2004.10.17
Чем пользоваться для доступа к DBF+IDX


1-1096913802
Igor_
2004-10-04 22:16
2004.10.17
StringGrid и CheckBox