Click here to Skip to main content
15,903,012 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can i store path of zipfile in DataBase MS-SQL Using C# 2.0 Pin
Christian Graus2-Mar-08 10:58
protectorChristian Graus2-Mar-08 10:58 
GeneralRe: How can i store path of zipfile in DataBase MS-SQL Using C# 2.0 Pin
Member 43708983-Mar-08 7:33
Member 43708983-Mar-08 7:33 
QuestionCalling WebMethods using Request XML? Pin
geekfromindia2-Mar-08 4:03
geekfromindia2-Mar-08 4:03 
AnswerRe: Calling WebMethods using Request XML? Pin
pmarfleet2-Mar-08 4:43
pmarfleet2-Mar-08 4:43 
GeneralRe: Calling WebMethods using Request XML? Pin
geekfromindia2-Mar-08 5:03
geekfromindia2-Mar-08 5:03 
GeneralRe: Calling WebMethods using Request XML? Pin
pmarfleet2-Mar-08 5:18
pmarfleet2-Mar-08 5:18 
QuestionMultiple relation not working as expected [modified] Pin
panda8692-Mar-08 3:40
panda8692-Mar-08 3:40 
Generalconvert structure to IntPtr Pin
amirreza_nl2-Mar-08 3:35
amirreza_nl2-Mar-08 3:35 
Hi,
I want to use SHGetFileInfo from shell32.dll u can pass string or pidl(ITEMIDLIST structure) for first param the problem is: u can't convert string (file path) to pidl or vice versa. so I use IntPtr for first param. but the problem is I can't convert pidl to IntPtr.
(the problem is the code below doesn't work I can't find out why)

public class FileFolder<br />
{<br />
[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]<br />
public static extern UInt32 SHGetFileInfo(IntPtr pszPath, UInt32 dwFileAttributes, ref SHFILEINFO psfi, UInt32 cbFileInfo, UInt32 uFlags);<br />
[DllImport("Shell32.dll", CharSet = CharSet.Unicode)]<br />
public static extern Int32 SHGetSpecialFolderLocation(IntPtr hwndOwner, int nFolder, ref ITEMIDLIST ppidl);<br />
<br />
[StructLayout(LayoutKind.Sequential, Pack = 1)]<br />
public struct SHITEMID<br />
{<br />
     public UInt16 cb;<br />
     [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]public SByte[] abID;<br />
}<br />
[StructLayout(LayoutKind.Sequential, Pack = 1)]<br />
public struct ITEMIDLIST<br />
{<br />
      public SHITEMID mkid;<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
<br />
uint flag = FileFolder.C_GetFileInfoFlagt.SHGFI_PIDL| FileFolder.C_GetFileInfoFlagt.SHGFI_ICON | FileFolder.C_GetFileInfoFlagt.SHGFI_SHELLICONSIZE | FileFolder.C_GetFileInfoFlagt.SHGFI_ATTRIBUTES | FileFolder.C_GetFileInfoFlagt.SHGFI_TYPENAME;<br />
<br />
FileFolder.ITEMIDLIST pidl = new FileFolder.ITEMIDLIST();<br />
if (FileFolder.SHGetSpecialFolderLocation(IntPtr.Zero, (int)0x0003, ref pidl) == 0)<br />
{<br />
      MessageBox.Show("true");<br />
}<br />
            <br />
IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(pidl));<br />
Marshal.StructureToPtr(pidl, pnt, true);<br />
if (FileFolder.SHGetFileInfo(pnt, 256, ref info, (uint)Marshal.SizeOf(info), flag) > 0)<br />
{<br />
       MessageBox.Show("Successfull");<br />
}

GeneralRe: convert structure to IntPtr Pin
amirreza_nl2-Mar-08 19:37
amirreza_nl2-Mar-08 19:37 
GeneralRe: convert structure to IntPtr Pin
DaveyM692-Mar-08 23:27
professionalDaveyM692-Mar-08 23:27 
GeneralRe: convert structure to IntPtr Pin
amirreza_nl3-Mar-08 4:36
amirreza_nl3-Mar-08 4:36 
GeneralRe: convert structure to IntPtr Pin
DaveyM693-Mar-08 9:11
professionalDaveyM693-Mar-08 9:11 
GeneralRe: convert structure to IntPtr [modified] Pin
amirreza_nl6-Mar-08 6:05
amirreza_nl6-Mar-08 6:05 
AnswerRe: convert structure to IntPtr Pin
Martin Cook6-Mar-08 10:17
professionalMartin Cook6-Mar-08 10:17 
GeneralRe: convert structure to IntPtr Pin
amirreza_nl6-Mar-08 22:59
amirreza_nl6-Mar-08 22:59 
GeneralRe: convert structure to IntPtr Pin
amirreza_nl6-Mar-08 23:15
amirreza_nl6-Mar-08 23:15 
QuestionHelp me ! Pin
banghv2-Mar-08 0:37
banghv2-Mar-08 0:37 
GeneralRe: Help me ! Pin
Not Active2-Mar-08 3:27
mentorNot Active2-Mar-08 3:27 
GeneralRe: Help me ! Pin
banghv2-Mar-08 14:34
banghv2-Mar-08 14:34 
QuestionHow to open a file in the application using openFileDialog Pin
Walaza2-Mar-08 0:24
Walaza2-Mar-08 0:24 
AnswerRe: How to open a file in the application using openFileDialog Pin
buchstaben2-Mar-08 2:45
buchstaben2-Mar-08 2:45 
AnswerRe: How to open a file in the application using openFileDialog Pin
Walaza2-Mar-08 4:54
Walaza2-Mar-08 4:54 
AnswerRe: How to open a file in the application using openFileDialog Pin
Xmen Real 2-Mar-08 6:39
professional Xmen Real 2-Mar-08 6:39 
GeneralRe: How to open a file in the application using openFileDialog Pin
Walaza2-Mar-08 6:54
Walaza2-Mar-08 6:54 
GeneralRe: How to open a file in the application using openFileDialog Pin
Xmen Real 2-Mar-08 6:54
professional Xmen Real 2-Mar-08 6:54 

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.