Click here to Skip to main content
16,004,924 members
Home / Discussions / C#
   

C#

 
AnswerRe: storing doc files Pin
JoeSox23-Jul-06 20:05
JoeSox23-Jul-06 20:05 
GeneralRe: storing doc files Pin
Charith Jayasundara24-Jul-06 17:23
Charith Jayasundara24-Jul-06 17:23 
QuestionHow to use a class in an unmanged DLL Pin
dfbx23-Jul-06 16:38
dfbx23-Jul-06 16:38 
AnswerRe: Project Topic Pin
Paul Conrad23-Jul-06 17:03
professionalPaul Conrad23-Jul-06 17:03 
GeneralRe: Project Topic Pin
Colin Angus Mackay23-Jul-06 21:46
Colin Angus Mackay23-Jul-06 21:46 
Questionhow can create a really transparent control? Pin
Susuko23-Jul-06 14:20
Susuko23-Jul-06 14:20 
AnswerRe: how can create a really transparent control? Pin
ankita patel24-Jul-06 6:50
ankita patel24-Jul-06 6:50 
QuestionHow Do I Access All File Types And Association Information [modified] Pin
christico23-Jul-06 11:49
christico23-Jul-06 11:49 
I am at a cross roads with a program I am writing at the moment. I dont know which way to proceed. The information desired is held within File Types under Folder Options in My Computer. I have been tempted to pursue a registry programming approach however. Reading the article on shell extensions and the namespace I would love to be able to glean the information from this method. I have made some inroads into this by setting up the structure:

[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class ExtenManager
{
public const uint SHGFI_ICON = 0x000000100;
public const uint SHGFI_DISPLAYNAME = 0x000000200;
public const uint SHGFI_TYPENAME = 0x000000400;
public const uint SHGFI_ATTRIBUTES = 0x000000800;
public const uint SHGFI_ICONLOCATION = 0x000001000;
public const uint SHGFI_EXETYPE = 0x000002000;
public const uint SHGFI_SYSICONINDEX = 0x000004000;
public const uint SHGFI_LINKOVERLAY = 0x000008000;
public const uint SHGFI_SELECTED = 0x000010000;
public const uint SHGFI_ATTR_SPECIFIED = 0x000020000;
public const uint SHGFI_LARGEICON = 0x000000000;
public const uint SHGFI_SMALLICON = 0x000000001;
public const uint SHGFI_OPENICON = 0x000000002;
public const uint SHGFI_SHELLICONSIZE = 0x000000004;
public const uint SHGFI_PIDL = 0x000000008;
public const uint SHGFI_USEFILEATTRIBUTES = 0x000000010;
public const uint SHGFI_ADDOVERLAYS = 0x000000020;
public const uint SHGFI_OVERLAYINDEX = 0x000000040;
public const uint ILD_TRANSPARENT = 0x1;


[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath,
uint dwFileAttributes,
ref SHFILEINFO psfi,
uint cbSizeFileInfo,
uint uFlags);
}

And Calling it respectively with:

RunningApps.Items.Clear();

IntPtr hTypeInfo; // The Handle To The System FileType List
string fName; // 'the file name to get icon from

SHFILEINFO shinfo = new SHFILEINFO();

// Get All FileExtenstions

foreach (string file in System.IO.Directory.GetFiles("C:\\", "*.*"))
{
hTypeInfo = ExtenManager.SHGetFileInfo(file, 0, ref shinfo,
(uint)Marshal.SizeOF(shinfo), ExtenManager.SHGFI_TYPENAME | ExtenManager.SHGFI_USEFILEATTRIBUTES);


RunningApps.Items.Add(shinfo.szTypeName + " " + shinfo.szDisplayName);
}

Forgive the formatting, This give me the TypeName information which can be found in my computer but is all!. Is it possible to access all the File Extensions along with their information via a call to the shell32 API in My Computer / Folder Options / File Types. Could it be done through PIDL's and if so could someone please help me out!!


<div class="ForumSig"></div>

-- modified at 21:52 Sunday 23rd July, 2006
Questionneed help with a function call Pin
Patrick Snoeij23-Jul-06 11:28
Patrick Snoeij23-Jul-06 11:28 
AnswerRe: need help with a function call Pin
Christian Graus23-Jul-06 11:30
protectorChristian Graus23-Jul-06 11:30 
GeneralRe: need help with a function call Pin
Patrick Snoeij23-Jul-06 20:57
Patrick Snoeij23-Jul-06 20:57 
GeneralRe: need help with a function call Pin
Christian Graus23-Jul-06 21:12
protectorChristian Graus23-Jul-06 21:12 
GeneralRe: need help with a function call Pin
Guffa23-Jul-06 21:16
Guffa23-Jul-06 21:16 
QuestionSocket Connectivity Behind Router or Proxy??? Pin
RizwanSharp23-Jul-06 7:51
RizwanSharp23-Jul-06 7:51 
AnswerRe: Socket Connectivity Behind Router or Proxy??? Pin
stancrm23-Jul-06 8:14
stancrm23-Jul-06 8:14 
GeneralRe: Socket Connectivity Behind Router or Proxy??? Pin
RizwanSharp23-Jul-06 8:19
RizwanSharp23-Jul-06 8:19 
GeneralRe: Socket Connectivity Behind Router or Proxy??? Pin
stancrm23-Jul-06 8:22
stancrm23-Jul-06 8:22 
QuestionRe: Socket Connectivity Behind Router or Proxy??? [modified] Pin
RizwanSharp23-Jul-06 8:25
RizwanSharp23-Jul-06 8:25 
AnswerRe: Socket Connectivity Behind Router or Proxy??? Pin
stancrm23-Jul-06 8:30
stancrm23-Jul-06 8:30 
GeneralRe: Socket Connectivity Behind Router or Proxy??? Pin
RizwanSharp23-Jul-06 8:33
RizwanSharp23-Jul-06 8:33 
GeneralRe: Socket Connectivity Behind Router or Proxy??? Pin
stancrm23-Jul-06 8:58
stancrm23-Jul-06 8:58 
QuestionTo remove errors from the program. Pin
arun.m23-Jul-06 7:14
arun.m23-Jul-06 7:14 
QuestionRe: To remove errors from the program. Pin
RizwanSharp23-Jul-06 7:40
RizwanSharp23-Jul-06 7:40 
AnswerRe: To remove errors from the program. Pin
mav.northwind23-Jul-06 10:22
mav.northwind23-Jul-06 10:22 
AnswerRe: To remove errors from the program. Pin
Christian Graus23-Jul-06 10:44
protectorChristian Graus23-Jul-06 10:44 

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.