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

Interfaces

.

        int GetWindow(out IntPtr phwnd);

.

    Public Overridable Sub GetWindow(ByRef phwnd As System.IntPtr) Implements IDeskBand.GetWindow, IDockingWindow.GetWindow, IOleWindow.GetWindow

.

    Sub GetWindow(ByRef phwnd As System.IntPtr)

.

    Sub GetWindow(ByRef phwnd As System.IntPtr)

.

    Sub GetWindow(ByRef phwnd As System.IntPtr)

.

        int GetWindow(out IntPtr phwnd);

.

    Public Overridable Sub GetWindow(ByRef phwnd As System.IntPtr) Implements IDeskBand.GetWindow, IDockingWindow.GetWindow, IOleWindow.GetWindow

.

    Sub GetWindow(ByRef phwnd As System.IntPtr)

.

    Sub GetWindow(ByRef phwnd As System.IntPtr)

.

    Sub GetWindow(ByRef phwnd As System.IntPtr)

.

    void GetWindow (out IntPtr phwnd) ;

.

      Sub GetWindow(<System.Runtime.InteropServices.Out()> ByRef phwnd As IntPtr)

.
IMPORTANT
The phwnd parameter for the VB Definition of GetWindow MUST be ByRef or else a 'protected memory' error will occur. - Andrew Powell 04.27.08
.

    void GetWindow(out IntPtr phwnd);

kernel32

.
Summary
.

static extern uint GetWindowsDirectory(StringBuilder lpBuffer,

.

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

.

Public Function GetWindowsDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _

.

Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _

.

   Dim Res As Integer = GetWindowsDirectory(WinDir, WinDir.Length)

.

     GetWindowsDirectory(sb,i)

.

   int len = (int)GetWindowsDirectory(sb, MaxPathLength);

.

     GetWindowsDirectory(sb,ref  i);

.
Documentation
[GetWindowsDirectory] on MSDN

advapi32

.

    string _getWindowsProductId()

.

    string _getWindowsProductId()

dwmapi

.

static extern int DwmGetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE dwAttribute, out bool pvAttribute, int cbAttribute);

.

static extern int DwmGetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE dwAttribute, out RECT pvAttribute, int cbAttribute);

.

Declare Function DwmGetWindowAttribute Lib "dwmapi.dll" (TODO) As TODO

.
Documentation
[DwmGetWindowAttribute] on MSDN

coredll

.

[DllImport("coredll.dll", EntryPoint="GetWindowDC", SetLastError=true)]

.

private static extern IntPtr GetWindowDCCE(IntPtr hWnd);

.

<DllImport("coredll.dll", EntryPoint:="GetWindowDC", CharSet:=CharSet.Auto, ExactSpelling:=True)> _

.

Private Shared Function GetWindowDC(ByVal hWnd As HandleRef) As IntPtr

.

Declare Function GetWindowDC Lib "coredll.dll" (ByVal hWnd As HandleRef) As IntPtr

.
Documentation
[GetWindowDC] on MSDN
.
Summary
This function retrieves information about the specified window. GetWindowLong also retrieves the 32-bit value at the specified offset into the extra window memory of a window.
.

static extern System.UInt32 GetWindowLong(IntPtr  hWnd, int nIndex);

.

static extern IntPtr GetWindowLong(IntPtr window, int index);

.

    Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As System.UInt32

.
Documentation
[GetWindowLong] on MSDN
.
Summary
.

private static extern int GetWindowLong(IntPtr hWnd, int nIndex);

.

Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Integer

.

        style = GetWindowLong(hWnd, GWL_STYLE);

.

    Private Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Integer

.

    style = GetWindowLong(hWnd, GWL_STYLE)

psapi

.

GetWindowThreadProcessId(hWnd, out pid);

shell32

13: CSIDL
.

            CSIDL_WINDOWS           = 0x0024,    // GetWindowsDirectory()

.

        CSIDL_WINDOWS         = 0x0024,    // GetWindowsDirectory()

.

        CSIDL_WINDOWS       = 0x0024,    // GetWindowsDirectory()

Structures

.

     /// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT).

.

     /// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.

.

Use with GetWindowPlacement and SetWindowPlacement

setupapi

.

   if (0 == GetWindowsDirectory(winDir, winDir.Capacity)) return (false);

uxtheme

.

public extern static IntPtr GetWindowTheme(IntPtr hWnd);

.

Public Declare Function GetWindowTheme Lib "uxtheme.dll" (ByVal hWnd As IntPtr) As IntPtr

.

If a window has a visual style applied, the GetWindowTheme function returns the most recent theme handle from OpenThemeData. If no visual style is applied, GetWindowTheme returns NULL.

.
Documentation
[GetWindowTheme] on MSDN

Enums

.
Summary
.
Summary
.
Summary

Constants

.

        public class GetWindowConstants {

.

        public class GetWindowConstantsObsolete {

gdi32

25: BitBlt
.

            dc2=GetWindowDC(c.Handle);

.
Summary
.

static extern bool GetWindowExtEx(IntPtr hdc, out SIZE lpSize);

.
Documentation
[GetWindowExtEx] on MSDN
.
Summary
.

static extern bool GetWindowOrgEx(IntPtr hdc, out POINT lpPoint);

.
Documentation
[GetWindowOrgEx] on MSDN

user32

.

    static extern bool GetWindowRect(System.IntPtr hWnd, out RECT lpRect);

.

        GetWindowRect(hWnd, out to);

.

    bool GetWindowRect(int hWnd, RECT^ lpRect);

.

        GetWindowRect(hWnd, to);

.

    EnumedWindow callBackPtr = GetWindowHandle;

.

private static bool GetWindowHandle(IntPtr windowHandle, ArrayList windowHandles)

.

    [DllImport("user32.dll", EntryPoint = "GetWindowText",

.

    public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpWindowText, int nMaxCount);

.

        int nLength = user32.GetWindowText(hWnd, strbTitle, strbTitle.Capacity + 1);

.

Can be used to find the active window Hwnd for GetWindowText

.

    Private Declare Auto Function GetWindowDC Lib "user32.dll" (ByVal windowHandle As IntPtr) As IntPtr

.

    Dim srcDeviceContext As IntPtr = GetWindowDC(windowHandle)

.

            //Optional Win32.GetWindowThreadProcessId(GetForegroundWindow(),out ProcessID)

.
Summary
There is no GetNextWindow function. It is actually a macro for the GetWindow function. Call GetWindow instead.
.
Summary
.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);

.

Private Shared Function GetWindowThreadProcessId(ByVal hwnd As IntPtr, _

.

    ''' <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. </param>

.

    Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _

.

  GetWindowThreadProcessId(lngAccessHwnd, lngPid)

.

    Public Declare Auto Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As IntPtr) As IntPtr

.

        GetWindowThreadProcessId(hOwner, iProcessID)

.

IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);

.

GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and:

.

int threadID = GetWindowThreadProcessId(hWnd, out processID);

.
Documentation
[GetWindowThreadProcessId] on MSD
.
Summary
The GetWindowDC function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area. GetWindowDC assigns default attributes to the window device context each time it retrieves the device context. Previous attributes are lost.
.

static extern IntPtr GetWindowDC(IntPtr hWnd);

.

Public Shared Function GetWindowDC(ByVal hWnd As IntPtr) As IntPtr

.

Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As Long

.

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.

.

  Declare Function GetWindowDC Lib "user32" (ByVal hwnd As IntPtr) As IntPtr

.

    Dim MyGrphHdc As IntPtr = GetWindowDC(Me.Handle)

.
Documentation
[GetWindowDC] on MSDN
.
Summary
.

private static extern bool GetWindowInfo(IntPtr hwnd, ref WINDOWINFO pwi);

.

Public Declare Auto Function GetWindowInfo Lib "user32" _

.

Public Shared Function GetWindowInfo(ByVal hwnd As IntPtr, ByRef pwi As WINDOWINFO) As Boolean

.

You must assign the cbSize parameter prior to calling GetWindowInfo(). For example:

.

    GetWindowInfo(Handle, ref info);

.

    GetWindowInfo(Handle, info)

.
Documentation
[GetWindowInfo] on MSDN
.
Summary
.

On this platform this function is in fact a macro that calls GetWindowLong, so the EntryPoint property has to be set to the real function:

.

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

.

static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);

.

<DllImport("user32.dll", EntryPoint:="GetWindowLong")> _

.

Private Shared Function GetWindowLongPtr(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As WindowLongFlags) As IntPtr

.

Public Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" _

.

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

.

private static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);

.

<DllImport("user32.dll", EntryPoint:="GetWindowLongPtr")> _

.

Private Shared Function GetWindowLongPtr(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As WindowLongFlags) As IntPtr

.

Public Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" _

.

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

.

private static extern IntPtr GetWindowLongPtr32(IntPtr hWnd, int nIndex);

.

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

.

private static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, int nIndex);

.

// GetWindowLongPtr directly

.

public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)

.

     return GetWindowLongPtr64(hWnd, nIndex);

.

     return GetWindowLongPtr32(hWnd, nIndex);

.

<DllImport("user32.dll", EntryPoint:="GetWindowLong")> _

.

Private Shared Function GetWindowLongPtr32(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr

.

<DllImport("user32.dll", EntryPoint:="GetWindowLongPtr")> _

.

Private Shared Function GetWindowLongPtr64(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr

.

' This static method is required because Win32 does not support GetWindowLongPtr dirctly

.

Public Shared Function GetWindowLongPtr(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr

.

      Return GetWindowLongPtr64(hWnd, nIndex)

.

      Return GetWindowLongPtr32(hWnd, nIndex)

.

     result = GetWindowLongPtr(winhandle, GWL.GWL_ID);

.
Documentation
[GetWindowLongPtr] on MSDN
.
Summary
.

On this platform this function is in fact a macro that calls GetWindowLong, so the EntryPoint property has to be set to the real function:

.

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

.

static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);

.

<DllImport("user32.dll", EntryPoint:="GetWindowLong")> _

.

Private Shared Function GetWindowLongPtr(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As GWL) As IntPtr

.

Public Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" _

.

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

.

private static extern IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex);

.

<DllImport("user32.dll", EntryPoint:="GetWindowLongPtr")> _

.

Private Shared Function GetWindowLongPtr(ByVal hWnd As HandleRef, <MarshalAs(UnmanagedType.I4)>nIndex As GWL) As IntPtr

.

Public Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" _

.

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

.

private static extern IntPtr GetWindowLongPtr32(IntPtr hWnd, int nIndex);

.

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

.

private static extern IntPtr GetWindowLongPtr64(IntPtr hWnd, int nIndex);

.

// GetWindowLongPtr directly

.

public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex)

.

     return GetWindowLongPtr64(hWnd, nIndex);

.

     return GetWindowLongPtr32(hWnd, nIndex);

.

<DllImport("user32.dll", EntryPoint:="GetWindowLong")> _

.

Private Shared Function GetWindowLongPtr32(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr

.

<DllImport("user32.dll", EntryPoint:="GetWindowLongPtr")> _

.

Private Shared Function GetWindowLongPtr64(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr

.

' This static method is required because Win32 does not support GetWindowLongPtr dirctly

.

Public Shared Function GetWindowLongPtr(ByVal hWnd As HandleRef, ByVal nIndex As Integer) As IntPtr

.

      Return GetWindowLongPtr64(hWnd, nIndex)

.

      Return GetWindowLongPtr32(hWnd, nIndex)

.

     result = GetWindowLongPtr(winhandle, GWL.GWL_ID);

.
Documentation
[GetWindowLongPtr] on MSDN
.
Summary
.

static extern uint GetWindowModuleFileName(IntPtr hwnd,

.

  Private Shared Function GetWindowModuleFileName(hwnd As IntPtr, _

.
Workaround
Use GetWindowThreadProcessId to get the process ID, then Process.GetProcessById to retrieve the process information. The resultant System.Diagnostics.Process Object's MainModule Property has the Filename Property, which is the Information you are probably searching.
.

GetWindowModuleFileName(hwnd, fileName, 2000);

.
Documentation
[GetWindowModuleFileName] on MSDN
.
Summary
.

/// Before calling GetWindowPlacement, set the length member to sizeof(WINDOWPLACEMENT). GetWindowPlacement fails if lpwndpl-> length is not set correctly.

.

internal static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);

.

Private Shared Function GetWindowPlacement(ByVal hWnd As IntPtr, ByRef lpwndpl As WINDOWPLACEMENT) As Boolean

.

Public Declare Function GetWindowPlacement Lib "user32" _

.

    static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);

.

       GetWindowPlacement(this.Handle, ref placement);

.

    Private Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As IntPtr, ByRef lpwndpl As WINDOWPLACEMENT) As Integer

.

        intRet = GetWindowPlacement(Me.Handle.ToInt32, wpTemp)

.
Documentation
[GetWindowPlacement] on MSDN
.
Summary
GetWindowPos is an old Win32 method, you should use GetWindowRect or GetWindowPlacement
.

static extern TODO GetWindowPos(TODO);

.

Declare Function GetWindowPos Lib "user32.dll" (TODO) As TODO

.

Use GetWindowRect Win32 method for position information.

.

Use GetWindowPlacement Win32 method for a more detailed set of info such as Z-Order.

.
Documentation
[GetWindowPos] on MSDN
.
Summary
.

static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);

.

Private Shared Function GetWindowRect(ByVal hWnd As HandleRef, ByRef lpRect As RECT) As Boolean

.

static extern bool GetWindowRect(HandleRef hWnd, out RECT lpRect);

.

     if(!GetWindowRect(new HandleRef(this, this.Handle), out rct ))

.
Documentation
[GetWindowRect] on MSDN
.
Summary
.

static extern int GetWindowRgn(IntPtr hWnd, IntPtr hRgn);

.

Private Shared Function GetWindowRgn(ByVal hWnd As IntPtr, ByVal hRgn As IntPtr) As Integer

.
Documentation
[GetWindowRgn] on MSDN
.
Summary
.

///     GetWindowTextLength cannot retrieve the length of the text of an edit control in another application.

.

///     If the target window is owned by the current process, <see cref="GetWindowTextLength" /> causes a

.

///     <see cref="GetWindowTextLength" /> function may return a value that is larger than the actual length of the

.

///     occur when an application uses the ANSI version of <see cref="GetWindowTextLength" /> with a window whose window

.

///     procedure is Unicode, or the Unicode version of <see cref="GetWindowTextLength" /> with a window whose window

.

///     GetWindowText function.

.

static extern int GetWindowTextLength(IntPtr hWnd);

.

Private Shared Function GetWindowTextLength(ByVal hwnd As IntPtr) As Integer

.

class method GetWindowTextLength(hWnd: IntPtr): Int32; external;

.

Public Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" _

.

Often used with GetWindowText

.

(See GetWindowText.)

.
Documentation
[GetWindowTextLength] on MSDN
.
Summary
.

static extern int GetWindowTextLength(IntPtr hWnd);

.

Private Shared Function GetWindowTextLength(ByVal hwnd As IntPtr) As Integer

.

class method GetWindowTextLength(hWnd: IntPtr): Int32; external;

.

Public Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" _

.

Often used with GetWindowText

.

(See GetWindowText.)

.
Documentation
[GetWindowTextLength] on MSDN
.
Summary
.

static extern int GetWindowTextLength(IntPtr hWnd);

.

Private Shared Function GetWindowTextLength(ByVal hwnd As IntPtr) As Integer

.

Public Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" _

.

Often used with GetWindowText

.

(See GetWindowText.)

.
Documentation
[GetWindowTextLength] on MSDN
.
Summary
.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

.

static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);

.

Private Shared Function GetWindowThreadProcessId(ByVal hwnd As IntPtr, _

.

    ''' <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. </param>

.

    Private Declare Auto Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _

.

  GetWindowThreadProcessId(lngAccessHwnd, lngPid)

.

    Public Declare Auto Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As IntPtr, ByRef lpdwProcessId As IntPtr) As IntPtr

.

        GetWindowThreadProcessId(hOwner, iProcessID)

.

IntPtr pID = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);

.

GetWindowThreadProcessId returns the id of the thread that created the target window. To get the process id of a window, use the first c# signature above, and:

.

int threadID = GetWindowThreadProcessId(hWnd, out processID);

.
Documentation
[GetWindowThreadProcessId] on MSD
.

GetWindowRect(hWnd, out rct);

.

    internal static extern bool GetWindowRect(IntPtr hWnd, ref RECT rect);

.

        GetWindowRect(id, ref Rect);

.
Summary
.

static extern uint RealGetWindowClass(IntPtr hwnd, [Out] StringBuilder pszType,

.

Private Shared Function RealGetWindowClass(ByVal hWnd As IntPtr, _

.

public static string RealGetWindowClassM(IntPtr hWnd)

.

    RealGetWindowClass(hWnd, pszType, (UInt32)pszType.Capacity);

.
Documentation
[RealGetWindowClass] on MSDN
.

    private static extern int GetWindowThreadProcessId(

.

        StatusBar.GetWindowThreadProcessId(this._handle, out pid);

.

GetWindowRect(hWnd, out rct);

.

static int GetWindowTextLength(IntPtr hwnd) {

.

    uint foreThread = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);

.

        SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) ^ WS_EX_LAYERED);

.

  ll_Ret = GetWindowLong(ll_handle, GWL_EXSTYLE)

.

// to the correct function (GetWindowLong in 32-bit mode and GetWindowLongPtr in 64-bit mode)

.

        var windowRec = GetWindowRect(windowHandler);

60: TCITEM
.

    GetWindowThreadProcessId((IntPtr)handle, out ProcessID);

.

    static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

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


 
Access PInvoke.net directly from VS: