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 "RESOURCE" in [All]

shlwapi

.
Summary
Determines whether a path string represents a network resource.
.

''' Determines whether a path string represents a network resource.

.

''' <returns>Returns TRUE if the string represents a network resource, or FALSE otherwise.</returns>

.
Summary
Extracts the string from the specified resource when given an indirect string (a string beginning with the @ symbol). All other strings copy to the output buffer unaltered.
.

string resourcePath = "\System32\shell32.dll,-4123";

.

resourcePath = Environment.ExpandEnvironmentVariables(resourcePath);

.

int result = SHLoadIndirectString(resourcePath, outBuff, -1, IntPtr.Zero);

.

string sWin8ManifestString = "{C:\Program Files\WindowsApps\Microsoft.Video_6.2.8158.0_x86__8wekyb3d8bbwe\resources.pri?ms-resource://Microsoft.Video/resources/manifestVideoDisplayName}";

gdiplus

.
Summary
The GdiplusShutdown function cleans up resources used by GDI+. Each call to GdiplusStartup should be paired with a call to GdiplusShutdown.

ntdll

.

    ProcessResourceManagement,

rapi

.
Summary
This function creates, opens, or truncates a file, pipe, communications resource, disk device, or console. It returns a handle that can be used to access the object. It can also open and return a handle to a directory.

shell32

.

If this value is –1 and phiconLarge and phiconSmall are both NULL, the function returns the total number of icons in the specified file. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ico file, the return value is 1.

.

Windows 95/98/Me, Windows NT 4.0 and later: If this value is a negative number and either phiconLarge or phiconSmall is not NULL, the function begins by extracting the icon whose resource identifier is equal to the absolute value of nIconIndex. For example, use -3 to extract the icon whose resource identifier is 3.

.

For Windows CE 2.10 and later: the nIconIndex parameter must be zero or –N, where N is a specified resource identifier. The nIcons parameter must be 1.

.

For Windows CE 1.0 through 2.10: the function returns the total number of icons in the specified file if nIconIndex is –1 and phIconLarge and phiconSmall are both NULL. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ICO file, the return value is 1.

.

            // RELEASE RESOURCES

.

        'RELEASE RESOURCES

.

If this value is –1 and phiconLarge and phiconSmall are both NULL, the function returns the total number of icons in the specified file. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ico file, the return value is 1.

.

Windows 95/98/Me, Windows NT 4.0 and later: If this value is a negative number and either phiconLarge or phiconSmall is not NULL, the function begins by extracting the icon whose resource identifier is equal to the absolute value of nIconIndex. For example, use -3 to extract the icon whose resource identifier is 3.

.

For Windows CE 2.10 and later: the nIconIndex parameter must be zero or –N, where N is a specified resource identifier. The nIcons parameter must be 1.

.

For Windows CE 1.0 through 2.10: the function returns the total number of icons in the specified file if nIconIndex is –1 and phIconLarge and phiconSmall are both NULL. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ICO file, the return value is 1.

.

            // RELEASE RESOURCES

.

        'RELEASE RESOURCES

.

        private uint BIF_SHAREABLE      = 0x8000;  // sharable resources displayed (remote shares, requires BIF_USENEWUI)

.

A good sample of using this (with resource leek)

.

    public static readonly Guid LocalizedResourcesDir = new Guid( "2A00375E-224C-49DE-B8D1-440DF7EF3DDC" );

.

    public static readonly Guid ResourceDir = new Guid( "8AD10C31-2ADB-4296-A8F7-E4701232C972" );

.

    RESOURCES = &H38

.

    RESOURCES_LOCALIZED = &H39

.

    ''' Opens and selects all files. In addition releases all resources.

.

    public static Guid LocalizedResourcesDir = new Guid("2A00375E-224C-49DE-B8D1-440DF7EF3DDC");

.

    public static Guid ResourceDir = new Guid("8AD10C31-2ADB-4296-A8F7-E4701232C972");

msi

.

     case 5 :    return Resources.MsiErrorAccessDenied ;

.

     case 1610:  return Resources.MsiErrorBadConfiguration ;

.

     case 1627:  return Resources.MsiErrorFunctionFailed ;

.

     case 87:    return Resources.MsiErrorInvalidParameter ;

.

     case 234:   return Resources.MsiErrorMoreData ;

.

     case 0:     return Resources.MsiErrorSuccess ;

.

     case 1605:  return Resources.MsiErrorUnknownProduct ;

.

     case 1608:  return Resources.MsiErrorUnknownProperty ;

.

     case 1647:  return Resources.MsiErrorUnknownPatch ;

.

      return Resources.AgentErrorUnknown;

.

     case 5 :    return Resources.MsiErrorAccessDenied ;

.

     case 1610:  return Resources.MsiErrorBadConfiguration ;

.

     case 1627:  return Resources.MsiErrorFunctionFailed ;

.

     case 87:    return Resources.MsiErrorInvalidParameter ;

.

     case 234:   return Resources.MsiErrorMoreData ;

.

     case 0:     return Resources.MsiErrorSuccess ;

.

     case 1605:  return Resources.MsiErrorUnknownProduct ;

.

     case 1608:  return Resources.MsiErrorUnknownProperty ;

.

     case 1647:  return Resources.MsiErrorUnknownPatch ;

.

      return Resources.AgentErrorUnknown;

httpapi

.
Summary
The HttpTerminate function cleans up resources used by the HTTP API to process calls by an application. An application should call HttpTerminate once for every time it called HttpInitialize, with matching flag settings.

hid

.
Summary
The routine releases the resources that the HID class driver allocated to hold a top-level collection's preparsed data.

mpr

.
Summary
The MultinetGetConnectionPerformance function returns information about the expected performance of a connection used to access a network resource.
.

        NetResource lpNetResource,

.

        /// the current connection with the resource, with any routing

.

    private class NETRESOURCE

.

        public ResourceScope dwScope = 0;

.

        public ResourceType dwType = 0;

.

        public ResourceDisplayType dwDisplayType = 0;

.

        public ResourceUsage dwUsage = 0;

.

    public enum ResourceScope

.

        RESOURCE_CONNECTED = 1,

.

        RESOURCE_GLOBALNET,

.

        RESOURCE_REMEMBERED,

.

        RESOURCE_RECENT,

.

        RESOURCE_CONTEXT

.

    public enum ResourceType

.

        RESOURCETYPE_ANY,

.

        RESOURCETYPE_DISK,

.

        RESOURCETYPE_PRINT,

.

        RESOURCETYPE_RESERVED

.

    public enum ResourceUsage

.

        RESOURCEUSAGE_CONNECTABLE = 0x00000001,

.

        RESOURCEUSAGE_CONTAINER = 0x00000002,

.

        RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,

.

        RESOURCEUSAGE_SIBLING = 0x00000008,

.

        RESOURCEUSAGE_ATTACHED = 0x00000010,

.

        RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

    public enum ResourceDisplayType

.

        RESOURCEDISPLAYTYPE_GENERIC,

.

        RESOURCEDISPLAYTYPE_DOMAIN,

.

        RESOURCEDISPLAYTYPE_SERVER,

.

        RESOURCEDISPLAYTYPE_SHARE,

.

        RESOURCEDISPLAYTYPE_FILE,

.

        RESOURCEDISPLAYTYPE_GROUP,

.

        RESOURCEDISPLAYTYPE_NETWORK,

.

        RESOURCEDISPLAYTYPE_ROOT,

.

        RESOURCEDISPLAYTYPE_SHAREADMIN,

.

        RESOURCEDISPLAYTYPE_DIRECTORY,

.

        RESOURCEDISPLAYTYPE_TREE,

.

        RESOURCEDISPLAYTYPE_NDSCONTAINER

.

    public enum ResourceConnection

.

private static extern int WNetAddConnection2( NETRESOURCE lpNetResource,

.

NETRESOURCE nr = new NETRESOURCE();

.

nr.dwType = ResourceType.RESOURCETYPE_DISK;

.

nr.dwDisplayType = ResourceDisplayType.RESOURCEDISPLAYTYPE_SHARE;

.

nr.dwScope = ResourceScope.RESOURCE_GLOBALNET;

.

nr.dwUsage = ResourceUsage.RESOURCEUSAGE_CONNECTABLE;

.

int result = WNetAddConnection2(nr, password, user, (int)ResourceConnection.CONNECT_TEMPORARY);

.

/* Uses Struct rather than class version of NETRESOURCE */

.

    ref NETRESOURCE lpNetResource, string lpPassword,

.

    ''' Use to pass handle to Provider of Network Resource

.

    ''' <param name="lpNetResource"></param>

.

                           ByVal lpNetResource As NETRESOURCE, _

.

NETRESOURCE

.

private const int RESOURCETYPE_ANY = 0x0;

.

NETRESOURCE ConnInf = new NETRESOURCE();

.

ConnInf.dwType = RESOURCETYPE_ANY;

.
Summary
The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.
.

The WNetAddConnection2 function supersedes the WNetAddConnection function. If you can pass a handle to a window that the provider of network resources can use as an owner window for dialog boxes, call the WNetAddConnection3 function instead.

.

// This must be used if NETRESOURCE is defined as a struct

.

public static extern int WNetAddConnection2(ref NETRESOURCE netResource,

.

// This must be used if NETRESOURCE is defined as a class

.

public static extern int WNetAddConnection2(NETRESOURCE netResource,

.

// my NETRESOURCE is defined as:

.

//    class NETRESOURCE

.

  //      public enum ResourceScope

.

  //      RESOURCE_CONNECTED = 1,

.

  //      RESOURCE_GLOBALNET,

.

  //      RESOURCE_REMEMBERED,

.

  //      RESOURCE_RECENT,

.

  //      RESOURCE_CONTEXT

.

  //      public enum ResourceType

.

  //      RESOURCETYPE_ANY    = 0,

.

  //      RESOURCETYPE_DISK       = 1,

.

  //      RESOURCETYPE_PRINT      = 2,

.

  //      RESOURCETYPE_RESERVED   = 8,

.

  //      RESOURCETYPE_UNKNOWN    = -1,

.

  //      public enum ResourceUsage

.

  //      RESOURCEUSAGE_CONNECTABLE = 0x00000001,

.

  //      RESOURCEUSAGE_CONTAINER = 0x00000002,

.

  //      RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,

.

  //      RESOURCEUSAGE_SIBLING = 0x00000008,

.

  //      RESOURCEUSAGE_ATTACHED = 0x00000010,

.

  //      RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

  //      public enum ResourceDisplayType

.

  //      RESOURCEDISPLAYTYPE_GENERIC,

.

  //      RESOURCEDISPLAYTYPE_DOMAIN,

.

  //      RESOURCEDISPLAYTYPE_SERVER,

.

  //      RESOURCEDISPLAYTYPE_SHARE,

.

  //      RESOURCEDISPLAYTYPE_FILE,

.

  //      RESOURCEDISPLAYTYPE_GROUP,

.

  //      RESOURCEDISPLAYTYPE_NETWORK,

.

  //      RESOURCEDISPLAYTYPE_ROOT,

.

  //      RESOURCEDISPLAYTYPE_SHAREADMIN,

.

  //      RESOURCEDISPLAYTYPE_DIRECTORY,

.

  //      RESOURCEDISPLAYTYPE_TREE,

.

  //      RESOURCEDISPLAYTYPE_NDSCONTAINER

.

  //      private class NETRESOURCE

.

  //      public ResourceScope dwScope = 0;

.

  //      public ResourceType dwType = 0;

.

  //      public ResourceDisplayType dwDisplayType = 0;

.

  //      public ResourceUsage dwUsage = 0;

.

  //      private static extern ErrorCodes WNetAddConnection2(NETRESOURCE lpNetResource,ref string lpPassword,ref

.

public static extern int WNetAddConnection2( [In] NETRESOURCE netResource,

.

' This must be used if NETRESOURCE is defined as a struct

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (ByRef netResource As _

.

   NETRESOURCE, password As String, Username As String, Flag As Integer) As Integer

.

' This must be used if NETRESOURCE is defined as a class

.

Declare Function WNetAddConnection2 Lib "mpr.dll" (netResource As _

.

   NETRESOURCE, password As String, Username As String, Flag As Integer) As Integer

.

NETRESOURCE

.

NETRESOURCE myNetResource = new NETRESOURCE();        

.

myNetResource.dwScope = 2;                    

.

myNetResource.dwType = 1 ;                    

.

myNetResource.dwDisplayType = 3;            

.

myNetResource.dwUsage = 1;            

.

myNetResource.LocalName = "z:";        

.

myNetResource.RemoteName = @"\servername\sharename";        

.

myNetResource.Provider = null;        

.

// int ret = WNetAddConnection2( myNetResource, "username", "password", 0);

.

int ret = WNetAddConnection2( myNetResource, "password", "username", 0); //by honglinlee

.

    var netResource = new NetResource()

.

        Scope = ResourceScope.GlobalNetwork,

.

        ResourceType = ResourceType.Disk,

.

        DisplayType = ResourceDisplaytype.Share,

.

        netResource,

.

    private static extern int WNetAddConnection2(NetResource netResource,

.

public class NetResource

.

    public ResourceScope Scope;

.

    public ResourceType ResourceType;

.

    public ResourceDisplaytype DisplayType;

.

public enum ResourceScope : int

.

public enum ResourceType : int

.

public enum ResourceDisplaytype : int

.

    public enum ResourceScope

.

        RESOURCE_CONNECTED = 1,

.

        RESOURCE_GLOBALNET,

.

        RESOURCE_REMEMBERED,

.

        RESOURCE_RECENT,

.

        RESOURCE_CONTEXT

.

    public enum ResourceType

.

        RESOURCETYPE_ANY,

.

        RESOURCETYPE_DISK,

.

        RESOURCETYPE_PRINT,

.

        RESOURCETYPE_RESERVED

.

    public enum ResourceUsage

.

        RESOURCEUSAGE_CONNECTABLE = 0x00000001,

.

        RESOURCEUSAGE_CONTAINER = 0x00000002,

.

        RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,

.

        RESOURCEUSAGE_SIBLING = 0x00000008,

.

        RESOURCEUSAGE_ATTACHED = 0x00000010,

.

        RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

    public enum ResourceDisplayType

.

        RESOURCEDISPLAYTYPE_GENERIC,

.

        RESOURCEDISPLAYTYPE_DOMAIN,

.

        RESOURCEDISPLAYTYPE_SERVER,

.

        RESOURCEDISPLAYTYPE_SHARE,

.

        RESOURCEDISPLAYTYPE_FILE,

.

        RESOURCEDISPLAYTYPE_GROUP,

.

        RESOURCEDISPLAYTYPE_NETWORK,

.

        RESOURCEDISPLAYTYPE_ROOT,

.

        RESOURCEDISPLAYTYPE_SHAREADMIN,

.

        RESOURCEDISPLAYTYPE_DIRECTORY,

.

        RESOURCEDISPLAYTYPE_TREE,

.

        RESOURCEDISPLAYTYPE_NDSCONTAINER

.

    private class NETRESOURCE

.

        public ResourceScope dwScope = 0;

.

        public ResourceType dwType = 0;

.

        public ResourceDisplayType dwDisplayType = 0;

.

        public ResourceUsage dwUsage = 0;

.

    private static extern int WNetAddConnection2(NETRESOURCE lpNetResource, string lpPassword, string lpUsername, int dwFlags);

.

        NETRESOURCE myNetResource = new NETRESOURCE();

.

        myNetResource.lpLocalName = drive;

.

        myNetResource.lpRemoteName = unc;

.

        myNetResource.lpProvider = null;

.

        int result = WNetAddConnection2(myNetResource, password, user, 0);

.

    Dim myResource As NETRESOURCE

.

    myResource.dwScope = 2

.

    myResource.dwType = 1

.

    myResource.dwDisplayType = 3

.

    myResource.LocalName = LocalName

.

    myResource.RemoteName = RemoteName

.

    myResource.dwUsage = Nothing

.

    myResource.Comment = Nothing

.

    myResource.Provider = Nothing

.

    returnValue = WNetAddConnection2(myResource, password, username, 0)

.

        MsgBox("Could not connect to " & myResource.RemoteName & ". The server said this: " & vbNewLine & vbNewLine & "(Error " & returnValue & ") " & errorM)

.

/* Uses Struct rather than class version of NETRESOURCE */

.

    ref NETRESOURCE lpNetResource, string lpPassword,

.

    ''' Use to pass handle to Provider of Network Resource

.

    ''' <param name="lpNetResource"></param>

.

                           ByRef lpNetResource As NETRESOURCE, _

.

NETRESOURCE

.

private const int RESOURCETYPE_ANY = 0x0;

.

NETRESOURCE ConnInf = new NETRESOURCE();

.

ConnInf.dwType = RESOURCETYPE_ANY;

.

WNetEnumResource

.

public static extern uint WNetEnumResource(IntPtr hEnum, ref int lpcCount, IntPtr lpBuffer, ref uint lpBufferSize);

.

Public Shared Function WNetEnumResource(hEnum As IntPtr, ByRef lpcCount As Integer, lpBuffer As IntPtr, ByRef lpBufferSize As UInteger) As UInteger

.

  public static extern int WNetEnumResource(

.

    RESOURCE_SCOPE dwScope,

.

    RESOURCE_TYPE dwType,

.

    RESOURCE_USAGE dwUsage,

.

    [MarshalAs(UnmanagedType.AsAny)][In] Object lpNetResource,

.

public enum RESOURCE_SCOPE

.

    RESOURCE_CONNECTED = 0x00000001,

.

    RESOURCE_GLOBALNET = 0x00000002,

.

    RESOURCE_REMEMBERED = 0x00000003,

.

    RESOURCE_RECENT= 0x00000004,

.

    RESOURCE_CONTEXT= 0x00000005

.

public enum RESOURCE_TYPE

.

    RESOURCETYPE_ANY= 0x00000000,

.

    RESOURCETYPE_DISK= 0x00000001,

.

    RESOURCETYPE_PRINT = 0x00000002,

.

    RESOURCETYPE_RESERVED = 0x00000008,

.

public enum RESOURCE_USAGE

.

    RESOURCEUSAGE_CONNECTABLE =0x00000001,

.

    RESOURCEUSAGE_CONTAINER=0x00000002,

.

    RESOURCEUSAGE_NOLOCALDEVICE =0x00000004,

.

    RESOURCEUSAGE_SIBLING=0x00000008,

.

    RESOURCEUSAGE_ATTACHED=0x00000010,

.

    RESOURCEUSAGE_ALL =(RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),

.

public enum RESOURCE_DISPLAYTYPE

.

    RESOURCEDISPLAYTYPE_GENERIC= 0x00000000,

.

    RESOURCEDISPLAYTYPE_DOMAIN= 0x00000001,

.

    RESOURCEDISPLAYTYPE_SERVER= 0x00000002,

.

    RESOURCEDISPLAYTYPE_SHARE= 0x00000003,

.

    RESOURCEDISPLAYTYPE_FILE = 0x00000004,

.

    RESOURCEDISPLAYTYPE_GROUP= 0x00000005,

.

    RESOURCEDISPLAYTYPE_NETWORK= 0x00000006,

.

    RESOURCEDISPLAYTYPE_ROOT = 0x00000007,

.

    RESOURCEDISPLAYTYPE_SHAREADMIN = 0x00000008,

.

    RESOURCEDISPLAYTYPE_DIRECTORY = 0x00000009,

.

    RESOURCEDISPLAYTYPE_TREE = 0x0000000A,

.

    RESOURCEDISPLAYTYPE_NDSCONTAINER = 0x0000000B

.

public struct NETRESOURCE

.

    public RESOURCE_SCOPE dwScope;

.

    public RESOURCE_TYPE dwType;

.

    public RESOURCE_DISPLAYTYPE dwDisplayType;

.

    public RESOURCE_USAGE dwUsage;

.

       RESOURCE_SCOPE.RESOURCE_GLOBALNET,

.

       RESOURCE_TYPE.RESOURCETYPE_ANY,

.

       RESOURCE_USAGE.RESOURCEUSAGE_ALL,

.

       NETRESOURCE nr;

.

     iRet =WNetEnumResource( ptrHandle, ref entries, ptrBuffer, ref buffer );

.

        nr = (NETRESOURCE)Marshal.PtrToStructure( ptr, typeof(NETRESOURCE) );

.

        if(RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER == (nr.dwUsage

.

            & RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER))

.

Module modEnumResource

.

    Public Enum RESOURCE_SCOPE

.

    RESOURCE_CONNECTED = &H1

.

    RESOURCE_GLOBALNET = &H2

.

    RESOURCE_REMEMBERED = &H3

.

    RESOURCE_RECENT = &H4

.

    RESOURCE_CONTEXT = &H5

.

    Public Enum RESOURCE_TYPE

.

    RESOURCETYPE_ANY = &H0

.

    RESOURCETYPE_DISK = &H1

.

    RESOURCETYPE_PRINT = &H2

.

    RESOURCETYPE_RESERVED = &H8

.

    Public Enum RESOURCE_USAGE

.

    RESOURCEUSAGE_CONNECTABLE = &H1

.

    RESOURCEUSAGE_CONTAINER = &H2

.

    RESOURCEUSAGE_NOLOCALDEVICE = &H4

.

    RESOURCEUSAGE_SIBLING = &H8

.

    RESOURCEUSAGE_ATTACHED = &H10

.

    RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE Or RESOURCEUSAGE_CONTAINER Or RESOURCEUSAGE_ATTACHED)

.

    Public Enum RESOURCE_DISPLAYTYPE

.

    RESOURCEDISPLAYTYPE_GENERIC = &H0

.

    RESOURCEDISPLAYTYPE_DOMAIN = &H1

.

    RESOURCEDISPLAYTYPE_SERVER = &H2

.

    RESOURCEDISPLAYTYPE_SHARE = &H3

.

    RESOURCEDISPLAYTYPE_FILE = &H4

.

    RESOURCEDISPLAYTYPE_GROUP = &H5

.

    RESOURCEDISPLAYTYPE_NETWORK = &H6

.

    RESOURCEDISPLAYTYPE_ROOT = &H7

.

    RESOURCEDISPLAYTYPE_SHAREADMIN = &H8

.

    RESOURCEDISPLAYTYPE_DIRECTORY = &H9

.

    RESOURCEDISPLAYTYPE_TREE = &HA

.

    RESOURCEDISPLAYTYPE_NDSCONTAINER = &HB

.

    Public Structure NETRESOURCE

.

    Public dwScope As RESOURCE_SCOPE

.

    Public dwType As RESOURCE_TYPE

.

    Public dwDisplayType As RESOURCE_DISPLAYTYPE

.

    Public dwUsage As RESOURCE_USAGE

.

    Public Function WNetEnumResource(ByVal hEnum As IntPtr, ByRef lpcCount As Integer, ByVal lpBuffer As IntPtr, ByRef lpBufferSize As Integer) As Integer

.

    Public Function WNetOpenEnum(ByVal dwScope As RESOURCE_SCOPE, ByVal dwType As RESOURCE_TYPE, ByVal dwUsage As RESOURCE_USAGE, ByRef lpNetResource As NETRESOURCE, ByRef lphEnum As IntPtr) As Integer

.

    Public Function GetNetworkDrives(ByRef o As NETRESOURCE, ByRef networkDriveCollection As List(Of String)) As Boolean

.

        iRet = WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_REMEMBERED, RESOURCE_TYPE.RESOURCETYPE_ANY, RESOURCE_USAGE.RESOURCEUSAGE_ATTACHED, o, ptrHandle)

.

        Dim nr As NETRESOURCE

.

        iRet = WNetEnumResource(ptrHandle, entries, ptrBuffer, buffer)

.

            nr = CType(Marshal.PtrToStructure(ptr, GetType(NETRESOURCE)), NETRESOURCE)

.

            If (RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER = (nr.dwUsage And RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER)) Then

.

    Public Function GetNetworkComputers(ByRef o As NETRESOURCE, ByRef networkComputersCollection As List(Of String)) As Boolean

.

        iRet = WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_GLOBALNET, RESOURCE_TYPE.RESOURCETYPE_ANY, RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER, o, ptrHandle)

.

        Dim nr As NETRESOURCE

.

        iRet = WNetEnumResource(ptrHandle, entries, ptrBuffer, buffer)

.

            nr = CType(Marshal.PtrToStructure(New IntPtr(ptr), GetType(NETRESOURCE)), NETRESOURCE)

.

            If (RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER = (nr.dwUsage And RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER)) Then

.

    Public Function WNETOE(ByRef o As NETRESOURCE, ByRef resourceCollection As List(Of String)) As Boolean

.

        iRet = WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_GLOBALNET, RESOURCE_TYPE.RESOURCETYPE_ANY, RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER, o, ptrHandle)

.

        Dim nr As NETRESOURCE

.

        iRet = WNetEnumResource(ptrHandle, entries, ptrBuffer, buffer)

.

            nr = CType(Marshal.PtrToStructure(New IntPtr(ptr), GetType(NETRESOURCE)), NETRESOURCE)

.

            If (RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER = (nr.dwUsage And RESOURCE_USAGE.RESOURCEUSAGE_CONTAINER)) Then

.

            If Not WNETOE(nr, resourceCollection) Then

.

            resourceCollection.Add(String.Format(nr.lpLocalName & " = " & nr.lpRemoteName))

.

        If ex.Message <> "" Then resourceCollection.Add(ex.Message)

.
Documentation
[WNetEnumResource] on MSDN
.

localName is the local name for the network resource (drive or printer)

.

remoteName is a string builder used to return the network name for the resource

.

public static extern UInt32 WNetOpenEnum(ResourceScope dwScope, ResourceType dwType, ResourceUsage dwUsage, NetResource lpNetResource, ref IntPtr lphEnum);

.

Public Shared Function WNetOpenEnum(dwScope As ResourceScope, dwType As ResourceType, dwUsage As ResourceUsage, lpNetResource As NetResource, ByRef lphEnum As IntPtr) As UInteger

.

ResourceScope, ResourceType, ResourceUsage, NetResource

.
Summary
Makes a connection to a network resource. The function can redirect a local device to a network resource.
.

    NETRESOURCE lpNetResource,

.

public enum ResourceScope

.

public enum ResourceType

.

public enum ResourceDisplayType

.

public enum ResourceUsage

.

private class NETRESOURCE

.

    public ResourceScope        dwScope       = 0;

.

    public ResourceType         dwType        = 0;

.

    public ResourceDisplayType  dwDisplayType = 0;

.

    public ResourceUsage        dwUsage       = 0;

.

    NETRESOURCE nr = new NETRESOURCE()

.

       dwType       = ResourceType.DISK,

.

    NETRESOURCE nr = new NETRESOURCE()

.

       dwType       = ResourceType.DISK,

coredll

.

    ''' Releases all resources held by the current WaitEvent.

.

So the device ID is a very useful thing for software that wants to target just your device, e.g. copy protection, or to provide immutable identity to web service calls. Equally so it’s a resource that should be protected to mitigate the risk of identity theft.

.
Summary
This function loads the specified icon resource from the executable (.exe) file associated with an application instance.
.

            // Obtains the app icon (the resource number is fixed for all apps) for the current

.

        SND_RESOURCE = &H40004          ' name is resource name or atom

.

        SND_RESOURCE = 0x40004,        // name is resource name or atom

.

            SND_RESOURCE = 0x40004, // name is resource name or atom

.

            SND_RESOURCE = &H40004          ' name is resource name or atom

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

wininet

.

        throw new InvalidOperationException(Resources.FTPClient_NoFTPSiteSpecified);

.

        throw new InvalidOperationException(Resources.FTPClient_HDSourceFileDoesNotExist);

.

To close the handle returned from InternetConnect, the application should call InternetCloseHandle. This function disconnects the client from the server and frees all resources associated with the connection.

kernel32

.

    public UInt16 lpResourceName;

.

    private const uint ACTCTX_FLAG_RESOURCE_NAME_VALID = 0x008;

.

    private const uint CREATEPROCESS_MANIFEST_RESOURCE_ID = 1;

.

    private const uint ISOLATIONAWARE_MANIFEST_RESOURCE_ID = 2;

.

    private const uint ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = 3;

.

    actCtx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;

.

    actCtx.lpResourceName = ISOLATIONAWARE_MANIFEST_RESOURCE_ID;

.

        actCtx.lpResourceName = ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID;

.

        actCtx.lpResourceName = CREATEPROCESS_MANIFEST_RESOURCE_ID;

.

Resources

.

Resources

.
Summary
.

static extern IntPtr BeginUpdateResource(string pFileName,

.

   [MarshalAs(UnmanagedType.Bool)]bool bDeleteExistingResources);

.

    Public Shared Function BeginUpdateResource(ByVal pFileName As String, _

.

    <MarshalAs(UnmanagedType.Bool)> ByVal bDeleteExistingResources As Boolean) As IntPtr

.

   IntPtr hResource = BeginUpdateResource(mFileName, false);

.

   if (hResource.ToInt32() == 0) {

.

     if (UpdateResource(hResource, "FILE", fileName,

.

   if (EndUpdateResource(hResource, false) == false) {

.
Documentation
[BeginUpdateResource] on MSDN
.

internal static extern IntPtr CreateMemoryResourceNotification(MemoryResourceNotificationType notificationType);

.

enum MemoryResourceNotificationType : int

.

    LowMemoryResourceNotification = 0,

.

    HighMemoryResourceNotification = 1,

.
Documentation
[CreateMemoryResourceNotification] on MSDN
.
Summary
.

static extern bool EndUpdateResource(IntPtr hUpdate, bool fDiscard);

.

Public Shared Function EndUpdateResource(ByVal hUpdate As IntPtr, ByVal fDiscard As Boolean) As Boolean

.

hUpdate is returned from BeginUpdateResource.

.
Documentation
[EndUpdateResource] on MSDN
.
Summary
.

static extern bool EnumResourceLanguages(IntPtr hModule, string lpszType,

.
Documentation
[EnumResourceLanguages] on MSDN
.
Summary
.

static extern bool EnumResourceNames(IntPtr hModule, string lpszType, EnumResNameProcDelegate lpEnumFunc, IntPtr lParam);

.

static extern bool EnumResourceNames(IntPtr hModule, int dwID, EnumResNameProcDelegate lpEnumFunc, IntPtr lParam);

.

<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As String, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean

.

<DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal dwID As Integer, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean

.

Public Enum ResourceType

.

    <DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

    Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As String, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Boolean

.

    <DllImport("kernel32.dll", CharSet:=CharSet.Unicode, EntryPoint:="EnumResourceNamesW", SetLastError:=True)> _

.

    Private Shared Function EnumResourceNames(ByVal hModule As IntPtr, ByVal lpszType As Integer, ByVal lpEnumFunc As EnumResNameProcDelegate, ByVal lParam As IntPtr) As Integer

.

    Private Sub ShowResources()

.

            EnumResourceNames(dll_hInst, "AVI", AddressOf EnumResNameProc, IntPtr.Zero)

.

    [DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]

.

    static extern bool EnumResourceNamesWithName(

.

    [DllImport("kernel32.dll", EntryPoint = "EnumResourceNamesW", CharSet = CharSet.Unicode, SetLastError = true)]

.

    static extern bool EnumResourceNamesWithID(

.

    private static bool IS_INTRESOURCE(IntPtr value)

.

    private static uint GET_RESOURCE_ID(IntPtr value)

.

      if (IS_INTRESOURCE(value) == true)

.

    private static string GET_RESOURCE_NAME(IntPtr value)

.

      if (IS_INTRESOURCE(value) == true)

.

      IntPtr hMod = LoadLibraryEx(@"D:\Test\StringResource\Debug\StringResource.exe", IntPtr.Zero, LOAD_LIBRARY_AS_DATAFILE);

.

      if (EnumResourceNamesWithID(hMod, RT_ICON, new EnumResNameDelegate(EnumRes), IntPtr.Zero) == false)

.

      Console.WriteLine("Type: {0}", GET_RESOURCE_NAME(lpszType));

.

      Console.WriteLine("Name: {0}", GET_RESOURCE_NAME(lpszName));

.
Documentation
[EnumResourceNames] on MSDN
.
Summary
.

static extern bool EnumResourceTypes(IntPtr hModule, EnumResTypeProc lpEnumFunc, IntPtr lParam);

.

Private Shared Function EnumResourceTypes(ByVal hModule As IntPtr, ByVal lpEnumFunc As EnumResTypeProc, ByVal lParam As IntPtr) As Boolean

.

    ''' Enumerates a module for predefined resource types.

.

    ''' <param name="resources">If NULL, all resource types will be enumerated.</param>

.

    Public Shared Function GetResourceTypes(fullPath As String, _

.

                  resources() As ResourceType) As Dictionary(Of ResourceType,  _

.

    If IsNothing(resources) OrElse resources.Length = 0 Then resources = _

.

        CType([Enum].GetValues(GetType(ResourceType)), ResourceType())

.

    Dim LS As New Dictionary(Of ResourceType, List(Of String))

.

         Dim rt = CType(CInt(lpType), ResourceType)

.

         Dim ResID = MAKEINTRESOURCE(lpzName)

.

        Dim rt = CType(CInt(rType), ResourceType)

.

        If Array.IndexOf(resources, rt) > -1 Then

.

            EnumResourceNames(hm, rType, typeCallBack, IntPtr.Zero)

.

    EnumResourceTypesW(hMod, callBack, IntPtr.Zero)

.
Documentation
[EnumResourceTypes] on MSDN
.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

. .
Summary
.

static extern IntPtr FindResourceEx(IntPtr hModule, IntPtr lpType, IntPtr lpName, ushort wLanguage);

.

Private Shared Function FindResourceEx(ByVal hModule As IntPtr, ByVal lpType As IntPtr, ByVal lpName As IntPtr, ByVal wLanguage As UShort) As IntPtr

.
Documentation
[FindResourceEx] on MSDN
. .
Summary
.

static extern IntPtr FindResourceEx(IntPtr hModule, IntPtr lpType,

.
Documentation
[FindResourceEx] on MSDN
.

      if (EnumResourceNames(hExe, "FILE", cb, (IntPtr)gch) == false) {

.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

.

    LOCALE_SPARENT        =0x0000006d,   // Fallback name for resources

.

            Resources.Strings.ProjectNotFound,

.

If you only want to load resources from the library, specify LoadLibraryFlags.LoadLibraryAsDatafile as dwFlags. In this case, nothing is done to execute or prepare to execute the mapped file.

.

If you only want to load resources from the library, specify LoadLibraryFlags.LoadLibraryAsDatafile as dwFlags. In this case, nothing is done to execute or prepare to execute the mapped file.

. .
Summary
.

static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResInfo);

.

Private Shared Function LoadResource(hModule As IntPtr, hResInfo As IntPtr) As IntPtr

.

hModule is the handle to the module in the executable, returned by FindResource

.

hResInfo is the return value from FindResource.

.
Documentation
[LoadResource] on MSDN
.
Summary
.

static extern IntPtr LockResource(IntPtr hResData);

.

Private Shared Function LockResource(hResData As IntPtr) As IntPtr

.

this function returnes a pointer to the resource. you can use Marshal.Copy() to copy the data from the pointer to a managed array.

.

      pResource = LockResource(hResource);

.

      if (hResource.ToInt32() == 0) {

.

      Marshal.Copy(pResource, fileBuffComp, 0, fileSizeComp + mOffset);

.

    [DllImport("Kernel32.dll", EntryPoint = "FindResourceW", SetLastError = true, CharSet = CharSet.Unicode)]

.

    private static extern IntPtr FindResource(IntPtr hModule, string pName, string pType);

.

    [DllImport("Kernel32.dll", EntryPoint = "SizeofResource", SetLastError = true)]

.

    private static extern uint SizeofResource(IntPtr hModule, IntPtr hResource);

.

    [DllImport("Kernel32.dll", EntryPoint = "LoadResource", SetLastError = true)]

.

    private static extern IntPtr LoadResource(IntPtr hModule, IntPtr hResource);

.

    [DllImport("Kernel32.dll", EntryPoint = "LockResource")]

.

    private static extern IntPtr LockResource(IntPtr hGlobal);

.

    internal static int TestFindResource()

.

    IntPtr resH1 = FindResource(IntPtr.Zero, "RES_CUSTOMIZE", "CUSTOM");

.

    IntPtr resH2 = LoadResource(IntPtr.Zero, resH1);

.

    IntPtr resH3 = LockResource(resH2);

.

    uint resSize = SizeofResource(IntPtr.Zero, resH1);

.
Documentation
[LockResource] on MSDN

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: