PDA

View Full Version : couple of questions about icons and shortcuts


guttrhead
15-02-2006, 06:34 PM
Just wondering:
Is there a folder in WM5 that contains all system icons?
How do you associate an icon with a shortcut? I see 2 numbers and a # before shortcuts with icons. What/where do those numbers refer to?
pocket plus has a bunch of icons clumped together in png files. Can i get to those withough going through pocket plus?
Thanks

vijay555
15-02-2006, 07:34 PM
On .lnk structure and folder icons:

http://forum.xda-developers.com/viewtopic.php?t=40230&highlight=icons+completeness

V

OdeeanRDeathshead
16-02-2006, 02:58 AM
If you can't be bothered to decifer the contents of a shortcut then you can always get the icon handle this way (assuming you know the path), just find a pre existing shortcut to what you want and get its icon. For example if you do not want to calculate an offset to calendar but you know where an existing lnk to calendar is, then just get the icon for the lnk and that will be the same icon.

//------------------------------------------------------------------
HICON someProgram::GetFileIconHandle(CString FileName, BOOL bSmallIcon)
{

SHFILEINFO sfi;
if (bSmallIcon)
{
SHGetFileInfo(
(LPCTSTR)FileName,
FILE_ATTRIBUTE_NORMAL,
&sfi,
sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
}
else
{
SHGetFileInfo(
(LPCTSTR)FileName,
FILE_ATTRIBUTE_NORMAL,
&sfi,
sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_LARGEICON | SHGFI_USEFILEATTRIBUTES);
}
return sfi.hIcon;


}
//-----------------------------------------------------------------