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

Search Results for "SHFILEOPSTRUCT" in [All]

Structures

.
Summary
.

struct SHFILEOPSTRUCT

.

Public Structure SHFILEOPSTRUCT

.

Public Type SHFILEOPSTRUCT

.

Under x64, the SHFILEOPSTRUCT must be declared without the Pack = 1 parameter, or it will fail. This is a real pain if you want your code to be platform independent, as you have to declare two separate structures, one with Pack = 1, and one without. You then have to declare two different SHFileOperation calls, one for each of the structures. Then you have to decide which one to call depending on whether you are running on 32 or 64 bit.

.

Don't declare a value for the Pack size. If you omit it, the correct value is used when marshaling and a single SHFILEOPSTRUCT can be used for both 32-bit and 64-bit operation.

.
Documentation
[SHFILEOPSTRUCT] on MSDN

Constants

.

    public const int FOF_WANTMAPPINGHANDLE      = 0x0020;  // Fill in SHFILEOPSTRUCT.hNameMappings

.

    public const int FOF_WANTMAPPINGHANDLE      = 0x0020;  // Fill in SHFILEOPSTRUCT.hNameMappings

Enums

.
Summary
FileFuncFlags - Flags for wFunc member of SHFILEOPSTRUCT
.

SHFILEOPSTRUCT

.
Summary
.

    /// Fill in SHFILEOPSTRUCT.hNameMappings.

.

    ''' Fill in SHFILEOPSTRUCT.hNameMappings.

.

SHFILEOPSTRUCT

shell32

.

static extern int SHFileOperation([In] ref SHFILEOPSTRUCT lpFileOp);

.

Public Function SHFileOperation(<MarshalAs(UnmanagedType.Struct)>ByRef lpFileOp As SHFILEOPSTRUCT) As Integer

.

        (lpFileOp As SHFILEOPSTRUCT) As Long

.

SHFILEOPSTRUCT

.
  • The SHFILEOPSTRUCT StructLayout attribute needs a Pack=2 (win32 - see this in the example) and Pack=8 (win64) parameter. Without it, it does not work. Of course both cannot be set for the same struct, so 2 structs are needed.
.

    struct SHFILEOPSTRUCT

.

    static extern int SHFileOperation([In, Out] ref SHFILEOPSTRUCT lpFileOp);

.

    private SHFILEOPSTRUCT _ShFile;

.

        this._ShFile = new SHFILEOPSTRUCT();

.

            FOF_WANTMAPPINGHANDLE = 0x0020,  // Fill in SHFILEOPSTRUCT.hNameMappings


 
Access PInvoke.net directly from VS: