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

Вниз

Как пользоваться функцией PickIconDlg?   Найти похожие ветки 

 
Dimaxx   (2003-07-11 23:05) [0]

Сабж. Функция валяется в shell32.dll. В хелпе по пятой дельфе ничего нет и в shellapi не прописана. Но она есть!


 
Suntechnic   (2003-07-11 23:36) [1]

А проблема то в чём? LoadLibrary и GetProcAddress разве уже отменили?


 
Nevermind   (2003-07-12 22:11) [2]



function
PickIconDlg(hOwner: THandle; szFilename: PWideChar; MaxPath: Integer; var
llpIconIndex: integer): bool; stdcall; external "shell32.dll" name "PickIconDlg"; //index 62;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
IconIndex: Integer;
FileName: string;

function CallPickIconDialog(var FileName: string; var IconIndex: Integer): boolean;
var
Path: PWideChar;
begin
Path := AllocMem(MAX_PATH);
try
StringToWideChar(PChar(FileName), Path, Max_Path);
Result := PickIconDlg(0, Path, MAX_PATH, IconIndex);
if Result then
FileName := WideCharToString(Path);
finally
FreeMem(Path, MAX_PATH);
end;
end;

begin
FileName := "C:\Windows\System32\Shell32.dll";
if CallPickIconDialog(FileName, IconIndex) then
( Format("FileName: %s"#13#10"IconIndex: %d", [FileName, IconIndex])

function
PickIconDlg(hOwner: THandle; szFilename: PWideChar; MaxPath: Integer; var
llpIconIndex: integer): bool; stdcall; external "shell32.dll" name "PickIconDlg"; //index 62;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
IconIndex: Integer;
FileName: string;

function CallPickIconDialog(var FileName: string; var IconIndex: Integer): boolean;
var
Path: PWideChar;
begin
Path := AllocMem(MAX_PATH);
try
StringToWideChar(PChar(FileName), Path, Max_Path);
Result := PickIconDlg(0, Path, MAX_PATH, IconIndex);
if Result then
FileName := WideCharToString(Path);
finally
FreeMem(Path, MAX_PATH);
end;
end;

begin
FileName := "C:\Windows\System32\Shell32.dll";
if CallPickIconDialog(FileName, IconIndex) then
ShowMessage(Format("FileName: %s"#13#10"IconIndex: %d", [FileName, IconIndex]));
end;



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

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

Наверх




Память: 0.45 MB
Время: 0.009 c
14-33749
Marser
2003-08-20 21:30
2003.09.11
Довольно полный список


1-33685
wl
2003-08-29 12:00
2003.09.11
ищу алгоритм построения


1-33668
BorisKB
2003-08-29 11:49
2003.09.11
PopupMenu в PageControl


3-33522
MakNik
2003-08-19 15:58
2003.09.11
uniqueidentifier


3-33440
Новенький
2003-08-21 09:47
2003.09.11
Автоматическое обновление грида.





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский