135 references to UnsafeNativeMethods
UIAutomationClient (135)
MS\Internal\Automation\Accessible.cs (3)
28if( UnsafeNativeMethods.AccessibleObjectFromEvent( hwnd, idObject, idChild, ref acc, ref child ) != 0 /*S_OK*/ || acc == null ) 49return UnsafeNativeMethods.STATE_SYSTEM_UNAVAILABLE; 62if (UnsafeNativeMethods.WindowFromAccessibleObject(_acc, ref _hwnd) != 0/*S_OK*/)
MS\Internal\Automation\BoundingRectTracker.cs (1)
46if ( hwnd == IntPtr.Zero || idObject != UnsafeNativeMethods.OBJID_WINDOW )
MS\Internal\Automation\FocusTracker.cs (8)
130if (idObject == UnsafeNativeMethods.OBJID_CLIENT) 133provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), idChild, UnsafeNativeMethods.OBJID_CLIENT); 135else if (idObject == UnsafeNativeMethods.OBJID_MENU) 144else if (idObject == UnsafeNativeMethods.OBJID_SYSMENU) 246if (idObject != UnsafeNativeMethods.OBJID_CARET && _accCurrent != null) 294IntPtr i = Misc.SendMessageTimeout(NativeMethods.HWND.Cast(hwnd), UnsafeNativeMethods.LB_GETCURSEL, IntPtr.Zero, IntPtr.Zero); 295Accessible acc = Accessible.Create(hwnd, UnsafeNativeMethods.OBJID_CLIENT, i.ToInt32() + 1); 321Accessible acc = Accessible.Create(guiThreadInfo.hwndFocus, UnsafeNativeMethods.OBJID_CLIENT, 0);
MS\Internal\Automation\HwndProxyElementProvider.cs (65)
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) 309UnsafeNativeMethods.WINDOWPLACEMENT wp = new UnsafeNativeMethods.WINDOWPLACEMENT 311length = Marshal.SizeOf(typeof(UnsafeNativeMethods.WINDOWPLACEMENT)) 320wp.showCmd = UnsafeNativeMethods.SW_RESTORE; 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)) 573IntPtr ret = UnsafeNativeMethods.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_NULL, IntPtr.Zero, IntPtr.Zero, UnsafeNativeMethods.SMTO_ABORTIFHUNG, 0, out dwResult); 690if (!Misc.SetWindowPos(_hwnd, NativeMethods.HWND.NULL, (int)x, (int)y, 0, 0, UnsafeNativeMethods.SWP_NOSIZE | UnsafeNativeMethods.SWP_NOZORDER | UnsafeNativeMethods.SWP_NOACTIVATE)) 695UnsafeNativeMethods.WINDOWPLACEMENT wp = new UnsafeNativeMethods.WINDOWPLACEMENT 697length = Marshal.SizeOf(typeof(UnsafeNativeMethods.WINDOWPLACEMENT)) 717wp.flags = UnsafeNativeMethods.WPF_SETMINPOSITION; 780UnsafeNativeMethods.MINMAXINFO minMaxInfo = default; 795Misc.SendMessageTimeout(_hwnd, UnsafeNativeMethods.WM_GETMINMAXINFO, IntPtr.Zero, ref minMaxInfo); 809UnsafeNativeMethods.WINDOWPLACEMENT wp = new UnsafeNativeMethods.WINDOWPLACEMENT 811length = Marshal.SizeOf(typeof(UnsafeNativeMethods.WINDOWPLACEMENT)) 864return IsMenuItemSelectable(hmenu, UnsafeNativeMethods.SC_MOVE); 909return IsMenuItemSelectable(hmenu, UnsafeNativeMethods.SC_SIZE); 967unsafe private static bool GetMenuBarInfo(NativeMethods.HWND hwnd, int idObject, uint idItem, out UnsafeNativeMethods.MENUBARINFO mbi) 969mbi = new UnsafeNativeMethods.MENUBARINFO 971cbSize = sizeof(UnsafeNativeMethods.MENUBARINFO) 993UnsafeNativeMethods.MENUBARINFO mbi; 995if (GetMenuBarInfo(_hwnd, UnsafeNativeMethods.OBJID_SYSMENU, 0, out mbi) && mbi.hMenu != IntPtr.Zero) 1361IRawElementProviderSimple proxyProvider = ProxyManager.ProxyProviderFromHwnd(hwnd, 0, UnsafeNativeMethods.OBJID_CLIENT); 1449IntPtr visibilityOverride = UnsafeNativeMethods.GetProp(hwnd, "UIA_WindowVisibilityOverridden"); 1641int state = UnsafeNativeMethods.GetMenuState(hmenu, item, UnsafeNativeMethods.MF_BYCOMMAND); 1642bool isDisabled = IsBitSet(state, UnsafeNativeMethods.MF_DISABLED); 1643bool isGrayed = IsBitSet(state, UnsafeNativeMethods.MF_GRAYED); 1779IntPtr hwndCompare = UnsafeNativeMethods.WindowFromPhysicalPoint(x1, y1); 1817IntPtr lr = Misc.SendMessageTimeout( hChild, UnsafeNativeMethods.WM_NCHITTEST, IntPtr.Zero, MAKELPARAM( (int)x, (int)y ) ); 1818if( lr == UnsafeNativeMethods.HTTRANSPARENT ) 1998IntPtr lresult = Misc.SendMessageTimeout(parent, UnsafeNativeMethods.WM_MDIACTIVATE, (IntPtr)hwnd, IntPtr.Zero); 2026bool fShiftDown = ( UnsafeNativeMethods.GetAsyncKeyState( UnsafeNativeMethods.VK_SHIFT ) & unchecked((int)0x80000000) ) != 0; 2027bool fAltDown = ( UnsafeNativeMethods.GetAsyncKeyState( UnsafeNativeMethods.VK_MENU ) & unchecked((int)0x80000000) ) != 0; 2028bool fCtrlDown = ( UnsafeNativeMethods.GetAsyncKeyState( UnsafeNativeMethods.VK_CONTROL ) & unchecked((int)0x80000000) ) != 0; 2031Input.SendKeyboardInputVK( UnsafeNativeMethods.VK_SHIFT, false ); 2033Input.SendKeyboardInputVK( UnsafeNativeMethods.VK_MENU, false ); 2035Input.SendKeyboardInputVK( UnsafeNativeMethods.VK_CONTROL, false ); 2042Input.SendKeyboardInputVK( UnsafeNativeMethods.VK_SHIFT, true ); 2044Input.SendKeyboardInputVK( UnsafeNativeMethods.VK_MENU, true ); 2046Input.SendKeyboardInputVK( UnsafeNativeMethods.VK_CONTROL, true ); 2053int result = Misc.MsgWaitForMultipleObjects(null, false, 2000, UnsafeNativeMethods.QS_ALLINPUT); 2054if (result == UnsafeNativeMethods.WAIT_FAILED || result == UnsafeNativeMethods.WAIT_TIMEOUT) 2057UnsafeNativeMethods.MSG msg = new UnsafeNativeMethods.MSG(); 2062UnsafeNativeMethods.TranslateMessage(ref msg); 2068UnsafeNativeMethods.DispatchMessage(ref msg); 2070if (msg.message == UnsafeNativeMethods.WM_HOTKEY 2082UnsafeNativeMethods.SwitchToThisWindow(hwnd, true);
MS\Internal\Automation\input.cs (11)
48UnsafeNativeMethods.INPUT ki = new UnsafeNativeMethods.INPUT 50type = UnsafeNativeMethods.INPUT_KEYBOARD 53ki.union.keyboardInput.wScan = (short) UnsafeNativeMethods.MapVirtualKey( ki.union.keyboardInput.wVk, 0 ); 56dwFlags |= UnsafeNativeMethods.KEYEVENTF_SCANCODE; 58dwFlags |= UnsafeNativeMethods.KEYEVENTF_KEYUP; 62ki.union.keyboardInput.dwFlags |= UnsafeNativeMethods.KEYEVENTF_EXTENDEDKEY; 76UnsafeNativeMethods.INPUT ki = new UnsafeNativeMethods.INPUT 78type = UnsafeNativeMethods.INPUT_KEYBOARD 82ki.union.keyboardInput.dwFlags = press ? 0 : UnsafeNativeMethods.KEYEVENTF_KEYUP;
MS\Internal\Automation\Misc.cs (24)
285bool result = UnsafeNativeMethods.CloseHandle(handle); 298bool result = UnsafeNativeMethods.DeleteObject(hrgn); 344internal static bool GetMenuBarInfo(NativeMethods.HWND hwnd, int idObject, uint item, ref UnsafeNativeMethods.MENUBARINFO mbi) 370internal static int GetMessage(ref UnsafeNativeMethods.MSG msg, NativeMethods.HWND hwnd, int nMsgFilterMin, int nMsgFilterMax) 372int result = UnsafeNativeMethods.GetMessage(ref msg, hwnd, nMsgFilterMin, nMsgFilterMax); 425internal static bool GetWindowPlacement(NativeMethods.HWND hwnd, ref UnsafeNativeMethods.WINDOWPLACEMENT wp) 427bool result = UnsafeNativeMethods.GetWindowPlacement(hwnd, ref wp); 476terminationEvent = UnsafeNativeMethods.MsgWaitForMultipleObjects(0, null, waitAll, milliseconds, wakeMask); 486terminationEvent = UnsafeNativeMethods.MsgWaitForMultipleObjects(1, handles, waitAll, milliseconds, wakeMask); 504if (terminationEvent == UnsafeNativeMethods.WAIT_FAILED) 513IntPtr processHandle = UnsafeNativeMethods.OpenProcess(dwDesiredAccess, fInherit, dwProcessId); 524processHandle = UnsafeNativeMethods.GetProcessHandleFromHwnd(hwnd.h); 543bool result = UnsafeNativeMethods.PostMessage(hWnd, nMsg, wParam, lParam); 556bool result = UnsafeNativeMethods.RegisterHotKey(hWnd, id, fsModifiers, vk); 567internal static int SendInput(int nInputs, ref UnsafeNativeMethods.INPUT mi, int cbSize) 569int result = UnsafeNativeMethods.SendInput(nInputs, ref mi, cbSize); 586IntPtr smtoRetVal = UnsafeNativeMethods.SendMessageTimeout(hwnd, Msg, wParam, lParam, 0, 10000, out lresult); 597internal static IntPtr SendMessageTimeout(NativeMethods.HWND hwnd, int Msg, IntPtr wParam, ref UnsafeNativeMethods.MINMAXINFO lParam) 603IntPtr smtoRetVal = UnsafeNativeMethods.SendMessageTimeout(hwnd, Msg, wParam, ref lParam, 0, 10000, out lresult); 620IntPtr smtoRetVal = UnsafeNativeMethods.SendMessageTimeout(hwnd, Msg, wParam, lParam, 0, 10000, out lresult); 632internal static bool SetWindowPlacement(NativeMethods.HWND hwnd, ref UnsafeNativeMethods.WINDOWPLACEMENT wp) 634bool result = UnsafeNativeMethods.SetWindowPlacement(hwnd, ref wp); 647bool result = UnsafeNativeMethods.SetWindowPos(hWnd, hWndInsertAfter, x, y, cx, cy, flags); 660bool result = UnsafeNativeMethods.UnregisterHotKey(hWnd, id);
MS\Internal\Automation\ProxyManager.cs (3)
204return nonClientFactory( hwnd, 0, UnsafeNativeMethods.OBJID_CLIENT ); 214return menuFactory( hwnd, 0, UnsafeNativeMethods.OBJID_CLIENT ); 792IntPtr result = Misc.SendMessageTimeout(hwnd, UnsafeNativeMethods.WM_GETOBJECT, IntPtr.Zero, (IntPtr)OBJID_QUERYCLASSNAMEIDX);
MS\Internal\Automation\QueueProcessor.cs (10)
116UnsafeNativeMethods.MSG msg = new UnsafeNativeMethods.MSG(); 120while (UnsafeNativeMethods.PeekMessage(ref msg, NativeMethods.HWND.NULL, 0, 0, UnsafeNativeMethods.PM_REMOVE)) 122if (msg.message == UnsafeNativeMethods.WM_QUIT) 130UnsafeNativeMethods.DispatchMessage(ref msg); 137int result = Misc.TryMsgWaitForMultipleObjects(handle, false, UnsafeNativeMethods.INFINITE, UnsafeNativeMethods.QS_ALLINPUT, ref lastWin32Error); 138if (result == UnsafeNativeMethods.WAIT_FAILED || result == UnsafeNativeMethods.WAIT_TIMEOUT)
MS\Internal\Automation\SafeProcessHandle.cs (2)
29SetHandle(Misc.OpenProcess(UnsafeNativeMethods.PROCESS_QUERY_INFORMATION | UnsafeNativeMethods.PROCESS_VM_READ, false, processId, hwnd));
MS\Internal\Automation\UiaCoreApi.cs (1)
1578provider = ProxyManager.ProxyProviderFromHwnd(NativeMethods.HWND.Cast(hwnd), 0, UnsafeNativeMethods.OBJID_CLIENT);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (1)
52if (idObject != UnsafeNativeMethods.OBJID_WINDOW)
MS\Internal\Automation\WindowInteractionStateTracker.cs (1)
47if (idObject != UnsafeNativeMethods.OBJID_WINDOW)
MS\Internal\Automation\WindowShowOrOpenTracker.cs (1)
52if (idObject != UnsafeNativeMethods.OBJID_WINDOW)
MS\Internal\Automation\WindowVisualStateTracker.cs (1)
47if (idObject != UnsafeNativeMethods.OBJID_WINDOW)
MS\Internal\Automation\WinEventWrap.cs (2)
110_hHooks[i] = UnsafeNativeMethods.SetWinEventHook(eventId, eventId, IntPtr.Zero, _winEventProc, 0, 0, _fFlags); 134UnsafeNativeMethods.UnhookWinEvent(_hHooks[i]);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsSetLastError.cs (1)
53public static extern bool GetMenuBarInfo (IntPtr hwnd, int idObject, uint idItem, ref UnsafeNativeMethods.MENUBARINFO mbi);