Jump to content

GUIImageList - how to check if an image is already in the list?


Recommended Posts

If I'm adding icons into an image list from .exe files, how can I check if a certain exe file is already in the list?

Example:

#include <GuiImageList.au3>

Global $hImage = _GUIImageList_Create(16, 16, 5)
_GUIImageList_AddIcon($hImage, "C:\path\to\somefile1.exe", 0)
_GUIImageList_AddIcon($hImage, "C:\path\to\somefile2.exe", 0)
_GUIImageList_AddIcon($hImage, "C:\path\to\somefile3.exe", 0)
_GUIImageList_AddIcon($hImage, "C:\path\to\somefile2.exe", 0) ; how to check if this icon is already in the ImageList instead of having it there twice?

I'd like to be able to avoid adding icons to the list that have already been added to list. And possibly even tell me the index of the exisiting image in the ImageList.

Link to comment
Share on other sites

Write all your paths to an array, make the array unique and add those files to the image list.

 

Br,

UEZ 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...