There is still an issue with Icon selection. In the Compile_AHK_0.9.0.58 version attempting to select an icon file which has a long path/filename caused the name to be truncated for me.
Before you released the 0.9.0.58 version I had added a modification to try and fix the icon issue using majkinetor's forms library.
http://www.autohotkey.com/forum/viewtopic.php?t=53317
I replaced the icon selection DLL calls with the Dlg_Icon() call from the library, and it appears to work well although I haven't done much testing with it.
I replaced the following code:
Code:
else
{
; VarSetCapacity(wSourceFile , 260 * 2)
; DllCall("MultiByteToWideChar" , "Uint" , 0 , "Uint" , 0 , "str" , SourceFile , "int" , -1 , "str" , wSourceFile , "int" , 260)
If !(A_IsUnicode)
{
VarSetCapacity(wSourceFile , 260 * 2)
DllCall("MultiByteToWideChar" , "Uint" , 0 , "Uint" , 0 , "str" , SourceFile , "int" , -1 , "str" , wSourceFile , "int" , 260)
}
Else
{
wSourceFile := SourceFile
}
If !DllCall("shell32\PickIconDlg" , "Uint" , hWnd , "str" , wSourceFile , "Uint" , 260 , "intP" , nIndex)
Return ; cancel was clicked or something else failed
; VarSetCapacity(SourceFile , 260)
; DllCall("WideCharToMultiByte" , "Uint" , 0 , "Uint" , 0 , "str" , wSourceFile , "int" , -1 , "str" , SourceFile , "int" , 260 , "Uint" , 0 , "Uint" , 0)
If !(A_IsUnicode)
{
VarSetCapacity(SourceFile , 260)
DllCall("WideCharToMultiByte" , "Uint" , 0 , "Uint" , 0 , "str" , wSourceFile , "int" , -1 , "str" , SourceFile , "int" , 260 , "Uint" , 0 , "Uint" , 0)
}
Else
{
SourceFile := wSourceFile
}
StringReplace , SourceFile , SourceFile , `%SystemRoot`% , %A_WinDir%
}
with:
Code:
else
{
if !Dlg_Icon(SourceFile, idx, hGui)
Return ; cancel was clicked or something else failed
else
nIndex := idx - 1
StringReplace , SourceFile , SourceFile , `%SystemRoot`% , %A_WinDir%
}
Along with adding the code for the Dlg_Icon function.
I'm not quite sure why I needed to adjust the icon index on a successful result though.