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