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]

gdiplus

.

static extern int GdipAddPathClosedCurveI(HandleRef path, HandleRef memorypts,

.

Declare Function GdipAddPathClosedCurveI Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipAddPathClosedCurveI] on MSDN
.

static extern int GdipAddPathClosedCurve2I(HandleRef path, HandleRef memorypts,

.

Declare Function GdipAddPathClosedCurve2I Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipAddPathClosedCurve2I] on MSDN
.

static extern int GdipClosePathFigures(HandleRef path);

.

Declare Function GdipClosePathFigures Lib "gdiplus.dll" (TODO) As TODO

.
Documentation
[GdipClosePathFigures] on MSDN

msi

.
Summary
Closes an open installation handle.
.

static extern uint MsiCloseHandle(IntPtr hAny);

.
Documentation
[MsiCloseHandle] on MSDN
.
Summary
The MsiCloseHandle function closes an open installation handle.
.
Summary
The MsiOpenDatabase function opens a database file for data access. This function returns a handle that should be closed using MsiCloseHandle.
.
Summary
The MsiOpenPackageEx function opens a package to use with functions that access the product database. The MsiCloseHandle function must be called with the handle when the handle is no longer needed.
.
Summary
The MsiOpenProduct function opens a product for use with the functions that access the product database. The MsiCloseHandle function must be called with the handle when the handle is no longer needed.
.

The sample application below demonstrates how to use MsiRecordSetString, MsiOpenDatabase, MsiCreateRecord, MsiCloseHandle, MsiDatabaseOpenView, MsiViewExecute, MsiDatabaseCommit, and MsiViewClose in C# to modify a property value in an MSI database. To run it, simply create a new Windows Console application and replace the code that Visual Studio gives you with the code below. You may have to modify the namespace name. The sample as-is requires a valid MSI database named SETUP.msi, with a property named PROPERTY1 in the Property table, to be located in C:\. You can of course change the path to your MSI database in the calls to ChangeMSIProperty() in Main() and use any existing property you wish.

.

    static extern int MsiCloseHandle(IntPtr hAny);

.

    static extern int MsiViewClose(IntPtr viewhandle);

.

        // Close the view.

.

        returnValue = (WINDOWS_MESSAGE_CODES)MsiViewClose(msiView);

.

            // Failed to close the view.

.

            throw new MsiInstallationSupportException(string.Format(CultureInfo.InvariantCulture, "MsiViewClose returned error code {0}.", returnValue.ToString()));

.

        // Close handles or you could get a corrupted database and un-closed handles.

.

            MsiCloseHandle(msiRecord);

.

            MsiCloseHandle(msiView);

.

            MsiCloseHandle(msiHandle);

.

static extern int MsiViewClose(IntPtr viewhandle);

.

Declare Function MsiViewClose Lib "msi.dll" (TODO) As TODO

.
Documentation
[MsiViewClose] on MSDN

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

wlanapi

.
Summary
.

        [DllImport("Wlanapi", EntryPoint = "WlanCloseHandle")]

.

        public static extern uint WlanCloseHandle([In] IntPtr hClientHandle,

.

    <DllImport("Wlanapi", EntryPoint := "WlanCloseHandle")> _

.

    Public Shared Function WlanCloseHandle(<[In]> ByVal hClientHandle As IntPtr, ByVal pReserved As IntPtr) As UInteger

.
Documentation
[WlanCloseHandle] on MSDN
.

            WlanCloseHandle(handle, IntPtr.Zero);

.

         WlanCloseHandle(handle, IntPtr.Zero)

ole32

.

            CloseStorageRoot(storageRoot);

.

    private static void CloseStorageRoot(StorageInfo storageRoot)

.

        InvokeStorageRootMethod(storageRoot, "Close");

quickusb

16: Close
.

        Close();

.

        Close();

.
Summary
Closes the connection to the device
.

private static extern int QuickUsbClose(IntPtr handle);

.

Declare Function QuickUsbClose Lib "quickusb.dll" (TODO) As TODO

.

int result = QuickUsbClose(handle);

.
Documentation
[QuickUsbClose] on MSDN
.

            Close();

.

        Close();

.

        Close();

urlmon

.

        fs.Close();

.

    fs.Close()

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.

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


 
Access PInvoke.net directly from VS: