begin process at 2012 05 29 09:14:45
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive C/C++

 > 

Archives

 > 

Graphique

 > 

Icon fichier


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

Icon fichier

jeudi 26 mai 2005 à 17:33:39 | Icon fichier

abdoulax

Est ce que qlq1 sait comment récupérer les icones utiliser par les diférents fichiers, pour l'utiliser dans une liste fichier avec leur icones approprié ?

Merci

Have Fun ...
jeudi 26 mai 2005 à 17:44:50 | Re : Icon fichier

ymca2003

ExtractIcon

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

To retrieve an array of handles to large or small icons, use the ExtractIconEx function.

HICON ExtractIcon(
  HINSTANCE hInst,          // instance handle
  LPCTSTR lpszExeFileName,  // filename of file with icon
  UINT nIconIndex           // index of icon to extract
);
 

Parameters

hInst
Handle to the instance of the application calling the function.
lpszExeFileName
Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.
nIconIndex
Specifies the zero-based index of the icon to retrieve. For example, if this value is 0, the function returns a handle to the first icon in the specified file.

If this value is –1, the function returns the total number of icons in the specified file. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ICO file, the return value is 1.

Windows 95, Windows NT 4.0, and later: If this value is a negative number not equal to -1, the function returns a handle to the icon in the specified file whose resource identifier is equal to the absolute value of nIconIndex. For example, use -3 to extract the icon whose resource identifier is 3. To extract the icon whose resource identifier is 1, use the ExtractIconEx function.

Return Values

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

Remarks

You must destroy the icon handle returned by ExtractIcon by calling the DestroyIcon function.



 

ExtractAssociatedIcon

The ExtractAssociatedIcon function returns a handle to an indexed icon found in a file or an icon found in an associated executable file.

HICON ExtractAssociatedIcon(
  HINSTANCE hInst,    // application instance handle
  LPTSTR lpIconPath,  // path and filename of file for which icon is 
                      // wanted
  LPWORD lpiIcon      // pointer to icon index
);
 

Parameters

hInst
Specifies the instance of the application calling the function.
lpIconPath
Pointer to a string that specifies the full path and filename of the file for which an icon is desired. The function extracts the icon handle from that file, or from an executable file associated with that file.

If the icon handle is obtained from an executable file, the function stores the full path and filename of that executable in the string pointed to by lpIconPath.

lpiIcon
Pointer to a WORD that specifies the index of the icon whose handle is to be obtained.

If the icon handle is obtained from an executable file, the function stores the icon's identifier in the WORD pointed to by lpiIcon.

Return Values

If the function succeeds, the return value is an icon handle. If the icon is extracted from an associated executable file, the function stores the full path and filename of the executable file in the string pointed to by lpIconPath, and stores the icon's identifier in the WORD pointed to by lpiIcon.

If the function fails, the return value is NULL.

Remarks

The ExtractAssociatedIcon function first looks for the indexed icon in the file specified by lpIconPath. If the function cannot obtain the icon handle from that file, and the file has an associated executable file, it looks in that executable file for an icon. Associations with executable files are based on filename extensions, are stored in the per-user part of the registry, and can be defined using File Manager's Associate command.



Cette discussion est classée dans : fichier, icones, utiliser, icon


Répondre à ce message

Sujets en rapport avec ce message

Utiliser des icones en C++ [ par WuKoDLaK ] Bijour , je voudrais savoir si qqun saurait comment on utiliseles icones avec Visual c++ dumoins pour par exemple lors de l'appel d'une méthode spécif Utiliser un plugin (en dll) [ par CyberP ] Comment utiliser un plugin ? Le charger et utiliser les fonctions qui sont à l'intérieur ?Je compile un fichier en dll avec une fonction "dire_bonjour utiliser GetTempPath pour ecrire un fichier [ par elroulianito ] Voila une petite question toute bête:je désire écrire dans un fichier en utilisant les flux de la classe fstream.habituellement je procède comme ceci: comment utiliser tga pour ecriture/lecture image [ par jfk20004 ] j'ai recuperé le fichier qui designe les differents bytes d'un fichier tga:j'aimerais savoir comment faire un prog qui permet de lire et ecrire un fic Recuperer l'icon associer a un type de fichier [ par PinkRabbit84 ] Comment fait-on pour recuperer l'icone associer a un type de fichier pour pourvoir ensuite l'afficher dans un TREEVIEW ou un LISTVIEW.Merci d'avancePi utiliser fichier .ini avec Visual C++ [ par Pindus ] J utilise un fichier texte pour tracer (et traiter) des courbesj aimerais associer l ouverture du fichier ini au tracé de la courbecar pour le moment Comment on fait pour utiliser la SDL avec GTK+ ?? [ par Rouliann ] Bonjour tout le monde! Malgré mes nombreuses recherches sur le web, je n'ai trouvé aucune information concernant une possible utilisation de la SDL av icon sur un type de fichier [ par minet03 ] Coucou, mon application lit un type de fichier (.qqc) et j'aimerai bien y assigner la même icon que mon programme. Seulement je ne sais pas par où pas Rassembler plusieurs fichiers avec des #defines. [ par kaervas ] Bonjour, je galere un peu avec les #defines, en effet j'ai 4 fichiers dont 3 identiques a l'exeption des defines qui sont differents, je ne sais pas t Cluster occupé par un fichier [ par SaNcOdeR ] Bonjour,comment avoir la liste de tous les cluster occupés par un fichier ??? je crois qu'il faut utiliser "DeviceIoControl" mais je ne sais pas comme


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,608 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales