IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C++Builder Discussion :

liste fichiers (TListView) avec icones


Sujet :

C++Builder

  1. #1
    pjb
    pjb est déconnecté
    Futur Membre du Club
    Inscrit en
    Juin 2005
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 5
    Points : 6
    Points
    6
    Par défaut liste fichiers (TListView) avec icones
    bonjour tout le monde

    je cherche un moyen simple et efficasse de lister des fichiers d'un répertoire dans une TListView (bon ça OK c'est facile...) et d'afficher (SUROUT) aussi les icones de ses fichiers correspondant à leur type (comme si on était par exemple dans l'explorateur)...

    quelqu'un aurait une idée ?
    y a t-il moyen de récupérer dynamiquement une sorte de liste contenant icone + extensions des fichiers correspondant ? >>> ça résoudrait le problème...

  2. #2
    Rédacteur/Modérateur
    Avatar de Trap D
    Profil pro
    Inscrit en
    Septembre 2003
    Messages
    4 942
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2003
    Messages : 4 942
    Points : 6 498
    Points
    6 498
    Par défaut
    Regarde du côté de ExtractAssociatedIcon

    Citation Envoyé par MSDN
    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, // file name
    LPWORD lpiIcon // icon index
    );
    Parameters
    hInst
    [in] Specifies the instance of the application calling the function.
    lpIconPath
    [in] Pointer to a string that specifies the full path and file name of the file that contains the icon. 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 file name of that executable in the string pointed to by lpIconPath.

    lpiIcon
    [in] 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 file name 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 file name extensions, are stored in the per-user part of the registry, and can be defined using File Manager's Associate command.

    Requirements
    Windows NT/2000 or later: Requires Windows NT 3.5 or later.
    Windows 95/98/Me: Requires Windows 95 or later.
    Header: Declared in Shellapi.h.
    Library: Use Shell32.lib.
    Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
    "La haine seule fait des choix" - Koan Zen
    "Il ne faut pas être meilleur que les autres, il faut être meilleur que soi." Albert Jacquard
    "Ceux qui savent où ils ont posé leur parapluie ne sont pas alcooliques." - pgibonne.
    Faites du Prolog, ça vous changera les idées !
    Ma page Prolog
    Mes codes sources commentés

    Mon avatar : La Madeleine à la veilleuse de Georges de La Tour

  3. #3
    pjb
    pjb est déconnecté
    Futur Membre du Club
    Inscrit en
    Juin 2005
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 5
    Points : 6
    Points
    6
    Par défaut
    merci beaucoup !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. VBNet : Remplir combobox avec liste fichier
    Par biquet dans le forum VB.NET
    Réponses: 2
    Dernier message: 24/01/2011, 15h18
  2. Réponses: 0
    Dernier message: 09/11/2010, 09h56
  3. Réponses: 0
    Dernier message: 24/03/2010, 15h30
  4. FTP Problème avec commons net récuperation de la liste fichier
    Par reverse_engineer dans le forum Entrée/Sortie
    Réponses: 2
    Dernier message: 05/08/2008, 15h58
  5. Pb listing fichiers avec FTPCli
    Par bcandel dans le forum Delphi
    Réponses: 3
    Dernier message: 26/09/2006, 10h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo