Click here to Skip to main content
15,921,716 members
Home / Discussions / C#
   

C#

 
QuestionRetrieving correct indexed icon from iconfiles / exefiles Pin
Larantz30-May-06 23:17
Larantz30-May-06 23:17 
AnswerRe: Retrieving correct indexed icon from iconfiles / exefiles [modified] Pin
Larantz31-May-06 0:54
Larantz31-May-06 0:54 
Found another solution, though I'm still interested in an answer on the above question.

The other solution is to pass other constants to the SHGetFileInfo(..) method so that the
method retrieves icons corresponding to fileextension, and not from the file itself.

I'll just post it incase someone else is having the same problems:

In Win32
public const uint SHGFI_ICON		= 0x100;
public const uint SHGFI_LARGEICON		= 0x0;    // 'Large icon
public const uint SHGFI_SMALLICON		= 0x1;    // 'Small icon
public const uint SHGFI_USEFILEATTRIBUTES	= 0x10;
public const uint FILE_ATTRIBUTE_NORMAL	= 0x80;
public const uint SHGFI_TYPENAME		= 0x400;


In myClass
hImgSmall = Win32.SHGetFileInfo(
			strAnyfilename,               //this can even be a string to a nonexiting file
			Win32.FILE_ATTRIBUTE_NORMAL,
			ref shinfo,
			(uint)Marshal.SizeOf(shinfo),
			Win32.SHGFI_USEFILEATTRIBUTES |
			Win32.SHGFI_TYPENAME |
			Win32.SHGFI_ICON |
			Win32.SHGFI_SMALLICON);


-Larantz-

-- modified at 6:55 Wednesday 31st May, 2006
Questionadd controls to TabPage Pin
rcwoods30-May-06 23:06
rcwoods30-May-06 23:06 
AnswerRe: add controls to TabPage Pin
rah_sin30-May-06 23:20
professionalrah_sin30-May-06 23:20 
AnswerRe: add controls to TabPage Pin
Mairaaj Khan31-May-06 0:04
professionalMairaaj Khan31-May-06 0:04 
QuestionService starts and stops immediately Pin
israfel30-May-06 23:06
israfel30-May-06 23:06 
QuestionHow to Hide A Process in TaskManager ?? Pin
hdv21230-May-06 23:02
hdv21230-May-06 23:02 
AnswerRe: How to Hide A Process in TaskManager ?? Pin
Guffa31-May-06 0:14
Guffa31-May-06 0:14 
QuestionNorminv Function in C# Pin
Joachim Maes30-May-06 22:53
Joachim Maes30-May-06 22:53 
AnswerRe: Norminv Function in C# Pin
FarhanShariff16-Apr-14 23:13
professionalFarhanShariff16-Apr-14 23:13 
QuestionHow to know the parent of Form class Pin
Maddie from Dartford30-May-06 21:55
Maddie from Dartford30-May-06 21:55 
AnswerRe: How to know the parent of Form class Pin
stancrm30-May-06 22:22
stancrm30-May-06 22:22 
AnswerRe: How to know the parent of Form class Pin
subburaj.sabapathy31-May-06 2:38
subburaj.sabapathy31-May-06 2:38 
QuestionInvalid Character in XmlDocument Pin
malikjhangirahmed@hotmail.com30-May-06 21:10
malikjhangirahmed@hotmail.com30-May-06 21:10 
AnswerRe: Invalid Character in XmlDocument Pin
NaNg1524131-May-06 1:09
NaNg1524131-May-06 1:09 
QuestionListbox Item Selection Pin
Brendan Vogt30-May-06 21:01
Brendan Vogt30-May-06 21:01 
AnswerRe: Listbox Item Selection Pin
malikjhangirahmed@hotmail.com30-May-06 21:19
malikjhangirahmed@hotmail.com30-May-06 21:19 
QuestionRe: Listbox Item Selection Pin
Brendan Vogt30-May-06 21:28
Brendan Vogt30-May-06 21:28 
AnswerRe: Listbox Item Selection [modified] Pin
albCode30-May-06 22:06
albCode30-May-06 22:06 
QuestionRe: Listbox Item Selection [modified] Pin
Brendan Vogt30-May-06 22:25
Brendan Vogt30-May-06 22:25 
QuestionDatagridview - programmatic Cell updation Question Pin
Tushar Bhatt30-May-06 20:58
Tushar Bhatt30-May-06 20:58 
AnswerRe: Datagridview - programmatic Cell updation Question Pin
Mairaaj Khan30-May-06 23:26
professionalMairaaj Khan30-May-06 23:26 
GeneralRe: Datagridview - programmatic Cell updation Question Pin
Tushar Bhatt1-Jun-06 19:09
Tushar Bhatt1-Jun-06 19:09 
QuestionEncryption Decryption Problem in Web Services Pin
malikjhangirahmed@hotmail.com30-May-06 20:50
malikjhangirahmed@hotmail.com30-May-06 20:50 
QuestionChanging type Pin
thepersonof30-May-06 20:49
thepersonof30-May-06 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.