Jump to content

How to have a IconDll, and it's number in a variable (string)


 Share

Recommended Posts

How would you do this? I have a dll, and using a for/next loop, and I need to use the default icon string to the .dll?

Sample Code:

Switch $ext
        Case ".exe", ".scr"
            If Not FileHasIcons($file) Then
                $iconFile = $IconDll & 020;this is where I need to define the $IconDll and it's icon, 020.
                $iconIndexId = 0;
                Return;
            EndIf
            
            $iconFile = $file;
            $iconIndexId = 0;
            Return;
        Case ".ico"
            $iconFile = $file;
            $iconIndexId = 0;
            Return;
        Case ".lnk"
            Local $shortcutInfo = FileGetShortcut($file);
            
            Local $iconFileName = $shortcutInfo[4];
            Local $iconIndex = $shortcutInfo[5];
            
            $iconFile = $iconFileName;
            $iconIndexId = $iconIndex;
            Return;
        
    EndSwitch

Thanks everyone and the AutoIt team, for helping me solve these simple problems!

Link to comment
Share on other sites

It's probably that people don't understand what you're asking.

Are you asking how to store the dll path and the icon index in a single string? If so, all you need to do is concatenate the two values, preferably with a value that can later be used as a delimiter.

$sDllPath = "H:\Windows\user32.dll"
$iIconIndex = 20
$sIconFile = $sDllPath & "|" & $iIconIndexoÝ÷ Ù:+zÚâz÷­ëp¢ö¥¹ë2¢ì(ºWljeÊ$­®)àJb·ø¢µ«­¢+ØÀÌØíÍ%½¹¥±AÉÑÌôMÑÉ¥¹MÁ±¥Ð ÀÌØíÍM½µMÑÉ¥¹°ÅÕ½ÐíðÅÕ½Ðì¤(ÀÌØí¥%½¹%¹àô%¹Ð ÀÌØíÍ%½¹¥±AÉÑÍlÉt¤(ÀÌØíÍ%½¹¥±ôÀÌØíÍ%½¹¥±AÉÑÍlÅtoÝ÷ Ø  趫Á¬°¢é]mëh²)©+¬y«p¡Ø¦z{"¢v¥jºÚÉ«­¢+Ù±½°ÀÌØíÍ%½¹¥±ÍlÅulÉt(ÀÌØíÍ%½¹¥±ÍlÁulÁtôÀÌØíͱ±AÑ (ÀÌØíÍ%½¹¥±ÍlÁulÅtôÀÌØí¥%½¹%¹
Edited by cppman
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...