Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
AnswerRe: Urgent Pin
J4amieC31-May-06 2:18
J4amieC31-May-06 2:18 
GeneralRe: Urgent Pin
led mike31-May-06 4:59
led mike31-May-06 4:59 
Questionanalyze text Pin
abdelhameed8131-May-06 0:20
abdelhameed8131-May-06 0:20 
AnswerRe: analyze text Pin
leppie31-May-06 2:10
leppie31-May-06 2:10 
Questionadding a .cs file programatically in C#.net Pin
compdesign31-May-06 0:08
compdesign31-May-06 0:08 
AnswerRe: adding a .cs file programatically in C#.net Pin
sathish s31-May-06 1:35
sathish s31-May-06 1:35 
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 

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.