• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Windows.App
    • AppQuery
  • Dapplo.Windows.Citrix
    • WinFrame
  • Dapplo.Windows.Citrix.Enums
    • ConnectStates
    • EventMask
    • InfoClasses
  • Dapplo.Windows.Citrix.Structs
    • ClientAddress
    • ClientDisplay
  • Dapplo.Windows.Clipboard
    • ClipboardMonitor
    • ClipboardNative
    • ClipboardUpdateInformation
    • StandardClipboardFormats
  • Dapplo.Windows.Com
    • ComProgIdAttribute
    • ComWrapper
    • DisposableCom
    • IDispatch
    • IDisposableCom<T>
    • IOleCommandTarget
    • IOleWindow
    • IUnknown
  • Dapplo.Windows.Common
    • Win32
    • WindowsVersion
  • Dapplo.Windows.Common.Enums
    • AdjacentTo
    • HResult
    • Win32Error
  • Dapplo.Windows.Common.Extensions
    • HResultExtensions
    • RectExensions
  • Dapplo.Windows.Common.Structs
    • POINT
    • RECT
    • RECTF
    • SIZE
  • Dapplo.Windows.Desktop
    • EnvironmentChangedEventArgs
    • EnvironmentMonitor
    • IInteropWindow
    • InteropWindow
    • InteropWindowExtensions
    • InteropWindowFactory
    • InteropWindowQuery
    • WindowScroller
    • WindowsEnumerator
    • WinEventHook
  • Dapplo.Windows.DesktopWindowsManager
    • Dwm
    • DwmBlurBehind
    • DwmBlurBehindFlags
    • DwmSetIconicLivePreviewFlags
    • DwmThumbnailProperties
    • DwmThumbnailPropertyFlags
    • DwmWindowAttributes
  • Dapplo.Windows.Dpi
    • BitmapScaleHandler
    • BitmapScaleHandler<TKey>
    • DpiAwareness
    • DpiAwarenessContext
    • DpiHandler
    • WinProcListener
  • Dapplo.Windows.Dpi.Enums
    • MonitorDpiType
  • Dapplo.Windows.Dpi.Forms
    • DpiAwareForm
    • FormsExtensions
  • Dapplo.Windows.Dpi.Wpf
    • WindowExtensions
  • Dapplo.Windows.Enums
    • InteropWindowCacheFlags
    • WinEventHookFlags
    • WinEvents
  • Dapplo.Windows.Gdi32
    • Gdi32Api
    • GdiExtensions
    • GdiPlusApi
  • Dapplo.Windows.Gdi32.Enums
    • BitmapCompressionMethods
    • ColorSpaceEnum
    • DeviceCaps
    • GdiPlusStatus
    • GpUnit
    • RasterOperations
  • Dapplo.Windows.Gdi32.SafeHandles
    • SafeCompatibleDcHandle
    • SafeDcHandle
    • SafeDeviceContextHandle
    • SafeDibSectionHandle
    • SafeHBitmapHandle
    • SafeObjectHandle
    • SafeRegionHandle
    • SafeSelectObjectHandle
    • SafeWindowDcHandle
  • Dapplo.Windows.Gdi32.Structs
    • BitfieldColorMask
    • BitmapFileHeader
    • BitmapInfoHeader
    • BlurParams
    • CieXyz
    • CieXyzTripple
  • Dapplo.Windows.Input
    • Hotkey
    • InputGenerator
    • KeyboardHook
    • KeyboardHookEventArgs
    • MouseHook
    • MouseHookEventArgs
  • Dapplo.Windows.Input.Enums
    • ExtendedKeyFlags
    • ExtendedMouseFlags
    • HookTypes
    • InputTypes
    • KeyEventFlags
    • MouseEventFlags
    • ScanCodes
    • VirtualKeyCodes
  • Dapplo.Windows.Input.Structs
    • HardwareInput
    • Input
    • InputUnion
    • KeyboardInput
    • KeyboardLowLevelHookStruct
    • MouseInput
    • MouseLowLevelHookStruct
  • Dapplo.Windows.Interop
    • DisposableCom
    • IDisposableCom<T>
  • Dapplo.Windows.Kernel32
    • Kernel32Api
    • PsApi
  • Dapplo.Windows.Kernel32.Enums
    • GlobalMemorySettings
    • ProcessAccessRights
    • ThreadAccess
    • WindowsProducts
    • WindowsProductTypes
    • WindowsSuites
  • Dapplo.Windows.Kernel32.Structs
    • OsVersionInfoEx
  • Dapplo.Windows.Messages
    • WindowsMessage
    • WindowsMessages
    • WinProcHandler
  • Dapplo.Windows.Multimedia
    • SoundSettings
    • SystemSounds
    • WinMm
  • Dapplo.Windows.Native
    • Shell32
    • Shell32.FolderType
    • Shell32.IconSize
  • Dapplo.Windows.Shell32
    • Shell32Api
  • Dapplo.Windows.Shell32.Enums
    • AppBarEdges
    • AppBarMessages
    • AppBarStates
  • Dapplo.Windows.Shell32.Structs
    • AppBarData
  • Dapplo.Windows.Structs
    • WinEventInfo
  • Dapplo.Windows.User32
    • User32Api
    • User32Api.EnumWindowsProc
  • Dapplo.Windows.User32.Enums
    • ClassLongIndex
    • CursorInfoFlags
    • DesktopAccessRight
    • ExtendedWindowStyleFlags
    • GetWindowCommands
    • MonitorFrom
    • MonitorInfoFlags
    • ObjectIdentifiers
    • ObjectStates
    • PrintWindowFlags
    • RegionResults
    • ScrollBarCommands
    • ScrollBarStateIndexes
    • ScrollBarTypes
    • ScrollInfoMask
    • ScrollModes
    • SendMessageTimeoutFlags
    • ShowWindowCommands
    • SysCommands
    • SystemMetric
    • SystemParametersInfoActions
    • SystemParametersInfoBehaviors
    • TitleBarInfoIndexes
    • WindowLongIndex
    • WindowPlacementFlags
    • WindowPos
    • WindowStyleFlags
  • Dapplo.Windows.User32.SafeHandles
    • SafeCurrentInputDesktopHandle
    • SafeIconHandle
  • Dapplo.Windows.User32.Structs
    • AnimationInfo
    • CursorInfo
    • DisplayInfo
    • IconInfo
    • MonitorInfoEx
    • ScrollBarInfo
    • ScrollInfo
    • TitleBarInfoEx
    • WindowInfo
    • WindowPlacement

Class InteropWindowExtensions

Extensions for the interopWindow, all get or set commands update the value in the InteropWindow that is used.

Inheritance
System.Object
InteropWindowExtensions
Namespace: Dapplo.Windows.Desktop
Assembly: Dapplo.Windows.dll
Syntax
public static class InteropWindowExtensions : object

Methods

| Improve this Doc View Source

Exists(IInteropWindow)

Tests if the interopWindow still exists

Declaration
public static bool Exists(this IInteropWindow interopWindow)
Parameters
Type Name Description
IInteropWindow interopWindow

IInteropWindow

Returns
Type Description
System.Boolean

True if it's still there. Because window handles are recycled the handle could point to a different window!

| Improve this Doc View Source

Fill(IInteropWindow, InteropWindowCacheFlags)

Fill ALL the information of the InteropWindow

Declaration
public static IInteropWindow Fill(this IInteropWindow interopWindow, InteropWindowCacheFlags cacheFlags = null)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

InteropWindowCacheFlags cacheFlags

InteropWindowCacheFlags to specify which information is retrieved and what not

Returns
Type Description
IInteropWindow
| Improve this Doc View Source

GetCaption(IInteropWindow, Boolean)

Get the Windows caption (title)

Declaration
public static string GetCaption(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.String

string with the caption

| Improve this Doc View Source

GetChildren(IInteropWindow, Boolean)

Get the children of the specified interopWindow, this is not lazy!

Declaration
public static IEnumerable<IInteropWindow> GetChildren(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

True to force updating

Returns
Type Description
IEnumerable<IInteropWindow>

IEnumerable with InteropWindow

| Improve this Doc View Source

GetClassname(IInteropWindow, Boolean)

Get the Windows class name

Declaration
public static string GetClassname(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.String

string with the classname

| Improve this Doc View Source

GetInfo(IInteropWindow, Boolean)

Get the WindowInfo

Declaration
public static WindowInfo GetInfo(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
WindowInfo

WindowInfo

| Improve this Doc View Source

GetParent(IInteropWindow, Boolean)

Get the parent

Declaration
public static IntPtr GetParent(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
IntPtr

IntPtr for the parent

| Improve this Doc View Source

GetParentWindow(IInteropWindow, Boolean)

Get the parent IInteropWindow

Declaration
public static IInteropWindow GetParentWindow(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
IInteropWindow

IInteropWindow for the parent

| Improve this Doc View Source

GetPlacement(IInteropWindow, Boolean)

Get the WindowPlacement

Declaration
public static WindowPlacement GetPlacement(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
WindowPlacement

WindowPlacement

| Improve this Doc View Source

GetProcessId(IInteropWindow, Boolean)

Get the process which the specified window belongs to, the value is cached into the ProcessId of the WindowInfo

Declaration
public static int GetProcessId(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.Int32

int with process Id

| Improve this Doc View Source

GetRegion(IInteropWindow)

Get the region for a window

Declaration
public static Region GetRegion(this IInteropWindow interopWindow)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

Returns
Type Description
Region
| Improve this Doc View Source

GetText(IInteropWindow, Boolean)

Get text from the window

Declaration
public static string GetText(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.String

string with the text

| Improve this Doc View Source

GetWindowScroller(IInteropWindow, ScrollBarTypes, Boolean)

Extension method to create a WindowScroller

Declaration
public static WindowScroller GetWindowScroller(this IInteropWindow interopWindow, ScrollBarTypes scrollBarType = null, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

IInteropWindow

ScrollBarTypes scrollBarType

ScrollBarTypes

System.Boolean forceUpdate

true to force a retry, even if the previous check failed

Returns
Type Description
WindowScroller

WindowScroller or null

| Improve this Doc View Source

GetZOrderedChildren(IInteropWindow, Boolean)

Get the children of the specified interopWindow, from top to bottom. This is not lazy This might get different results than the GetChildren

Declaration
public static IEnumerable<IInteropWindow> GetZOrderedChildren(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

True to force updating

Returns
Type Description
IEnumerable<IInteropWindow>

IEnumerable with InteropWindow

| Improve this Doc View Source

IsDockedToLeftOf(IInteropWindow, IInteropWindow, Func<IInteropWindow, RECT>)

Returns if the IInteropWindow is docked to the left of the other IInteropWindow

Declaration
public static bool IsDockedToLeftOf(this IInteropWindow window1, IInteropWindow window2, Func<IInteropWindow, RECT> retrieveBoundsFunc = null)
Parameters
Type Name Description
IInteropWindow window1

IInteropWindow

IInteropWindow window2

IInteropWindow

Func<IInteropWindow, RECT> retrieveBoundsFunc

Function which returns the bounds for the IInteropWindow

Returns
Type Description
System.Boolean

bool true if docked

| Improve this Doc View Source

IsDockedToRightOf(IInteropWindow, IInteropWindow, Func<IInteropWindow, RECT>)

Returns if the IInteropWindow is docked to the left of the other IInteropWindow

Declaration
public static bool IsDockedToRightOf(this IInteropWindow window1, IInteropWindow window2, Func<IInteropWindow, RECT> retrieveBoundsFunc = null)
Parameters
Type Name Description
IInteropWindow window1

IInteropWindow

IInteropWindow window2

IInteropWindow

Func<IInteropWindow, RECT> retrieveBoundsFunc

Function which returns the bounds for the IInteropWindow

Returns
Type Description
System.Boolean

bool true if docked

| Improve this Doc View Source

IsMaximized(IInteropWindow, Boolean)

Retrieve if the window is maximized (Iconic)

Declaration
public static bool IsMaximized(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.Boolean

bool true if Iconic (minimized)

| Improve this Doc View Source

IsMinimized(IInteropWindow, Boolean)

Retrieve if the window is minimized (Iconic)

Declaration
public static bool IsMinimized(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.Boolean

bool true if Iconic (minimized)

| Improve this Doc View Source

IsVisible(IInteropWindow, Boolean)

Retrieve if the window is Visible (IsWindowVisible, whatever that means)

Declaration
public static bool IsVisible(this IInteropWindow interopWindow, bool forceUpdate = false)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

System.Boolean forceUpdate

set to true to make sure the value is updated

Returns
Type Description
System.Boolean

bool true if minimizedIconic (minimized)

| Improve this Doc View Source

Maximized(IInteropWindow)

Maximize the window

Declaration
public static void Maximized(this IInteropWindow interopWindow)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

| Improve this Doc View Source

Minimize(IInteropWindow)

Minimize the Window

Declaration
public static void Minimize(this IInteropWindow interopWindow)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

| Improve this Doc View Source

Restore(IInteropWindow)

Restore (Un-Minimize/Maximize) the Window

Declaration
public static void Restore(this IInteropWindow interopWindow)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

| Improve this Doc View Source

SetExtendedStyle(IInteropWindow, ExtendedWindowStyleFlags)

Set the Extended WindowStyle

Declaration
public static void SetExtendedStyle(this IInteropWindow interopWindow, ExtendedWindowStyleFlags extendedWindowStyleFlags)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

ExtendedWindowStyleFlags extendedWindowStyleFlags

ExtendedWindowStyleFlags

| Improve this Doc View Source

SetPlacement(IInteropWindow, WindowPlacement)

Set the WindowPlacement

Declaration
public static void SetPlacement(this IInteropWindow interopWindow, WindowPlacement placement)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

WindowPlacement placement

WindowPlacement

| Improve this Doc View Source

SetStyle(IInteropWindow, WindowStyleFlags)

Set the WindowStyle

Declaration
public static void SetStyle(this IInteropWindow interopWindow, WindowStyleFlags windowStyleFlags)
Parameters
Type Name Description
IInteropWindow interopWindow

InteropWindow

WindowStyleFlags windowStyleFlags

WindowStyleFlags

| Improve this Doc View Source

ToForegroundAsync(IInteropWindow, Boolean)

Set the window as foreground window

Declaration
public static Task ToForegroundAsync(this IInteropWindow interopWindow, bool workaround = true)
Parameters
Type Name Description
IInteropWindow interopWindow

The window to bring to the foreground

System.Boolean workaround

bool with true to use a trick to really bring the window to the foreground

Returns
Type Description
Task
  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo