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

advapi32

.

             NativeMethods.CloseHandle(tokenHandle);

.

      internal static extern Boolean CloseHandle(IntPtr hObject);

.

    Private Function CloseHandle(ByVal hHandle As IntPtr) As Boolean

.

            CloseHandle(hToken)

.

    static extern bool CloseEventLog(IntPtr hEventLog);

.

           CloseEventLog(logHandle);

.

        // Make sure to close open handles

.

        CloseServiceHandle(svcHandle);

.

        CloseServiceHandle(scHandle);

.

        // Make sure to close open handles

.

        CloseServiceHandle(svcHandle);

.

        CloseServiceHandle(scHandle);

.

        // Ensure any open handle is closed.

.

            NativeMethods.CloseEventLog(hEventLog);

.
Summary
Closes a read handle to the specified event log.
.

static extern bool CloseEventLog(IntPtr hEventLog);

.

Declare Function CloseEventLog Lib "advapi32.dll" (TODO) As TODO

.
Documentation
[CloseEventLog] on MSDN
.
Summary
The CloseServiceHandle function closes a handle to a service control manager or service object.
.

public static extern bool CloseServiceHandle( IntPtr hSCObject );

.

    Private Shared Function CloseServiceHandle(ByVal serviceHandle As IntPtr) As Boolean

.

    Declare Function CloseServiceHandle Lib "advapi32.dll" (ByVal hSCObject As IntPtr) As Boolean

.

Handles returned from CreateService must be closed using this function, rather than the standard CloseHandle

.
Documentation
.

         Interop.CloseServiceHandle (serviceHandle);

.

         Interop.CloseServiceHandle (serviceControlManagerHandle);

.

     internal static extern bool CloseServiceHandle (IntPtr hSCObject);

.

    Public Function CloseHandle(ByVal handle As IntPtr) As Boolean

.

    CloseHandle(processInfo.process)

.

    CloseHandle(processInfo.thread)

.

        public static extern bool CloseHandle(IntPtr handle);

.

            CloseHandle(processInfo.process);

.

            CloseHandle(processInfo.thread);

.

    CloseServiceHandle(serviceHandle)

.

    CloseHandle(scHandle)

.

        #region CloseServiceHandle

.

        static extern bool CloseServiceHandle( IntPtr hSCObject );

.

                    CloseServiceHandle( schSCManager );

.

                    // if you don't close this handle, Services control panel

.

                    CloseServiceHandle( schService );

.

             CloseServiceHandle( hService );

.

     CloseServiceHandle( handle );

.

           CloseServiceHandle(handle);

.

        fileStream.Close();

.

        CloseHandle(lngTokenHandle)

.

    bool bForceAppsClosed,

.

     <MarshalAs(UnmanagedType.Bool)> ByVal bForceAppsClosed As Boolean, _

.

    bool bForceAppsClosed,

.

     <MarshalAs(UnmanagedType.Bool)> ByVal bForceAppsClosed As Boolean, _

.

        LsaClose(Policy)

.

    LsaClose(Policy)

.
Summary
The LsaClose function closes a handle to a Policy or TrustedDomain object.
.

static extern uint LsaClose(IntPtr ObjectHandle);

.

Declare Unicode Function LsaClose Lib "advapi32.dll" (ByVal ObjectHandle As IntPtr) As Int32

.
Documentation
[LsaClose] on MSDN
.

    internal static extern int LsaClose(IntPtr PolicyHandle);

.

        Win32Sec.LsaClose(lsaHandle);

.

        LsaClose(Policy)

.

    LsaClose(Policy)

.

    internal static extern int LsaClose(IntPtr PolicyHandle);

.

        Win32Sec.LsaClose(lsaHandle);

.

When done with the handle, call LsaClose

.

            LsaClose( aPolicyHandle );

.

                LsaClose(policy);

.

        private static extern long LsaClose(IntPtr ObjectHandle);

.

        LsaClose(Policy)

.

    LsaClose(Policy)

.

        LsaClose(Policy)

.

    LsaClose(Policy)

.

    private static extern uint LsaClose(

.

        uint ntsResult = LsaClose(LsaPolicyHandle);

.

        throw new Exception("LsaClose failed: " + winErrorCode);

.

    CloseEventLog(logHandle);

.

The access token handle that is returned by TokenHandle should be closed using CloseHandle (kernel32) when you are finished using it.

.

    CloseServiceHandle(scHandle)

.

        CloseServiceHandle( handle );

.

    private static extern bool CloseHandle(IntPtr handle);

.

      if (!CloseHandle(hToken))

.

          System.Diagnostics.Trace.WriteLine("Could not close cloak token!, error 0x" + dw.ToString("x4"), "Impersonation"); ;

.

public static extern int RegCloseKey(

.

Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As UIntPtr) As Integer

.

    Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Integer) _

.

    RegCloseKey(hkeyKeytoOpen)

.

Microsoft.Win32.RegistryKey.Close() Method.

.
Documentation
[RegCloseKey] on MSDN
.

     Throw New ApplicationException("Cannot access a closed registry key")

.

     Throw New ApplicationException("Cannot access a closed registry key")

.

           // The "Close()" will trigger RegNotifyChangeKeyValue if it is still listening

.

               this._monitorKey.Close();

.

     Throw New ApplicationException("Cannot access a closed registry key")

.

      RegCloseKey(hKey);

.

When I tested this API code in a tight loop, to get a value, and using the traditional RegistryKey.Close() on the returned subkey, I found that it leaked RegistryHandles.

.

     Throw New ApplicationException("Cannot access a closed registry key")

.

      RegCloseKey(hKey);

.

    'Don't forget to close the key ressource

.

    environmentReg.Close()

.

      RegCloseKey(hKey);

.

            RegCloseKey(hKey);

.

    'Don't forget to close the key ressource

.

    environmentReg.Close()

.

      RegCloseKey(hKey);

.

            RegCloseKey(hKey);

.

Provided you specify true in the SafeRegistryHandle constructor, there is then no need to call RegCloseKey either.

.

            RegCloseKey(hKey);

.
Summary
The SaferCloseLevel function closes a SAFER_LEVEL_HANDLE that was opened using the SaferIdentifyLevel function or the SaferCreateLevel function.
.

public static extern bool SaferCloseLevel(IntPtr hLevelHandle);

.

Declare Function SaferCloseLevel Lib "advapi32.dll" (ByVal hLevelHandle As Long) As Long

.
Documentation
[SaferCloseLevel] on MSDN
.

Don't forget to close the handle using SaferCloseLevel.

.

    CloseServiceHandle(scManager.ToInt32)

.

    CloseServiceHandle(hSCManager)

.

        Me.Close()

wininet

.

    InternetCloseHandle(hFind) ' close the handle.

.

    [DllImport("wininet.dll", EntryPoint = "InternetCloseHandle")]

.

    public static extern long InternetCloseHandle(IntPtr hInet);

.

            InternetCloseHandle(ftpHandle);

.

            InternetCloseHandle(internetHandle);

.

    public void CloseFTP()

.

        CloseFTP();

.

static extern bool InternetCloseHandle(IntPtr hInternet);

.

    Public Declare Function InternetCloseHandle Lib "wininet.dll" ( _

.
Documentation
[InternetCloseHandle] on MSDN
.

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.

uxtheme

.
Summary
Closes an open theme data pointer.
.

public extern static Int32 CloseThemeData(IntPtr hTheme);

.

Declare Function CloseThemeData Lib "uxtheme.dll" (ByVal hTheme As IntPtr) As Int32

.

Function CloseThemeData(ByVal hTheme As IntPtr) As Int32

.
Documentation
[CloseThemeData] on MSDN
.

    WP_CLOSEBUTTON = 18,

.

    WP_SMALLCLOSEBUTTON = 19,

.

    WP_MDICLOSEBUTTON = 20,

.

    // Close Button States

ole32

.

            CloseStorageRoot(storageRoot);

.

    private static void CloseStorageRoot(StorageInfo storageRoot)

.

        InvokeStorageRootMethod(storageRoot, "Close");

ws2_32

.

    public static extern int closesocket(IntPtr s);

.

Declare Function closesocket Lib "ws2_32.dll" (TODO) As TODO

.

static public void CloseSock(Socket sck)

.

    // to close the receiving and sending functions of the socket

.

    closesocket(sck.Handle);  

.
Documentation
[closesocket] on MSDN
.

        /// linger on close if data present

.
Summary
Close the dataset holding network connection info
.

        // linger on close if data present  

misc

.

When I expand a desktop function and then click on a sub function, my expanded list closes. This makes it difficult to go through and browse a dll.

shlwapi

.
Summary
PathQuoteSpaces - Searches a path for spaces. If spaces are found, the entire path is enclosed in quotation marks.
.

/// Searches a path for spaces. If spaces are found, the entire path is enclosed in quotation marks.

.

''' Searches a path for spaces. If spaces are found, the entire path is enclosed in quotation marks.

odbc32

.

            SQLFreeStmt(stmtHandle, SQL_CLOSE);

.
Summary
SQLDisconnect closes the connection associated with a specific connection handle.
.
Summary
SQLFreeStmt stops processing associated with a specific hstmt, closes any open cursors associated with the hstmt, discards pending results and, optionally, frees all resources associated with a statement handle.
.

const int  SQL_CLOSE        = 0;

.

    const int  SQL_CLOSE        = 0;

winspool

.
Summary
Closes a printer connection given a handle
.

static extern int ClosePrinter(IntPtr hPrinter);        

.

<DllImport("winspool.drv", EntryPoint:="ClosePrinter", _

.

Private Shared Function ClosePrinter(ByVal hPrinter As Int32) As Boolean

.
Documentation
[ClosePrinter] on MSDN
.

ClosePrinter

.

ClosePrinter(pHandle);

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


 
Access PInvoke.net directly from VS: