Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why dictionary puts data inside [] mark? Pin
Richard MacCutchan19-May-21 22:08
mveRichard MacCutchan19-May-21 22:08 
GeneralRe: Why dictionary puts data inside [] mark? Pin
Alex Dunlop19-May-21 22:46
Alex Dunlop19-May-21 22:46 
GeneralRe: Why dictionary puts data inside [] mark? Pin
jsc4219-May-21 23:58
professionaljsc4219-May-21 23:58 
GeneralRe: Why dictionary puts data inside [] mark? Pin
Richard MacCutchan20-May-21 0:50
mveRichard MacCutchan20-May-21 0:50 
AnswerRe: Why dictionary puts data inside [] mark? Pin
BillWoodruff30-May-21 21:05
professionalBillWoodruff30-May-21 21:05 
QuestionGet folders like the one for mega, drop box Pin
Duc Axenn19-May-21 11:35
Duc Axenn19-May-21 11:35 
AnswerRe: Get folders like the one for mega, drop box Pin
Dave Kreskowiak19-May-21 11:58
mveDave Kreskowiak19-May-21 11:58 
GeneralRe: Get folders like the one for mega, drop box Pin
Duc Axenn19-May-21 13:45
Duc Axenn19-May-21 13:45 
hi, thanks for your answer.

I tried several things, even before i tried to read sources from this example

I used
IntPtr m_pIDL = IntPtr.Zero;
hRes = ShellAPI.SHGetSpecialFolderLocation(IntPtr.Zero, CSIDL.CSIDL_DESKTOP, ref m_pIDL);
but it's deprecated, so i used
hRes = ShellAPI.SHGetFolderLocation(IntPtr.Zero, 0, IntPtr.Zero,0, out m_pIDL);


For retrieve informations i used

SHFILEINFO shInfo = new SHFILEINFO();
ShellAPI.SHGetFileInfo(m_pIDL, 0, out shInfo, (uint)Marshal.SizeOf(shInfo),
    SHGFI.DisplayName | //0x000000200
    SHGFI.PIDL | //0x000000008
    SHGFI.SmallIcon |//0x000000001
    SHGFI.SystemIconIndex //0x000004000
);


But i get
畂敲畡
as display name, and 34 as iIcon in all cases. Which means "toc toc" (knocking) according to google translate.

I can't go more forward, i'm totally blind because of that.

This example is interesting because it give me what i need, i have one drive & mega folders and it seems there is no special instruction to have it, it lists elements by using

EnumObjects


This is why i would to use some elements under .net core and learn how to use windows api, instead of using c# with methods from Directory. If i understand well it's a handle (pointeur?).

SHFILEINFO
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
   public struct SHFILEINFO
   {
       public IntPtr hIcon;

       public int iIcon;

       public uint dwAttributes;

       [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
       public string szDisplayName;

       [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
       public string szTypeName;
   }


[DllImport("shell32.dll")]
//public static extern Int32 SHGetFolderLocation(IntPtr hwnd, int csidl, HANDLE hToken, DWORD dwFlags, PIDLIST_ABSOLUTE* ppidl);
public static extern int SHGetFolderLocation(IntPtr hwndOwner, int csidl, IntPtr hToken, uint dwReserved, out IntPtr ppidl);


[DllImport("shell32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SHGetFileInfo(string path, uint attributes, out SHFILEINFO fileInfo, uint size, uint flags);

[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(IntPtr pIDL, uint dwFileAttributes, out SHFILEINFO psfi, uint cbFileInfo, uint uFlags);
#endregion


modified 19-May-21 20:13pm.

GeneralRe: Get folders like the one for mega, drop box Pin
Dave Kreskowiak19-May-21 14:34
mveDave Kreskowiak19-May-21 14:34 
GeneralRe: Get folders like the one for mega, drop box Pin
Duc Axenn19-May-21 21:27
Duc Axenn19-May-21 21:27 
QuestionIs ILMerge still used ? Pin
Maximilien19-May-21 9:05
Maximilien19-May-21 9:05 
AnswerRe: Is ILMerge still used ? Pin
Dave Kreskowiak19-May-21 9:48
mveDave Kreskowiak19-May-21 9:48 
QuestionString.Replace() & Regex.Replace() not working Pin
Mou_kol15-May-21 22:40
Mou_kol15-May-21 22:40 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Tony Hill15-May-21 23:30
mveTony Hill15-May-21 23:30 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Mou_kol15-May-21 23:36
Mou_kol15-May-21 23:36 
SuggestionRe: String.Replace() & Regex.Replace() not working Pin
Tony Hill16-May-21 0:04
mveTony Hill16-May-21 0:04 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Mou_kol16-May-21 0:21
Mou_kol16-May-21 0:21 
AnswerRe: String.Replace() & Regex.Replace() not working Pin
OriginalGriff16-May-21 0:20
mveOriginalGriff16-May-21 0:20 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Mou_kol16-May-21 0:21
Mou_kol16-May-21 0:21 
AnswerRe: String.Replace() & Regex.Replace() not working Pin
Gerry Schmitz16-May-21 11:04
mveGerry Schmitz16-May-21 11:04 
QuestionBug in form font Pin
Ismael Oliveira 202112-May-21 4:12
Ismael Oliveira 202112-May-21 4:12 
QuestionRe: Bug in form font Pin
Richard MacCutchan12-May-21 5:26
mveRichard MacCutchan12-May-21 5:26 
AnswerRe: Bug in form font Pin
OriginalGriff12-May-21 5:27
mveOriginalGriff12-May-21 5:27 
AnswerRe: Bug in form font Pin
Ismael Oliveira 202117-May-21 10:08
Ismael Oliveira 202117-May-21 10:08 
GeneralRe: Bug in form font Pin
Richard MacCutchan17-May-21 21:05
mveRichard MacCutchan17-May-21 21:05 

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.