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
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "GetDC" in [All]

netapi32

.
  • computerName: String that specifies the name of the remote server to process this function. This parameter must be the name of a domain controller. A non-domain controller can call this function by calling DsGetDcName to find the domain controller.
.

static extern void DsGetDcClose(

.

    IntPtr GetDcContextHandle

.

Declare Function DsGetDcClose Lib "netapi32.dll" (TODO) As TODO

.
Documentation
[DsGetDcClose] on MSDN
. .
Summary
The DsGetDcName function returns the name of a domain controller in a specified domain. This function accepts additional domain controller selection criteria to indicate preference for a domain controller with particular characteristics.
.

static extern int DsGetDcName

.

Declare Function DsGetDcName Lib "netapi32.dll" (TODO) As TODO

.

Pointer to a PDOMAIN_CONTROLLER_INFO value that receives a pointer to a DOMAIN_CONTROLLER_INFO structure that contains data about the domain controller selected. This structure is allocated by DsGetDcName. The caller must free the structure using the NetApiBufferFree function when it is no longer required.

.

  static extern int DsGetDcName  

.

    DSGETDCNAME_FLAGS flags,

.

  public enum DSGETDCNAME_FLAGS : uint

.

     int val = DsGetDcName("","",0,"",

.

     DSGETDCNAME_FLAGS.DS_DIRECTORY_SERVICE_REQUIRED|

.

     DSGETDCNAME_FLAGS.DS_RETURN_DNS_NAME|

.

     DSGETDCNAME_FLAGS.DS_IP_REQUIRED, out pDCI);

.
Documentation
[DsGetDcName] on MSDN
.
Summary
The DsGetDcNext function retrieves the next domain controller in a domain controller enumeration operation.
.

internal static extern DWORD DsGetDcNext(

.

     HANDLE GetDcContextHandle,

.

[DllImport("Netapi32.dll", EntryPoint = "DsGetDcNextW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]

.

internal static extern int DsGetDcNext([In] IntPtr getDcContextHandle,

.

Declare Function DsGetDcNext Lib "netapi32.dll" (TODO) As TODO

.

GetDcContextHandle

.

in Contains the domain controller enumeration context handle provided by the DsGetDcOpen function.

.

     DWORD rc = NativeMethods.DsGetDcNext(

.

        iReturn = DsGetDcOpen("domain1.mydomains.com", 1, "MYADSITE", (System.IntPtr)null, null, 0, out pDcContext);

.

                int rc = DsGetDcNext(pDcContext,ref ptr1,out ptr2,out pDnsHostName);

.

        DsGetDcClose(pDcContext);

.
Documentation
[DsGetDcNext] on MSDN
.
Summary
The DsGetDcOpen function opens a new domain controller enumeration operation
.

internal static extern DWORD DsGetDcOpen(

.

     out IntPtr RetGetDcContext

.

[DllImport("Netapi32.dll", EntryPoint = "DsGetDcOpenW", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Unicode)]

.

internal static extern int DsGetDcOpen(

.

    out IntPtr retGetDcContext

.

Declare Function DsGetDcOpen Lib "netapi32.dll" (TODO) As TODO

.

RetGetDcContext

.

out Pointer to a HANDLE value that receives the domain controller enumeration context handle. This handle is used with the DsGetDcNext function to identify the domain controller enumeration operation. This handle is passed to DsGetDcClose to close the domain controller enumeration operation.

.

    iReturn = DsGetDcOpen("domain1.mydomains.com", 0, null, (System.IntPtr)null, null, 0, out pDcContext);

.

    iReturn = DsGetDcOpen("domain1.mydomains.com", 1, "MYADSITE", (System.IntPtr)null, null, 0, out pDcContext);

.
Documentation
[DsGetDcOpen] on MSDN
.

internal static extern System.Int32 DsGetDcSiteCoverage(

.

int i = DsGetDcSiteCoverage("myDCname.domain1.mydomains.com", out lEntryCount, out pSiteNames);

.
Documentation
[DsGetDcSiteCoverage] on MSDN
.
Summary
The NetGetDCName function returns the name of the primary domain controller (PDC). It does not return the name of the backup domain controller (BDC) for the specified domain. Also, you cannot remote this function to a non-PDC server.
.

static extern NetApiStatus NetGetDCName(string serverName, string domainName, out IntPtr buffer);

.

  Private Shared Function NetGetDCName(ByVal serverName As String, ByVal domainName As String, ByRef buffer As IntPtr) As NetApiStatus

.

public static string GetDCName()

.

        NetApiStatus result = NetGetDCName(null, null, out domainInfo);

.

  Public Shared Function GetDCName() As String

.

      Dim result As NetApiStatus = NetGetDCName(Nothing, Nothing, domainInfo)

.
Documentation
[NetGetDCName] on MSDN
.

    if(DsGetDcName(null, null, null, null, 0, out pDCI)==0)

Enums

.
Summary
.

/// <summary>Values to pass to the GetDCEx method.</summary>

.

''' <summary>Values to pass to the GetDCEx method.</summary>

.

Used with the GetDCEx function

gdi32

.

        [DllImport("user32.dll",EntryPoint="GetDC")]

.

        static extern IntPtr GetDC(IntPtr hWnd);

.

                IntPtr wDc = GetDC(this.Handle);

.

        [DllImport("user32.dll",EntryPoint="GetDC")]

.

        static extern IntPtr GetDC(IntPtr hWnd);

.

                IntPtr wDc = GetDC(this.Handle);

.

/// <remarks>An application must not delete a DC whose handle was obtained by calling the <c>GetDC</c> function. Instead, it must call the <c>ReleaseDC</c> function to free the DC.</remarks>

.

        [DllImport("user32.dll",EntryPoint="GetDC")]

.

        static extern IntPtr GetDC(IntPtr hWnd);

.

                IntPtr wDc = GetDC(this.Handle);

.

     IntPtr hDC = GetDC(IntPtr.Zero); //Screen DC

15: GetDC
.

static extern IntPtr GetDC(IntPtr hWnd);

.

Public Shared Function GetDC(ByVal hwnd As IntPtr) As IntPtr

.

Public Declare Function GetDC Lib "user32.dll" _

.

IntPtr dc = GetDC(hWnd);

.
Documentation
[GetDC] on MSDN
.
Summary
.

static extern uint GetDCBrushColor(IntPtr hdc);

.
Documentation
[GetDCBrushColor] on MSDN
.

  static extern IntPtr GetDC(IntPtr hwnd);

.

    IntPtr hdc = GetDC(IntPtr.Zero);

.

      static extern IntPtr GetDC(IntPtr hwnd);

.

       IntPtr hdc = GetDC(IntPtr.Zero);

.

public static extern IntPtr GetDC(IntPtr hWnd);

.

public static extern IntPtr GetDC(IntPtr hWnd);

.

   SetDeviceGammaRamp(GetDC(IntPtr.Zero), ref ramp);

user32

19: GetDC
.
Summary
.

static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, DeviceContextValues flags);

.

Private Shared Function GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As DeviceContextValues) As IntPtr

.

Private Declare Function Lib "user32.dll" GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As DeviceContextValues) As IntPtr

.

This function is an extension to the GetDC function, which gives an application more control over how and whether clipping occurs in the client area.

.

Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of DCs is limited only by available memory.

.

Handle to the window whose DC is to be retrieved. If this value is NULL, GetDCEx retrieves the DC for the entire screen.</param>

.

Specifies a clipping region that may be combined with the visible region of the DC. If the value of flags is DCX_INTERSECTRGN or DCX_EXCLUDERGN, then the operating system assumes ownership of the region and will automatically delete it when it is no longer needed. In this case, applications should not use the region—not even delete it—after a successful call to GetDCEx.</param>

.

Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of "DCs" is limited only by available memory.

.
Documentation
[GetDCEx] on MSDN
.
Summary
.

static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, DeviceContextValues flags);

.

Private Shared Function GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As Integer) As IntPtr

.

Private Declare Function Lib "user32.dll" GetDCEx(ByVal hWnd As IntPtr, ByVal hrgnClip As IntPtr, ByVal DeviceContextValues As Integer) As IntPtr

.

/// <summary>Values to pass to the GetDCEx method.</summary>

.

This function is an extension to the GetDC function, which gives an application more control over how and whether clipping occurs in the client area.

.

Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of DCs is limited only by available memory.

.

Handle to the window whose DC is to be retrieved. If this value is NULL, GetDCEx retrieves the DC for the entire screen.</param>

.

Specifies a clipping region that may be combined with the visible region of the DC. If the value of flags is DCX_INTERSECTRGN or DCX_EXCLUDERGN, then the operating system assumes ownership of the region and will automatically delete it when it is no longer needed. In this case, applications should not use the region—not even delete it—after a successful call to GetDCEx.</param>

.

Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of "DCs" is limited only by available memory.

.
Documentation
[GetDCEx] on MSDN
.

GetWindowDC is intended for special painting effects within a window's nonclient area. Painting in nonclient areas of any window is not recommended. The GetSystemMetrics function can be used to retrieve the dimensions of various parts of the nonclient area, such as the title bar, menu, and scroll bars. The GetDC function can be used to retrieve a device context for the entire screen.

.

The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC.

.

An application cannot use the ReleaseDC function to release a DC that was created by calling the CreateDC function; instead, it must use the DeleteDC function. ReleaseDC must be called from the same thread that called GetDC.

.

        IntPtr screenDc = Win32.GetDC(IntPtr.Zero);

.

        public extern static IntPtr GetDC(IntPtr handle);

coredll

.

    IntPtr hdc = GetDC(IntPtr.Zero);

.

private static extern IntPtr GetDC(IntPtr hwnd);

.

        IntPtr hdc = GetDC(IntPtr.Zero);

.

    private static extern IntPtr GetDC(IntPtr hwnd);

26: GetDC
.

[DllImport("coredll", EntryPoint="GetDC", SetLastError=true)]

.

private static extern IntPtr GetDCCE(IntPtr hWnd);

.

Declare Function GetDC Lib "coredll.dll" (TODO) As TODO

.
Documentation
[GetDC] on MSDN

 
Access PInvoke.net directly from VS: