Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Path2Link := 'C:StuffTBear S Saver.lnk';
- SHGetFileInfo(PChar(Path2Link), 0, ShInfo1, SizeOf(TSHFILEINFO),
- SHGFI_ICON);
- // this ShInfo1.hIcon will have the Icon Handle for the Link Icon with
- // the small ShortCut arrow added}
- [DllImport("shell32.dll")]
- public static extern IntPtr SHGetFileInfo(
- string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi,
- uint cbSizeFileInfo, uint uFlags);
- Func _ShellGetAssocIcon(Const $szFile,Const $IconFlags = 0)
- Local $tFileInfo = DllStructCreate($tagSHFILEINFO)
- If @error Then
- Return SetError(1,@extended,0)
- EndIf
- Local $Ret = DllCall("shell32.dll","int","SHGetFileInfo","str",$szFile,"dword",0, _
- "ptr",DllStructGetPtr($tFileInfo),"uint",DllStructGetSize($tFileInfo),"uint",BitOr($SHGFI_ICON,$IconFlags))
- MsgBox(0,0,@error)
- Return DllStructGetData($tFileInfo,"hIcon")
- EndFunc
Add Comment
Please, Sign In to add comment