2 instantiations of HWND
UIAutomationClient (2)
MS\Win32\NativeMethods.cs (2)
37HWND hTemp = new HWND 53HWND hTemp = new HWND
217 references to HWND
UIAutomationClient (217)
MS\Internal\Automation\Accessible.cs (1)
82return ProxyManager.GetClassName(NativeMethods.HWND.Cast(hwnd)) == szClass;
MS\Internal\Automation\BoundingRectTracker.cs (3)
76if (!SafeNativeMethods.IsWindowVisible(NativeMethods.HWND.Cast( hwnd ))) 84NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\ClientEventManager.cs (2)
592if ( rawEl != null && !HwndProxyElementProvider.IsWindowPatternWindow( NativeMethods.HWND.Cast( hwnd ) ) ) 646if ( HwndProxyElementProvider.IsWindowPatternWindow( NativeMethods.HWND.Cast( hwnd ) ) )
MS\Internal\Automation\FocusTracker.cs (4)
132provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), idChild, UnsafeNativeMethods.OBJID_CLIENT); 161provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), idChild, idObject); 253if (hwndCur == IntPtr.Zero || !SafeNativeMethods.IsWindow(NativeMethods.HWND.Cast(hwndCur))) 293IntPtr i = Misc.SendMessageTimeout(NativeMethods.HWND.Cast(hwnd), UnsafeNativeMethods.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero);
MS\Internal\Automation\HwndProxyElementProvider.cs (104)
37internal HwndProxyElementProvider( NativeMethods.HWND hwnd ) 39Debug.Assert( hwnd != NativeMethods.HWND.NULL ); 41if( hwnd == NativeMethods.HWND.NULL ) 530NativeMethods.HWND hwndOwner = GetRealOwner( _hwnd ); 531if ( hwndOwner != NativeMethods.HWND.NULL ) 633NativeMethods.HWND hwndParent = SafeNativeMethods.GetAncestor(NativeMethods.HWND.Cast(_hwnd), SafeNativeMethods.GA_PARENT); 634if (!MapWindowPoints(NativeMethods.HWND.NULL, hwndParent, ref point, 1)) 689if (!Misc.SetWindowPos(_hwnd, NativeMethods.HWND.NULL, (int)x, (int)y, 0, 0, UnsafeNativeMethods.SWP_NOSIZE | UnsafeNativeMethods.SWP_NOZORDER | UnsafeNativeMethods.SWP_NOACTIVATE)) 950NativeMethods.HWND desktop = SafeNativeMethods.GetDesktopWindow(); 966private static unsafe bool GetMenuBarInfo(NativeMethods.HWND hwnd, int idObject, uint idItem, out UnsafeNativeMethods.MENUBARINFO mbi) 1002private static HwndProxyElementProvider Wrap(NativeMethods.HWND hwnd) 1004if( hwnd == NativeMethods.HWND.NULL ) 1014internal static bool IsWindowPatternWindow( NativeMethods.HWND hwnd ) 1059private static bool IsTransformPatternWindow( NativeMethods.HWND hwnd ) 1080internal static int[] MakeRuntimeId( NativeMethods.HWND hwnd ) 1133private static NativeMethods.HWND ScanVisible( NativeMethods.HWND hwnd, int dir, bool includeSelf, NativeMethods.HWND hwndOwnedBy ) 1135if( hwnd == NativeMethods.HWND.NULL ) 1143for( ; hwnd != NativeMethods.HWND.NULL ; hwnd = Misc.GetWindow( hwnd, dir ) ) 1150NativeMethods.HWND hwndOwner = GetRealOwner( hwnd ); 1163private NativeMethods.HWND GetFirstOrLastOwnedWindow( NativeMethods.HWND parent, bool wantFirst ) 1167return NativeMethods.HWND.NULL; 1170NativeMethods.HWND desktop = SafeNativeMethods.GetDesktopWindow(); 1171NativeMethods.HWND scan = Misc.GetWindow(desktop, SafeNativeMethods.GW_CHILD); 1194NativeMethods.HWND parent = SafeNativeMethods.GetAncestor(_hwnd, SafeNativeMethods.GA_PARENT); 1199NativeMethods.HWND hwndOwner = GetRealOwner(_hwnd); 1200if (hwndOwner != NativeMethods.HWND.NULL) 1221NativeMethods.HWND hwndOwner = GetRealOwner(_hwnd); 1222if (hwndOwner != NativeMethods.HWND.NULL) 1225NativeMethods.HWND hwnd = ScanVisible(_hwnd, ScanNext, ExcludeSelf, hwndOwner); 1226if (hwnd == NativeMethods.HWND.NULL) 1230hwnd = ScanVisible(hwnd, ScanNext, IncludeSelf, NativeMethods.HWND.NULL); 1239NativeMethods.HWND next = ScanVisible(_hwnd, ScanNext, ExcludeSelf, NativeMethods.HWND.NULL); 1254NativeMethods.HWND hwndOwner = GetRealOwner(_hwnd); 1255if (hwndOwner != NativeMethods.HWND.NULL) 1259NativeMethods.HWND hwnd = ScanVisible(_hwnd, ScanPrev, ExcludeSelf, hwndOwner); 1266NativeMethods.HWND prev = ScanVisible(_hwnd, ScanPrev, ExcludeSelf, NativeMethods.HWND.NULL); 1267if (prev == NativeMethods.HWND.NULL) 1271NativeMethods.HWND parent = SafeNativeMethods.GetAncestor(_hwnd, SafeNativeMethods.GA_PARENT); 1292NativeMethods.HWND hwnd = GetFirstOrLastOwnedWindow(_hwnd, true); 1293if (hwnd == NativeMethods.HWND.NULL) 1297hwnd = ScanVisible(hwnd, ScanNext, IncludeSelf, NativeMethods.HWND.NULL); 1318NativeMethods.HWND hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1319if (hwnd != NativeMethods.HWND.NULL) 1322hwnd = ScanVisible(hwnd, ScanPrev, IncludeSelf, NativeMethods.HWND.NULL); 1325if (hwnd == NativeMethods.HWND.NULL) 1337private static void GetAllUIFragmentRoots(NativeMethods.HWND hwnd, bool includeThis, ArrayList uiFragmentRoots) 1399for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1400hChild != NativeMethods.HWND.NULL && --SanityLoopCount > 0; 1423private static bool IsWindowReallyEnabled( NativeMethods.HWND hwnd ) 1435if( hwnd == NativeMethods.HWND.NULL ) 1441private static bool IsWindowReallyVisible( NativeMethods.HWND hwnd ) 1486private static bool IsWindowCloaked(NativeMethods.HWND hwnd) 1501private static bool IsTopLevelWindow( NativeMethods.HWND hwnd ) 1506private static NativeMethods.HWND GetRealOwner( NativeMethods.HWND hwnd ) 1508NativeMethods.HWND hwndOwner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1509if( hwndOwner == NativeMethods.HWND.NULL ) 1511return NativeMethods.HWND.NULL; 1518return NativeMethods.HWND.NULL; 1587private bool EnumWindows( NativeMethods.HWND hwnd, NativeMethods.HWND possibleOwner ) 1592NativeMethods.HWND owner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1647private static HwndProxyElementProvider ElementProviderFromPoint(NativeMethods.HWND current, double x, double y) 1656NativeMethods.HWND child = NativeMethods.HWND.NULL; 1663if (child == NativeMethods.HWND.NULL) 1713private static NativeMethods.HWND ChildWindowFromPoint( NativeMethods.HWND hwnd, double x, double y, out bool isClientArea ) 1715NativeMethods.HWND hBestFitTransparent = NativeMethods.HWND.NULL; 1722return NativeMethods.HWND.NULL; 1728for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1729hChild != NativeMethods.HWND.NULL && --SanityLoopCount > 0 ; 1749NativeMethods.HWND hwndTopLevel = SafeNativeMethods.GetAncestor(hChild, SafeNativeMethods.GA_ROOT); 1829if( hBestFitTransparent == NativeMethods.HWND.NULL ) 1862!MapWindowPoints(hChild, NativeMethods.HWND.NULL, ref rcClient, 2) || 1877return NativeMethods.HWND.NULL; 1882if( hBestFitTransparent != NativeMethods.HWND.NULL ) 1891private static bool IsProgmanWindow(NativeMethods.HWND hwnd) 1893while (hwnd != NativeMethods.HWND.NULL) 1905private static bool MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, ref NativeMethods.RECT rect, int cPoints) 1913if ((IsProgmanWindow(hWndFrom) && hWndTo == NativeMethods.HWND.NULL) || 1914(hWndFrom == NativeMethods.HWND.NULL && IsProgmanWindow(hWndTo))) 1930private static bool MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, ref NativeMethods.POINT pt, int cPoints) 1938if ((IsProgmanWindow(hWndFrom) && hWndTo == NativeMethods.HWND.NULL) || 1939(hWndFrom == NativeMethods.HWND.NULL && IsProgmanWindow(hWndTo))) 1959private static int GetWindowStyle(NativeMethods.HWND hwnd) 1970private static int GetWindowExStyle(NativeMethods.HWND hwnd) 1979private static bool SetFocus( NativeMethods.HWND hwnd ) 1992NativeMethods.HWND parent = SafeNativeMethods.GetAncestor(hwnd, SafeNativeMethods.GA_PARENT); 2014if( Misc.RegisterHotKey( NativeMethods.HWND.NULL, atom, 0, vk ) ) 2057if (Misc.GetMessage(ref msg, NativeMethods.HWND.NULL, 0, 0) == 0) 2076Misc.UnregisterHotKey(NativeMethods.HWND.NULL, atom); 2086private static NativeMethods.HWND GetFocusedWindow() 2092return NativeMethods.HWND.NULL; 2141private NativeMethods.HWND _hwnd;
MS\Internal\Automation\MenuTracker.cs (2)
59NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\Misc.cs (20)
308internal static bool GetClientRect(NativeMethods.HWND hwnd, out NativeMethods.RECT rc) 343internal static bool GetMenuBarInfo(NativeMethods.HWND hwnd, int idObject, uint item, ref UnsafeNativeMethods.MENUBARINFO mbi) 369internal static int GetMessage(ref UnsafeNativeMethods.MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax) 382internal static NativeMethods.HWND GetWindow(NativeMethods.HWND hwnd, int uCmd) 384NativeMethods.HWND result = NativeMethodsSetLastError.GetWindow(hwnd, uCmd); 387if (result == NativeMethods.HWND.NULL) 395internal static int GetWindowLong(NativeMethods.HWND hWnd, int nIndex) 424internal static bool GetWindowPlacement(NativeMethods.HWND hwnd, ref UnsafeNativeMethods.WINDOWPLACEMENT wp) 437internal static bool GetWindowRect(NativeMethods.HWND hwnd, out NativeMethods.RECT rc) 510internal static IntPtr OpenProcess(int dwDesiredAccess, bool fInherit, int dwProcessId, NativeMethods.HWND hwnd) 540internal static bool PostMessage(NativeMethods.HWND hWnd, int nMsg, IntPtr wParam, IntPtr lParam) 553internal static bool RegisterHotKey(NativeMethods.HWND hWnd, int id, int fsModifiers, int vk) 579internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, IntPtr lParam) 596internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, ref UnsafeNativeMethods.MINMAXINFO lParam) 613internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, StringBuilder lParam) 631internal static bool SetWindowPlacement(NativeMethods.HWND hwnd, ref UnsafeNativeMethods.WINDOWPLACEMENT wp) 644internal static bool SetWindowPos(NativeMethods.HWND hWnd, NativeMethods.HWND hWndInsertAfter, int x, int y, int cx, int cy, int flags) 657internal static bool UnregisterHotKey(NativeMethods.HWND hWnd, int id)
MS\Internal\Automation\ProxyManager.cs (12)
219internal static string GetClassName( NativeMethods.HWND hwnd ) 233internal static string RealGetWindowClass( NativeMethods.HWND hwnd ) 259internal static bool IsKnownBadWindow( NativeMethods.HWND hwnd ) 279NativeMethods.HWND hwndParent = SafeNativeMethods.GetAncestor(hwnd, SafeNativeMethods.GA_PARENT); 280if (hwndParent != NativeMethods.HWND.NULL) 295internal static string GetImageName( NativeMethods.HWND hwnd ) 460internal static IRawElementProviderSimple ProxyProviderFromHwnd(NativeMethods.HWND hwnd, int idChild, int idObject) 483if (hwnd == NativeMethods.HWND.NULL) 547private static IRawElementProviderSimple FindProxyFromImageFallback(ref string imageName, NativeMethods.HWND hwnd, int idChild, int idObject) 580private static IRawElementProviderSimple FindProxyInEntryOrArrayList(ProxyScoping findType, object entryOrArrayList, ref string imageName, NativeMethods.HWND hwnd, int idChild, int idObject, string classNameForPartialMatch) 625private static IRawElementProviderSimple GetProxyFromEntry(ProxyScoping findType, object entry, ref string imageName, NativeMethods.HWND hwnd, int idChild, int idObject, string classNameForPartialMatch) 781private static string GetBaseClassName( NativeMethods.HWND hwnd )
MS\Internal\Automation\QueueProcessor.cs (1)
119while (UnsafeNativeMethods.PeekMessage(ref msg, NativeMethods.HWND.NULL, 0, 0, UnsafeNativeMethods.PM_REMOVE))
MS\Internal\Automation\SafeProcessHandle.cs (1)
17internal SafeProcessHandle(NativeMethods.HWND hwnd) : base(true)
MS\Internal\Automation\UiaCoreApi.cs (2)
1573provider = new HwndProxyElementProvider(NativeMethods.HWND.Cast(hwnd)); 1577provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), 0, UnsafeNativeMethods.OBJID_CLIENT);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (2)
58NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\WindowInteractionStateTracker.cs (2)
73NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast(hwnd);
MS\Internal\Automation\WindowShowOrOpenTracker.cs (2)
58NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\WindowVisualStateTracker.cs (2)
73NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast(hwnd);
MS\Win32\NativeMethods.cs (11)
35public static HWND Cast(IntPtr h) 37HWND hTemp = new HWND 44public static implicit operator IntPtr(HWND h) 49public static HWND NULL 53HWND hTemp = new HWND 61public static bool operator==(HWND hl, HWND hr) 66public static bool operator!=(HWND hl, HWND hr) 73HWND hr = Cast((HWND)oCompare);
MS\Win32\SafeNativeMethods.cs (24)
22public static extern int GetWindowThreadProcessId( NativeMethods.HWND hWnd, out int lpdwProcessId); 60public NativeMethods.HWND hwndActive; 61public NativeMethods.HWND hwndFocus; 62public NativeMethods.HWND hwndCapture; 63public NativeMethods.HWND hwndMenuOwner; 64public NativeMethods.HWND hwndMoveSize; 65public NativeMethods.HWND hwndCaret; 113public static extern NativeMethods.HWND GetAncestor( NativeMethods.HWND hwnd, int gaFlags ); 123public static extern NativeMethods.HWND GetDesktopWindow(); 129public delegate bool EnumThreadWndProc( NativeMethods.HWND hwnd, NativeMethods.HWND lParam); 137public static extern bool GetClientRect( NativeMethods.HWND hwnd, out NativeMethods.RECT rc ); 140public static extern bool GetWindowRect( NativeMethods.HWND hwnd, out NativeMethods.RECT rc ); 143public static extern bool IsWindow( NativeMethods.HWND hwnd ); 146public static extern bool IsWindowEnabled( NativeMethods.HWND hwnd ); 149public static extern bool IsWindowVisible( NativeMethods.HWND hwnd ); 152public static extern bool IsIconic(NativeMethods.HWND hwnd); 155public static extern int GetClassName( NativeMethods.HWND hWnd, StringBuilder classname, int nMax ); 158public static extern int RealGetWindowClass( NativeMethods.HWND hWnd, StringBuilder classname, int nMax ); 161internal static extern bool IsChild( NativeMethods.HWND parent, NativeMethods.HWND child ); 167NativeMethods.HWND hwnd, 213public static extern bool PhysicalToLogicalPoint(NativeMethods.HWND hwnd, ref NativeMethods.POINT pt);
MS\Win32\UnsafeNativeMethods.cs (15)
107public static extern bool RegisterHotKey( NativeMethods.HWND hWnd, int id, int fsModifiers, int vk ); 110public static extern bool UnregisterHotKey( NativeMethods.HWND hWnd, int id ); 118public static extern void SwitchToThisWindow(NativeMethods.HWND hwnd, bool fAltTab); 189NativeMethods.HWND hwnd, int Msg, IntPtr wParam, IntPtr lParam, int flags, int uTimeout, out IntPtr pResult ); 193NativeMethods.HWND hwnd, int Msg, IntPtr wParam, ref MINMAXINFO lParam, int flags, int uTimeout, out IntPtr pResult ); 199NativeMethods.HWND hwnd, int Msg, IntPtr wParam, StringBuilder lParam, int flags, int uTimeout, out IntPtr pResult); 207public NativeMethods.HWND hwnd; 219ref MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax); 223ref MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax, int wRemoveMsg); 235NativeMethods.HWND hWnd, int nMsg, IntPtr wParam, IntPtr lParam); 326public static extern bool SetWindowPlacement( NativeMethods.HWND hwnd, ref WINDOWPLACEMENT wp ); 329public static extern bool GetWindowPlacement( NativeMethods.HWND hwnd, ref WINDOWPLACEMENT wp ); 336internal static extern bool SetWindowPos(NativeMethods.HWND hWnd, NativeMethods.HWND hWndInsertAfter, int x, int y, int cx, int cy, int flags); 353internal NativeMethods.HWND hwndMenu;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (6)
55public static extern NativeMethods.HWND GetWindow(NativeMethods.HWND hWnd, int uCmd); 58public static extern int MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, [In, Out] ref NativeMethods.RECT rect, int cPoints); 61public static extern int MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, ref NativeMethods.POINT pt, int cPoints);
System\Windows\Automation\Automation.cs (1)
161if ( HwndProxyElementProvider.IsWindowPatternWindow( NativeMethods.HWND.Cast( new IntPtr( (int)val ) ) ) )