146 references to Misc
UIAutomationClient (146)
MS\Internal\Automation\Accessible.cs (1)
106&& Misc.IsCriticalException(e);
MS\Internal\Automation\BoundingRectTracker.cs (1)
88if (!Misc.GetWindowRect(nativeHwnd, out rc32))
MS\Internal\Automation\EventListenerClientSide.cs (9)
97if( !Misc.Compare( _refRid, rid ) ) 114Misc.Compare(_refRid, AutomationElement.RootElement.GetRuntimeId())) 128if ((_eventListener.TreeScope & TreeScope.Element) != 0 && Misc.Compare(el, elThis)) 139if (elParent != null && Misc.Compare(elParent, elThis)) 147if (elParent != null && Misc.Compare(elParent, el)) 171Misc.Compare(_refRid, AutomationElement.RootElement.GetRuntimeId())) 185if ( Misc.Compare( rid, _refRid ) ) 263if( ! Misc.Compare( el, elPossibleParent ) ) 268if( Misc.Compare( elPossibleChild, elPossibleParent ) )
MS\Internal\Automation\FocusTracker.cs (4)
191if( Misc.IsCriticalException( e ) ) 260if( Misc.IsCriticalException( e ) ) 293IntPtr i = Misc.SendMessageTimeout(NativeMethods.HWND.Cast(hwnd), UnsafeNativeMethods.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero); 315if (!Misc.GetGUIThreadInfo(0, ref guiThreadInfo))
MS\Internal\Automation\HwndProxyElementProvider.cs (62)
97int id = Misc.GetWindowLong(_hwnd, SafeNativeMethods.GWL_ID); 116IntPtr len = Misc.SendMessageTimeout( _hwnd, UnsafeNativeMethods.WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero ); 126if (Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETTEXT, new IntPtr(ilen + 1), str) == IntPtr.Zero) 132return Misc.StripMnemonic(str.ToString()); 160if (!Misc.GetGUIThreadInfo(0, ref gti)) 169return Misc.IsWindowsFormsControl(ProxyManager.GetClassName(_hwnd)) ? "WinForm" : "Win32"; 236if (!Misc.GetWindowRect(_hwnd, out rcW32)) 314if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 323if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 344if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_MINIMIZE, IntPtr.Zero)) 365if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_MAXIMIZE, IntPtr.Zero)) 387if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_CLOSE, IntPtr.Zero)) 643if (!Misc.GetWindowRect(_hwnd, out currentRect)) 667if (!Misc.GetClientRect(hwndParent, out parentRect)) 689if (!Misc.SetWindowPos(_hwnd, NativeMethods.HWND.NULL, (int)x, (int)y, 0, 0, UnsafeNativeMethods.SWP_NOSIZE | UnsafeNativeMethods.SWP_NOZORDER | UnsafeNativeMethods.SWP_NOACTIVATE)) 701if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 721if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 730if (!Misc.GetWindowRect(_hwnd, out currentRect)) 738if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 747if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 760if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 794Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETMINMAXINFO, IntPtr.Zero, ref minMaxInfo); 814if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 826if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 972bool result = Misc.GetMenuBarInfo(hwnd, idObject, idItem, ref mbi); 1140hwnd = Misc.GetWindow( hwnd, dir ); 1143for( ; hwnd != NativeMethods.HWND.NULL ; hwnd = Misc.GetWindow( hwnd, dir ) ) 1171NativeMethods.HWND scan = Misc.GetWindow(desktop, SafeNativeMethods.GW_CHILD); 1175scan = Misc.GetWindow(scan, SafeNativeMethods.GW_HWNDLAST); 1229hwnd = Misc.GetWindow(hwndOwner, SafeNativeMethods.GW_CHILD); 1296hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1318NativeMethods.HWND hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1321hwnd = Misc.GetWindow(hwnd, SafeNativeMethods.GW_HWNDLAST); 1399for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1401hChild = Misc.GetWindow(hChild, SafeNativeMethods.GW_HWNDNEXT)) 1465if (!Misc.GetWindowRect(hwnd, out rcW32)) 1508NativeMethods.HWND hwndOwner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1592NativeMethods.HWND owner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1630if (!Misc.GetGUIThreadInfo(0, ref gui)) 1719IntPtr hrgn = Misc.CreateRectRgn(0, 0, 0, 0); // NOTE: Must be deleted before returning 1728for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1730hChild = Misc.GetWindow(hChild, SafeNativeMethods.GW_HWNDNEXT)) 1738if (!Misc.GetWindowRect(hChild, out rc)) 1816IntPtr lr = Misc.SendMessageTimeout( hChild, UnsafeNativeMethods.WM_NCHITTEST, IntPtr.Zero, MAKELPARAM( (int)x, (int)y ) ); 1832if (!Misc.GetWindowRect(hChild, out rcBest)) 1842if (!Misc.GetWindowRect(hChild, out rcChild)) 1861if (!Misc.GetClientRect(hChild, out rcClient) || 1868Misc.DeleteObject(hrgn); // finished with region 1872Misc.DeleteObject(hrgn); // finished with region 1919Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 1944Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 1961int style = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_STYLE); 1972int exstyle = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_EXSTYLE); 1997IntPtr lresult = Misc.SendMessageTimeout(parent, UnsafeNativeMethods.WM_MDIACTIVATE, (IntPtr)hwnd, IntPtr.Zero); 2004short atom = Misc.GlobalAddAtom("FocusHotKey"); 2014if( Misc.RegisterHotKey( NativeMethods.HWND.NULL, atom, 0, vk ) ) 2052int result = Misc.MsgWaitForMultipleObjects(null, false, 2000, UnsafeNativeMethods.QS_ALLINPUT); 2057if (Misc.GetMessage(ref msg, NativeMethods.HWND.NULL, 0, 0) == 0) 2076Misc.UnregisterHotKey(NativeMethods.HWND.NULL, atom); 2078Misc.GlobalDeleteAtom(atom); 2090if (!Misc.GetGUIThreadInfo(0, ref gti)) 2105if (Misc.GetGUIThreadInfo(0, ref gti))
MS\Internal\Automation\input.cs (2)
64Misc.SendInput(1, ref ki, Marshal.SizeOf(ki)); 83Misc.SendInput(1, ref ki, Marshal.SizeOf(ki));
MS\Internal\Automation\InvokeHandlers.cs (1)
98if (Misc.IsCriticalException(e))
MS\Internal\Automation\ProxyManager.cs (6)
228Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 242Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 297int instance = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_HINSTANCE); 311if (Misc.GetModuleFileNameEx(processHandle, (IntPtr)instance, sb, NativeMethods.MAX_PATH) == 0) 700if( Misc.IsCriticalException( e ) ) 791IntPtr result = Misc.SendMessageTimeout(hwnd, UnsafeNativeMethods.WM_GETOBJECT, IntPtr.Zero, (IntPtr)OBJID_QUERYCLASSNAMEIDX);
MS\Internal\Automation\QueueProcessor.cs (2)
136int result = Misc.TryMsgWaitForMultipleObjects(handle, false, UnsafeNativeMethods.INFINITE, UnsafeNativeMethods.QS_ALLINPUT, ref lastWin32Error); 165if (Misc.IsCriticalException(e))
MS\Internal\Automation\SafeProcessHandle.cs (2)
28SetHandle(Misc.OpenProcess(UnsafeNativeMethods.PROCESS_QUERY_INFORMATION | UnsafeNativeMethods.PROCESS_VM_READ, false, processId, hwnd)); 33return Misc.CloseHandle(handle);
MS\Internal\Automation\WinEventWrap.cs (2)
189if( Misc.IsCriticalException( e ) ) 204if( Misc.IsCriticalException( ex ) )
System\Windows\Automation\AndCondition.cs (1)
32Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) );
System\Windows\Automation\Automation.cs (9)
65return Misc.Compare(el1, el2); 78return Misc.Compare(runtimeId1, runtimeId2); 127Misc.ValidateArgument( eventId != AutomationElement.AutomationFocusChangedEvent, nameof(SR.EventIdMustNotBeAutomationFocusChanged) ); 128Misc.ValidateArgument( eventId != AutomationElement.StructureChangedEvent, nameof(SR.EventIdMustNotBeStructureChanged) ); 129Misc.ValidateArgument( eventId != AutomationElement.AutomationPropertyChangedEvent, nameof(SR.EventIdMustNotBeAutomationPropertyChanged) ); 140if ( Misc.Compare( element, AutomationElement.RootElement ) ) 195Misc.ValidateArgument( eventId != AutomationElement.AutomationFocusChangedEvent, nameof(SR.EventIdMustNotBeAutomationFocusChanged) ); 196Misc.ValidateArgument( eventId != AutomationElement.StructureChangedEvent, nameof(SR.EventIdMustNotBeStructureChanged) ); 197Misc.ValidateArgument( eventId != AutomationElement.AutomationPropertyChangedEvent, nameof(SR.EventIdMustNotBeAutomationPropertyChanged) );
System\Windows\Automation\AutomationElement.cs (7)
310return Misc.Compare(this, el); 424Misc.ValidateArgument(hwnd != IntPtr.Zero, nameof(SR.HwndMustBeNonNULL)); 586if (Misc.IsCriticalException(e)) 597patternObject = Misc.WrapInterfaceOnClientSide(this, hpatternobj, pattern); 817return (AutomationProperty[])Misc.RemoveDuplicates(Misc.CombineArrays(propArrays, typeof(AutomationProperty)), typeof(AutomationProperty)); 1259val = Misc.WrapInterfaceOnClientSide(this, hpatternobj, automationPattern);
System\Windows\Automation\DockPattern.cs (2)
99Misc.ValidateCached(_cached); 124Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ExpandCollapsePattern.cs (2)
105Misc.ValidateCached(_cached); 130Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\GridItemPattern.cs (2)
106Misc.ValidateCached(_cached); 131Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\GridPattern.cs (2)
103Misc.ValidateCached(_cached); 128Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\MultipleViewPattern.cs (2)
112Misc.ValidateCached(_cached); 137Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\OrCondition.cs (1)
32Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) );
System\Windows\Automation\PropertyCondition.cs (1)
143Misc.ValidateArgument(val is string, nameof(SR.IgnoreCaseRequiresString));
System\Windows\Automation\RangeValuePattern.cs (2)
132Misc.ValidateCached(_cached); 157Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ScrollPattern.cs (2)
152Misc.ValidateCached(_cached); 177Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\SelectionItemPattern.cs (2)
134Misc.ValidateCached(_cached); 159Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\SelectionPattern.cs (2)
105Misc.ValidateCached(_cached); 130Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TableItemPattern.cs (2)
96Misc.ValidateCached(_cached); 121Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TablePattern.cs (2)
86Misc.ValidateCached(_cached); 111Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\Text\TextRange.cs (4)
217Misc.ValidateArgument(text.Length != 0, nameof(SR.TextMustNotBeNullOrEmpty)); 439Misc.ThrowInvalidArgument(name); 455Misc.ThrowInvalidArgument(name); 464Misc.ThrowInvalidArgument(name);
System\Windows\Automation\TextPattern.cs (1)
284return Misc.Compare(t1._element, t2._element);
System\Windows\Automation\TogglePattern.cs (2)
99Misc.ValidateCached(_cached); 124Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TransformPattern.cs (2)
133Misc.ValidateCached(_cached); 158Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ValuePattern.cs (2)
121Misc.ValidateCached(_cached); 146Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\WindowPattern.cs (2)
161Misc.ValidateCached(_cached); 186Misc.ValidateCurrent(_hPattern);