2 instantiations of HWND
UIAutomationClient (2)
MS\Win32\NativeMethods.cs (2)
38HWND hTemp = new HWND(); 52HWND hTemp = new HWND();
217 references to HWND
UIAutomationClient (217)
MS\Internal\Automation\Accessible.cs (1)
94return ProxyManager.GetClassName(NativeMethods.HWND.Cast(hwnd)) == szClass;
MS\Internal\Automation\BoundingRectTracker.cs (3)
79if (!SafeNativeMethods.IsWindowVisible(NativeMethods.HWND.Cast( hwnd ))) 87NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\ClientEventManager.cs (2)
601if ( rawEl != null && !HwndProxyElementProvider.IsWindowPatternWindow( NativeMethods.HWND.Cast( hwnd ) ) ) 655if ( HwndProxyElementProvider.IsWindowPatternWindow( NativeMethods.HWND.Cast( hwnd ) ) )
MS\Internal\Automation\FocusTracker.cs (4)
133provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), idChild, UnsafeNativeMethods.OBJID_CLIENT); 162provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), idChild, idObject); 254if (hwndCur == IntPtr.Zero || !SafeNativeMethods.IsWindow(NativeMethods.HWND.Cast(hwndCur))) 294IntPtr i = Misc.SendMessageTimeout(NativeMethods.HWND.Cast(hwnd), UnsafeNativeMethods.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero);
MS\Internal\Automation\HwndProxyElementProvider.cs (104)
46internal HwndProxyElementProvider( NativeMethods.HWND hwnd ) 48Debug.Assert( hwnd != NativeMethods.HWND.NULL ); 50if( hwnd == NativeMethods.HWND.NULL ) 544NativeMethods.HWND hwndOwner = GetRealOwner( _hwnd ); 545if ( hwndOwner != NativeMethods.HWND.NULL ) 650NativeMethods.HWND hwndParent = SafeNativeMethods.GetAncestor(NativeMethods.HWND.Cast(_hwnd), SafeNativeMethods.GA_PARENT); 651if (!MapWindowPoints(NativeMethods.HWND.NULL, hwndParent, ref point, 1)) 706if (!Misc.SetWindowPos(_hwnd, NativeMethods.HWND.NULL, (int)x, (int)y, 0, 0, UnsafeNativeMethods.SWP_NOSIZE | UnsafeNativeMethods.SWP_NOZORDER | UnsafeNativeMethods.SWP_NOACTIVATE)) 965NativeMethods.HWND desktop = SafeNativeMethods.GetDesktopWindow(); 981unsafe private static bool GetMenuBarInfo(NativeMethods.HWND hwnd, int idObject, uint idItem, out UnsafeNativeMethods.MENUBARINFO mbi) 1015private static HwndProxyElementProvider Wrap(NativeMethods.HWND hwnd) 1017if( hwnd == NativeMethods.HWND.NULL ) 1027internal static bool IsWindowPatternWindow( NativeMethods.HWND hwnd ) 1072private static bool IsTransformPatternWindow( NativeMethods.HWND hwnd ) 1093internal static int[] MakeRuntimeId( NativeMethods.HWND hwnd ) 1146private static NativeMethods.HWND ScanVisible( NativeMethods.HWND hwnd, int dir, bool includeSelf, NativeMethods.HWND hwndOwnedBy ) 1148if( hwnd == NativeMethods.HWND.NULL ) 1156for( ; hwnd != NativeMethods.HWND.NULL ; hwnd = Misc.GetWindow( hwnd, dir ) ) 1163NativeMethods.HWND hwndOwner = GetRealOwner( hwnd ); 1176private NativeMethods.HWND GetFirstOrLastOwnedWindow( NativeMethods.HWND parent, bool wantFirst ) 1180return NativeMethods.HWND.NULL; 1183NativeMethods.HWND desktop = SafeNativeMethods.GetDesktopWindow(); 1184NativeMethods.HWND scan = Misc.GetWindow(desktop, SafeNativeMethods.GW_CHILD); 1207NativeMethods.HWND parent = SafeNativeMethods.GetAncestor(_hwnd, SafeNativeMethods.GA_PARENT); 1212NativeMethods.HWND hwndOwner = GetRealOwner(_hwnd); 1213if (hwndOwner != NativeMethods.HWND.NULL) 1234NativeMethods.HWND hwndOwner = GetRealOwner(_hwnd); 1235if (hwndOwner != NativeMethods.HWND.NULL) 1238NativeMethods.HWND hwnd = ScanVisible(_hwnd, ScanNext, ExcludeSelf, hwndOwner); 1239if (hwnd == NativeMethods.HWND.NULL) 1243hwnd = ScanVisible(hwnd, ScanNext, IncludeSelf, NativeMethods.HWND.NULL); 1252NativeMethods.HWND next = ScanVisible(_hwnd, ScanNext, ExcludeSelf, NativeMethods.HWND.NULL); 1267NativeMethods.HWND hwndOwner = GetRealOwner(_hwnd); 1268if (hwndOwner != NativeMethods.HWND.NULL) 1272NativeMethods.HWND hwnd = ScanVisible(_hwnd, ScanPrev, ExcludeSelf, hwndOwner); 1279NativeMethods.HWND prev = ScanVisible(_hwnd, ScanPrev, ExcludeSelf, NativeMethods.HWND.NULL); 1280if (prev == NativeMethods.HWND.NULL) 1284NativeMethods.HWND parent = SafeNativeMethods.GetAncestor(_hwnd, SafeNativeMethods.GA_PARENT); 1305NativeMethods.HWND hwnd = GetFirstOrLastOwnedWindow(_hwnd, true); 1306if (hwnd == NativeMethods.HWND.NULL) 1310hwnd = ScanVisible(hwnd, ScanNext, IncludeSelf, NativeMethods.HWND.NULL); 1331NativeMethods.HWND hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1332if (hwnd != NativeMethods.HWND.NULL) 1335hwnd = ScanVisible(hwnd, ScanPrev, IncludeSelf, NativeMethods.HWND.NULL); 1338if (hwnd == NativeMethods.HWND.NULL) 1350private static void GetAllUIFragmentRoots(NativeMethods.HWND hwnd, bool includeThis, ArrayList uiFragmentRoots) 1412for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1413hChild != NativeMethods.HWND.NULL && --SanityLoopCount > 0; 1439private static bool IsWindowReallyEnabled( NativeMethods.HWND hwnd ) 1451if( hwnd == NativeMethods.HWND.NULL ) 1457private static bool IsWindowReallyVisible( NativeMethods.HWND hwnd ) 1502private static bool IsWindowCloaked(NativeMethods.HWND hwnd) 1517private static bool IsTopLevelWindow( NativeMethods.HWND hwnd ) 1522private static NativeMethods.HWND GetRealOwner( NativeMethods.HWND hwnd ) 1524NativeMethods.HWND hwndOwner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1525if( hwndOwner == NativeMethods.HWND.NULL ) 1527return NativeMethods.HWND.NULL; 1534return NativeMethods.HWND.NULL; 1605private bool EnumWindows( NativeMethods.HWND hwnd, NativeMethods.HWND possibleOwner ) 1610NativeMethods.HWND owner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1665private static HwndProxyElementProvider ElementProviderFromPoint(NativeMethods.HWND current, double x, double y) 1674NativeMethods.HWND child = NativeMethods.HWND.NULL; 1681if (child == NativeMethods.HWND.NULL) 1731private static NativeMethods.HWND ChildWindowFromPoint( NativeMethods.HWND hwnd, double x, double y, out bool isClientArea ) 1733NativeMethods.HWND hBestFitTransparent = NativeMethods.HWND.NULL; 1740return NativeMethods.HWND.NULL; 1746for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1747hChild != NativeMethods.HWND.NULL && --SanityLoopCount > 0 ; 1767NativeMethods.HWND hwndTopLevel = SafeNativeMethods.GetAncestor(hChild, SafeNativeMethods.GA_ROOT); 1847if( hBestFitTransparent == NativeMethods.HWND.NULL ) 1880!MapWindowPoints(hChild, NativeMethods.HWND.NULL, ref rcClient, 2) || 1895return NativeMethods.HWND.NULL; 1900if( hBestFitTransparent != NativeMethods.HWND.NULL ) 1909private static bool IsProgmanWindow(NativeMethods.HWND hwnd) 1911while (hwnd != NativeMethods.HWND.NULL) 1923private static bool MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, ref NativeMethods.RECT rect, int cPoints) 1931if ((IsProgmanWindow(hWndFrom) && hWndTo == NativeMethods.HWND.NULL) || 1932(hWndFrom == NativeMethods.HWND.NULL && IsProgmanWindow(hWndTo))) 1948private static bool MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, ref NativeMethods.POINT pt, int cPoints) 1956if ((IsProgmanWindow(hWndFrom) && hWndTo == NativeMethods.HWND.NULL) || 1957(hWndFrom == NativeMethods.HWND.NULL && IsProgmanWindow(hWndTo))) 1977private static int GetWindowStyle(NativeMethods.HWND hwnd) 1988private static int GetWindowExStyle(NativeMethods.HWND hwnd) 1997private static bool SetFocus( NativeMethods.HWND hwnd ) 2010NativeMethods.HWND parent = SafeNativeMethods.GetAncestor(hwnd, SafeNativeMethods.GA_PARENT); 2032if( Misc.RegisterHotKey( NativeMethods.HWND.NULL, atom, 0, vk ) ) 2075if (Misc.GetMessage(ref msg, NativeMethods.HWND.NULL, 0, 0) == 0) 2097Misc.UnregisterHotKey(NativeMethods.HWND.NULL, atom); 2107private static NativeMethods.HWND GetFocusedWindow() 2113return NativeMethods.HWND.NULL; 2162private NativeMethods.HWND _hwnd;
MS\Internal\Automation\MenuTracker.cs (2)
61NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\Misc.cs (20)
318internal static bool GetClientRect(NativeMethods.HWND hwnd, out NativeMethods.RECT rc) 353internal static bool GetMenuBarInfo(NativeMethods.HWND hwnd, int idObject, uint item, ref UnsafeNativeMethods.MENUBARINFO mbi) 379internal static int GetMessage(ref UnsafeNativeMethods.MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax) 392internal static NativeMethods.HWND GetWindow(NativeMethods.HWND hwnd, int uCmd) 394NativeMethods.HWND result = NativeMethodsSetLastError.GetWindow(hwnd, uCmd); 397if (result == NativeMethods.HWND.NULL) 405internal static int GetWindowLong(NativeMethods.HWND hWnd, int nIndex) 434internal static bool GetWindowPlacement(NativeMethods.HWND hwnd, ref UnsafeNativeMethods.WINDOWPLACEMENT wp) 447internal static bool GetWindowRect(NativeMethods.HWND hwnd, out NativeMethods.RECT rc) 520internal static IntPtr OpenProcess(int dwDesiredAccess, bool fInherit, int dwProcessId, NativeMethods.HWND hwnd) 550internal static bool PostMessage(NativeMethods.HWND hWnd, int nMsg, IntPtr wParam, IntPtr lParam) 563internal static bool RegisterHotKey(NativeMethods.HWND hWnd, int id, int fsModifiers, int vk) 589internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, IntPtr lParam) 606internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, ref UnsafeNativeMethods.MINMAXINFO lParam) 623internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, StringBuilder lParam) 641internal static bool SetWindowPlacement(NativeMethods.HWND hwnd, ref UnsafeNativeMethods.WINDOWPLACEMENT wp) 654internal static bool SetWindowPos(NativeMethods.HWND hWnd, NativeMethods.HWND hWndInsertAfter, int x, int y, int cx, int cy, int flags) 667internal static bool UnregisterHotKey(NativeMethods.HWND hWnd, int id)
MS\Internal\Automation\ProxyManager.cs (12)
227internal static string GetClassName( NativeMethods.HWND hwnd ) 241internal static string RealGetWindowClass( NativeMethods.HWND hwnd ) 267internal static bool IsKnownBadWindow( NativeMethods.HWND hwnd ) 287NativeMethods.HWND hwndParent = SafeNativeMethods.GetAncestor(hwnd, SafeNativeMethods.GA_PARENT); 288if (hwndParent != NativeMethods.HWND.NULL) 303internal static string GetImageName( NativeMethods.HWND hwnd ) 466internal static IRawElementProviderSimple ProxyProviderFromHwnd(NativeMethods.HWND hwnd, int idChild, int idObject) 489if (hwnd == NativeMethods.HWND.NULL) 553static private IRawElementProviderSimple FindProxyFromImageFallback(ref string imageName, NativeMethods.HWND hwnd, int idChild, int idObject) 588static private IRawElementProviderSimple FindProxyInEntryOrArrayList(ProxyScoping findType, object entryOrArrayList, ref string imageName, NativeMethods.HWND hwnd, int idChild, int idObject, string classNameForPartialMatch) 633static private IRawElementProviderSimple GetProxyFromEntry(ProxyScoping findType, object entry, ref string imageName, NativeMethods.HWND hwnd, int idChild, int idObject, string classNameForPartialMatch) 789private static string GetBaseClassName( NativeMethods.HWND hwnd )
MS\Internal\Automation\QueueProcessor.cs (1)
125while (UnsafeNativeMethods.PeekMessage(ref msg, NativeMethods.HWND.NULL, 0, 0, UnsafeNativeMethods.PM_REMOVE))
MS\Internal\Automation\SafeProcessHandle.cs (1)
25internal SafeProcessHandle(NativeMethods.HWND hwnd) : base(true)
MS\Internal\Automation\UiaCoreApi.cs (2)
1578provider = new HwndProxyElementProvider(NativeMethods.HWND.Cast(hwnd)); 1582provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), 0, UnsafeNativeMethods.OBJID_CLIENT);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (2)
60NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\WindowInteractionStateTracker.cs (2)
77NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast(hwnd);
MS\Internal\Automation\WindowShowOrOpenTracker.cs (2)
61NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast( hwnd );
MS\Internal\Automation\WindowVisualStateTracker.cs (2)
74NativeMethods.HWND nativeHwnd = NativeMethods.HWND.Cast(hwnd);
MS\Win32\NativeMethods.cs (11)
36public static HWND Cast(IntPtr h) 38HWND hTemp = new HWND(); 43public static implicit operator IntPtr(HWND h) 48public static HWND NULL 52HWND hTemp = new HWND(); 58public static bool operator==(HWND hl, HWND hr) 63public static bool operator!=(HWND hl, HWND hr) 70HWND hr = Cast((HWND)oCompare);
MS\Win32\SafeNativeMethods.cs (24)
26public static extern int GetWindowThreadProcessId( NativeMethods.HWND hWnd, out int lpdwProcessId); 64public NativeMethods.HWND hwndActive; 65public NativeMethods.HWND hwndFocus; 66public NativeMethods.HWND hwndCapture; 67public NativeMethods.HWND hwndMenuOwner; 68public NativeMethods.HWND hwndMoveSize; 69public NativeMethods.HWND hwndCaret; 117public static extern NativeMethods.HWND GetAncestor( NativeMethods.HWND hwnd, int gaFlags ); 127public static extern NativeMethods.HWND GetDesktopWindow(); 133public delegate bool EnumThreadWndProc( NativeMethods.HWND hwnd, NativeMethods.HWND lParam); 141public static extern bool GetClientRect( NativeMethods.HWND hwnd, out NativeMethods.RECT rc ); 144public static extern bool GetWindowRect( NativeMethods.HWND hwnd, out NativeMethods.RECT rc ); 147public static extern bool IsWindow( NativeMethods.HWND hwnd ); 150public static extern bool IsWindowEnabled( NativeMethods.HWND hwnd ); 153public static extern bool IsWindowVisible( NativeMethods.HWND hwnd ); 156public static extern bool IsIconic(NativeMethods.HWND hwnd); 159public static extern int GetClassName( NativeMethods.HWND hWnd, StringBuilder classname, int nMax ); 162public static extern int RealGetWindowClass( NativeMethods.HWND hWnd, StringBuilder classname, int nMax ); 165internal extern static bool IsChild( NativeMethods.HWND parent, NativeMethods.HWND child ); 171NativeMethods.HWND hwnd, 217public static extern bool PhysicalToLogicalPoint(NativeMethods.HWND hwnd, ref NativeMethods.POINT pt);
MS\Win32\UnsafeNativeMethods.cs (15)
112public static extern bool RegisterHotKey( NativeMethods.HWND hWnd, int id, int fsModifiers, int vk ); 115public static extern bool UnregisterHotKey( NativeMethods.HWND hWnd, int id ); 123public static extern void SwitchToThisWindow(NativeMethods.HWND hwnd, bool fAltTab); 194NativeMethods.HWND hwnd, int Msg, IntPtr wParam, IntPtr lParam, int flags, int uTimeout, out IntPtr pResult ); 198NativeMethods.HWND hwnd, int Msg, IntPtr wParam, ref MINMAXINFO lParam, int flags, int uTimeout, out IntPtr pResult ); 204NativeMethods.HWND hwnd, int Msg, IntPtr wParam, StringBuilder lParam, int flags, int uTimeout, out IntPtr pResult); 212public NativeMethods.HWND hwnd; 224ref MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax); 228ref MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax, int wRemoveMsg); 240NativeMethods.HWND hWnd, int nMsg, IntPtr wParam, IntPtr lParam); 331public static extern bool SetWindowPlacement( NativeMethods.HWND hwnd, ref WINDOWPLACEMENT wp ); 334public static extern bool GetWindowPlacement( NativeMethods.HWND hwnd, ref WINDOWPLACEMENT wp ); 341internal static extern bool SetWindowPos(NativeMethods.HWND hWnd, NativeMethods.HWND hWndInsertAfter, int x, int y, int cx, int cy, int flags); 358internal NativeMethods.HWND hwndMenu;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (6)
60public static extern NativeMethods.HWND GetWindow(NativeMethods.HWND hWnd, int uCmd); 63public static extern int MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, [In, Out] ref NativeMethods.RECT rect, int cPoints); 66public static extern int MapWindowPoints(NativeMethods.HWND hWndFrom, NativeMethods.HWND hWndTo, ref NativeMethods.POINT pt, int cPoints);
System\Windows\Automation\Automation.cs (1)
177if ( HwndProxyElementProvider.IsWindowPatternWindow( NativeMethods.HWND.Cast( new IntPtr( (int)val ) ) ) )