Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

CE_FIND_DATA (rapi)
 

rapi is for smart devices, not desktop Windows. Therefore, this information only applies to code using the .NET Compact Framework. To see if information for CE_FIND_DATA in other DLLs exists, click on Find References to the right.

.
Summary

C# Signature:

        [StructLayout(LayoutKind.Explicit,CharSet=CharSet.Unicode)]
            public struct CE_FIND_DATA
        {

            [FieldOffset(  0)] public uint      dwFileAttributes;
            [FieldOffset(  4)] public FILETIME      ftCreationTime;
            [FieldOffset( 12)] public FILETIME      ftLastAccessTime;
            [FieldOffset( 20)] public FILETIME      ftLastWriteTime;
            [FieldOffset( 28)] public uint      nFileSizeHigh;
            [FieldOffset( 32)] public uint      nFileSizeLow;
            [FieldOffset( 36)] public uint      dwOID;
            [MarshalAs(UnmanagedType.ByValTStr,SizeConst=260),FieldOffset(40)] public string Name;
        };

Note :

FILETIME is now obsolet. You can use System.Runtime.InteropServices.ComTypes.FILETIME type instead.

VB Signature:

    <StructLayout(LayoutKind.Sequential, pack:=4, CharSet:=CharSet.Unicode)> _
    Public Structure CE_FIND_DATA
        Public dwFileAttributes As Integer
        Public ftCreationTime As FILETIME
        Public ftLastAccessTime As FILETIME
        Public ftLastWriteTime As FILETIME
        Public nFileSizeHigh As Integer
        Public nFileSizeLow As Integer
        Public dwOID As Integer
        <MarshalAs(UnmanagedType.ByValTStr, sizeConst:=MAX_PATH)> _
        Public cFileName As String
    End Structure

TODO

User-Defined Types:

None needed

Tips & Tricks:

MAX_PATH is set to 260 characters by Windows so we create a ByValTStr with this length. Can then just use the 'Name' field as a normal string

Sample Code:

    int hFile;
    CE_FIND_DATA Data=new CE_FIND_DATA();
    hFile=CeFindFirstFile("\\My Documents",ref Data);
    return (hFile!=0);

Alternative Managed API:

Do you know one? Please contribute it!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions