146 references to Misc
UIAutomationClient (146)
MS\Internal\Automation\Accessible.cs (1)
107&& Misc.IsCriticalException(e);
MS\Internal\Automation\BoundingRectTracker.cs (1)
89if (!Misc.GetWindowRect(nativeHwnd, out rc32))
MS\Internal\Automation\EventListenerClientSide.cs (9)
98if( !Misc.Compare( _refRid, rid ) ) 115Misc.Compare(_refRid, AutomationElement.RootElement.GetRuntimeId())) 129if ((_eventListener.TreeScope & TreeScope.Element) != 0 && Misc.Compare(el, elThis)) 140if (elParent != null && Misc.Compare(elParent, elThis)) 148if (elParent != null && Misc.Compare(elParent, el)) 172Misc.Compare(_refRid, AutomationElement.RootElement.GetRuntimeId())) 186if ( Misc.Compare( rid, _refRid ) ) 264if( ! Misc.Compare( el, elPossibleParent ) ) 269if( Misc.Compare( elPossibleChild, elPossibleParent ) )
MS\Internal\Automation\FocusTracker.cs (4)
192if( Misc.IsCriticalException( e ) ) 261if( Misc.IsCriticalException( e ) ) 294IntPtr i = Misc.SendMessageTimeout(NativeMethods.HWND.Cast(hwnd), UnsafeNativeMethods.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero); 316if (!Misc.GetGUIThreadInfo(0, ref guiThreadInfo))
MS\Internal\Automation\HwndProxyElementProvider.cs (62)
98int id = Misc.GetWindowLong(_hwnd, SafeNativeMethods.GWL_ID); 117IntPtr len = Misc.SendMessageTimeout( _hwnd, UnsafeNativeMethods.WM_GETTEXTLENGTH, IntPtr.Zero, IntPtr.Zero ); 127if (Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETTEXT, new IntPtr(ilen + 1), str) == IntPtr.Zero) 133return Misc.StripMnemonic(str.ToString()); 161if (!Misc.GetGUIThreadInfo(0, ref gti)) 170return Misc.IsWindowsFormsControl(ProxyManager.GetClassName(_hwnd)) ? "WinForm" : "Win32"; 237if (!Misc.GetWindowRect(_hwnd, out rcW32)) 315if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 324if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 345if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_MINIMIZE, IntPtr.Zero)) 366if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_MAXIMIZE, IntPtr.Zero)) 388if (!Misc.PostMessage(_hwnd, UnsafeNativeMethods.WM_SYSCOMMAND, (IntPtr)UnsafeNativeMethods.SC_CLOSE, IntPtr.Zero)) 644if (!Misc.GetWindowRect(_hwnd, out currentRect)) 668if (!Misc.GetClientRect(hwndParent, out parentRect)) 690if (!Misc.SetWindowPos(_hwnd, NativeMethods.HWND.NULL, (int)x, (int)y, 0, 0, UnsafeNativeMethods.SWP_NOSIZE | UnsafeNativeMethods.SWP_NOZORDER | UnsafeNativeMethods.SWP_NOACTIVATE)) 702if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 722if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 731if (!Misc.GetWindowRect(_hwnd, out currentRect)) 739if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 748if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 761if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 795Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETMINMAXINFO, IntPtr.Zero, ref minMaxInfo); 815if (!Misc.GetWindowPlacement(_hwnd, ref wp)) 827if (!Misc.SetWindowPlacement(_hwnd, ref wp)) 973bool result = Misc.GetMenuBarInfo(hwnd, idObject, idItem, ref mbi); 1141hwnd = Misc.GetWindow( hwnd, dir ); 1144for( ; hwnd != NativeMethods.HWND.NULL ; hwnd = Misc.GetWindow( hwnd, dir ) ) 1172NativeMethods.HWND scan = Misc.GetWindow(desktop, SafeNativeMethods.GW_CHILD); 1176scan = Misc.GetWindow(scan, SafeNativeMethods.GW_HWNDLAST); 1230hwnd = Misc.GetWindow(hwndOwner, SafeNativeMethods.GW_CHILD); 1297hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1319NativeMethods.HWND hwnd = Misc.GetWindow(_hwnd, SafeNativeMethods.GW_CHILD); 1322hwnd = Misc.GetWindow(hwnd, SafeNativeMethods.GW_HWNDLAST); 1400for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1402hChild = Misc.GetWindow(hChild, SafeNativeMethods.GW_HWNDNEXT)) 1466if (!Misc.GetWindowRect(hwnd, out rcW32)) 1509NativeMethods.HWND hwndOwner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1593NativeMethods.HWND owner = Misc.GetWindow(hwnd, SafeNativeMethods.GW_OWNER); 1631if (!Misc.GetGUIThreadInfo(0, ref gui)) 1720IntPtr hrgn = Misc.CreateRectRgn(0, 0, 0, 0); // NOTE: Must be deleted before returning 1729for (NativeMethods.HWND hChild = Misc.GetWindow(hwnd, SafeNativeMethods.GW_CHILD); 1731hChild = Misc.GetWindow(hChild, SafeNativeMethods.GW_HWNDNEXT)) 1739if (!Misc.GetWindowRect(hChild, out rc)) 1817IntPtr lr = Misc.SendMessageTimeout( hChild, UnsafeNativeMethods.WM_NCHITTEST, IntPtr.Zero, MAKELPARAM( (int)x, (int)y ) ); 1833if (!Misc.GetWindowRect(hChild, out rcBest)) 1843if (!Misc.GetWindowRect(hChild, out rcChild)) 1862if (!Misc.GetClientRect(hChild, out rcClient) || 1869Misc.DeleteObject(hrgn); // finished with region 1873Misc.DeleteObject(hrgn); // finished with region 1920Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 1945Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 1962int style = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_STYLE); 1973int exstyle = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_EXSTYLE); 1998IntPtr lresult = Misc.SendMessageTimeout(parent, UnsafeNativeMethods.WM_MDIACTIVATE, (IntPtr)hwnd, IntPtr.Zero); 2005short atom = Misc.GlobalAddAtom("FocusHotKey"); 2015if( Misc.RegisterHotKey( NativeMethods.HWND.NULL, atom, 0, vk ) ) 2053int result = Misc.MsgWaitForMultipleObjects(null, false, 2000, UnsafeNativeMethods.QS_ALLINPUT); 2058if (Misc.GetMessage(ref msg, NativeMethods.HWND.NULL, 0, 0) == 0) 2077Misc.UnregisterHotKey(NativeMethods.HWND.NULL, atom); 2079Misc.GlobalDeleteAtom(atom); 2091if (!Misc.GetGUIThreadInfo(0, ref gti)) 2106if (Misc.GetGUIThreadInfo(0, ref gti))
MS\Internal\Automation\input.cs (2)
67Misc.SendInput(1, ref ki, Marshal.SizeOf(ki)); 86Misc.SendInput(1, ref ki, Marshal.SizeOf(ki));
MS\Internal\Automation\InvokeHandlers.cs (1)
99if (Misc.IsCriticalException(e))
MS\Internal\Automation\ProxyManager.cs (6)
229Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 243Misc.ThrowWin32ExceptionsIfError(lastWin32Error); 298int instance = Misc.GetWindowLong(hwnd, SafeNativeMethods.GWL_HINSTANCE); 312if (Misc.GetModuleFileNameEx(processHandle, (IntPtr)instance, sb, NativeMethods.MAX_PATH) == 0) 701if( Misc.IsCriticalException( e ) ) 792IntPtr result = Misc.SendMessageTimeout(hwnd, UnsafeNativeMethods.WM_GETOBJECT, IntPtr.Zero, (IntPtr)OBJID_QUERYCLASSNAMEIDX);
MS\Internal\Automation\QueueProcessor.cs (2)
137int result = Misc.TryMsgWaitForMultipleObjects(handle, false, UnsafeNativeMethods.INFINITE, UnsafeNativeMethods.QS_ALLINPUT, ref lastWin32Error); 166if (Misc.IsCriticalException(e))
MS\Internal\Automation\SafeProcessHandle.cs (2)
29SetHandle(Misc.OpenProcess(UnsafeNativeMethods.PROCESS_QUERY_INFORMATION | UnsafeNativeMethods.PROCESS_VM_READ, false, processId, hwnd)); 34return Misc.CloseHandle(handle);
MS\Internal\Automation\WinEventWrap.cs (2)
193if( Misc.IsCriticalException( e ) ) 208if( Misc.IsCriticalException( ex ) )
System\Windows\Automation\AndCondition.cs (1)
33Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) );
System\Windows\Automation\Automation.cs (9)
66return Misc.Compare(el1, el2); 79return Misc.Compare(runtimeId1, runtimeId2); 128Misc.ValidateArgument( eventId != AutomationElement.AutomationFocusChangedEvent, nameof(SR.EventIdMustNotBeAutomationFocusChanged) ); 129Misc.ValidateArgument( eventId != AutomationElement.StructureChangedEvent, nameof(SR.EventIdMustNotBeStructureChanged) ); 130Misc.ValidateArgument( eventId != AutomationElement.AutomationPropertyChangedEvent, nameof(SR.EventIdMustNotBeAutomationPropertyChanged) ); 141if ( Misc.Compare( element, AutomationElement.RootElement ) ) 196Misc.ValidateArgument( eventId != AutomationElement.AutomationFocusChangedEvent, nameof(SR.EventIdMustNotBeAutomationFocusChanged) ); 197Misc.ValidateArgument( eventId != AutomationElement.StructureChangedEvent, nameof(SR.EventIdMustNotBeStructureChanged) ); 198Misc.ValidateArgument( eventId != AutomationElement.AutomationPropertyChangedEvent, nameof(SR.EventIdMustNotBeAutomationPropertyChanged) );
System\Windows\Automation\AutomationElement.cs (7)
311return Misc.Compare(this, el); 425Misc.ValidateArgument(hwnd != IntPtr.Zero, nameof(SR.HwndMustBeNonNULL)); 587if (Misc.IsCriticalException(e)) 598patternObject = Misc.WrapInterfaceOnClientSide(this, hpatternobj, pattern); 818return (AutomationProperty[])Misc.RemoveDuplicates(Misc.CombineArrays(propArrays, typeof(AutomationProperty)), typeof(AutomationProperty)); 1260val = Misc.WrapInterfaceOnClientSide(this, hpatternobj, automationPattern);
System\Windows\Automation\DockPattern.cs (2)
100Misc.ValidateCached(_cached); 125Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ExpandCollapsePattern.cs (2)
106Misc.ValidateCached(_cached); 131Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\GridItemPattern.cs (2)
107Misc.ValidateCached(_cached); 132Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\GridPattern.cs (2)
104Misc.ValidateCached(_cached); 129Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\MultipleViewPattern.cs (2)
113Misc.ValidateCached(_cached); 138Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\OrCondition.cs (1)
33Misc.ValidateArgument( conditions.Length >= 2, nameof(SR.MustBeAtLeastTwoConditions) );
System\Windows\Automation\PropertyCondition.cs (1)
144Misc.ValidateArgument(val is string, nameof(SR.IgnoreCaseRequiresString));
System\Windows\Automation\RangeValuePattern.cs (2)
133Misc.ValidateCached(_cached); 158Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ScrollPattern.cs (2)
153Misc.ValidateCached(_cached); 178Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\SelectionItemPattern.cs (2)
135Misc.ValidateCached(_cached); 160Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\SelectionPattern.cs (2)
106Misc.ValidateCached(_cached); 131Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TableItemPattern.cs (2)
97Misc.ValidateCached(_cached); 122Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TablePattern.cs (2)
87Misc.ValidateCached(_cached); 112Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\Text\TextRange.cs (4)
218Misc.ValidateArgument(text.Length != 0, nameof(SR.TextMustNotBeNullOrEmpty)); 440Misc.ThrowInvalidArgument(name); 456Misc.ThrowInvalidArgument(name); 465Misc.ThrowInvalidArgument(name);
System\Windows\Automation\TextPattern.cs (1)
285return Misc.Compare(t1._element, t2._element);
System\Windows\Automation\TogglePattern.cs (2)
100Misc.ValidateCached(_cached); 125Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\TransformPattern.cs (2)
134Misc.ValidateCached(_cached); 159Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\ValuePattern.cs (2)
122Misc.ValidateCached(_cached); 147Misc.ValidateCurrent(_hPattern);
System\Windows\Automation\WindowPattern.cs (2)
162Misc.ValidateCached(_cached); 187Misc.ValidateCurrent(_hPattern);