Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 3 odgovora
  • 2.905 pregleda

Najnovija ↓

ExtractAssociatedIcon - any other way to do it? 07.10.2005. u 14:02 · pre 256 meseci #1
kako da extractujem icon iz .exe filea a da ne koristim ExtractAssociatedIcon? imam nekih problema sa tom komandom ne izvlaci ikonice kako valja..
btw zna li ko u cemu je problem sa krstaricom? mogu samo preko jave da se konektujem...znam da ovo nema veze sa topicom ali eto svejedno...
Re: ExtractAssociatedIcon - any other way to do it? 07.10.2005. u 14:28 · pre 256 meseci #2
Citat:
Delphi help:

The ExtractIconEx function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.

HICON ExtractIconEx(

LPCSTR lpszFile,
int nIconIndex,
HICON FAR * phiconLarge,
HICON FAR * phiconSmall,
UINT nIcons
);


Parameters

lpszFile

Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.

nIconIndex

Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1 and phIconLargeand phiconSmall are both NULL, the function returns the total number of icons in the specified file.

phiconLarge

Pointer to an array of handles of large icons returned. This parameter can be NULL.

phiconSmall

Pointer to an array of handles of small icons returned. This parameter can be NULL.

nIcons

Specifies the count of the number of icons to extract.



Return Values

If the function succeeds, the return value is the handle to an icon. If the file specified was not an executable file, DLL, or icon file, the return value is 1. If no icons were found in the file, the return value is NULL.


offtopic:
Krstarica radi ok.
Potpis
Play Store
Re: ExtractAssociatedIcon - any other way to do it? 07.10.2005. u 15:49 · pre 256 meseci #4
anyway opet problem...evo o cemu se radi. pravim neki program za igraonice. i sad radim na nekoj opciji koja izvlaci iz desktopa sve .lnk filove dolazi do njihovih .exe i iz njih izvlaci ikonice. ikonica se cuva u \icons\nazivexefile.exe.ico e sad kad kompajliram program i pokusham da izvucem ikonicu on crashuje i javlja 'icon not valid' a neam blage zasto. evo koda:

Code:

procedure Tform2.geticon(exe: string);
var
hLarge,
hSmall: hIcon;
begin
ExtractIconEx(pChar(exe), -1, hLarge, hSmall, 1); //uzima ikonicu iz exefilea
      icon.Handle:=hsmall; //ucitava iconicu
      icon.SaveToFile(ExtractFilePath(Application.ExeName) + 'icons\' +
      ExtractFileName(exe) + '.ico'); //cuva je u icons\
      icon.ReleaseHandle; //nisam siguran da je ovo uopste potrebno...
      edit7.Text:=ExtractFilePath(Application.ExeName) + 'icons\' + ExtractFileName(exe) + '.ico'; // u edit7 upisuje putanju do ikonice
end;

????
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme