public IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex) { if (IntPtr.Size == 8) { return(PInvoker.GetWindowLongPtr64(hWnd, nIndex)); } else { return(PInvoker.GetWindowLongPtr(hWnd, nIndex)); } }
// This helper static method is required because the 32-bit version of user32.dll does not contain this API // (on any versions of Windows), so linking the method will fail at run-time. The bridge dispatches the request // to the correct function (GetWindowLong in 32-bit mode and GetWindowLongPtr in 64-bit mode) public IntPtr SetWindowLongPtr(HandleRef hWnd, int nIndex, IntPtr dwNewLong) { if (IntPtr.Size == 8) { return(PInvoker.SetWindowLongPtr64(hWnd, nIndex, dwNewLong)); } else { return(new IntPtr(PInvoker.SetWindowLong32(hWnd, nIndex, dwNewLong.ToInt32()))); } }
public int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount) { return(PInvoker.GetWindowText(hWnd, lpString, nMaxCount)); }
public uint SHAppBarMessage(int dwMessage, ref APPBARDATA pData) => PInvoker.SHAppBarMessage(dwMessage, ref pData);
public IntPtr OpenInputDesktop(uint dwFlags, bool fInherit, uint dwDesiredAccess) => PInvoker.OpenInputDesktop(dwFlags, fInherit, dwDesiredAccess);
public Int32 CloseDesktop(Int32 hDesktop) => PInvoker.CloseDesktop(hDesktop);
public bool WTSUnRegisterSessionNotification(IntPtr hWnd) => PInvoker.WTSUnRegisterSessionNotification(hWnd);
public bool IsWindow(IntPtr hWnd) { return(PInvoker.IsWindow(hWnd)); }
public void SwitchToThisWindow(IntPtr hWnd, bool fUnknown) { PInvoker.SwitchToThisWindow(hWnd, fUnknown); }
public IntPtr FindWindow(string lpClassName, string lpWindowName) { return(PInvoker.FindWindow(lpClassName, lpWindowName)); }
public bool ShowWindow(IntPtr hWnd, ShowWindowCmd nCmdShow) { return(PInvoker.ShowWindow(hWnd, nCmdShow)); }
public bool IsWindowVisible(IntPtr hWnd) { return(PInvoker.IsWindowVisible(hWnd)); }
public int DwmGetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE dwAttribute, out bool pvAttribute, int cbAttribute) { return(PInvoker.DwmGetWindowAttribute(hwnd, dwAttribute, out pvAttribute, cbAttribute)); }
public bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, ref EnumExtraData data) { return(PInvoker.EnumChildWindows(hwndParent, lpEnumFunc, ref data)); }
public IntPtr GetWindow(IntPtr hWnd, GetWindowType uCmd) { return(PInvoker.GetWindow(hWnd, uCmd)); }
public IntPtr GetConsoleWindow() { return(PInvoker.GetConsoleWindow()); }
public bool FreeConsole() { return(PInvoker.FreeConsole()); }
public IntPtr GetForegroundWindow() { return(PInvoker.GetForegroundWindow()); }
public bool WTSRegisterSessionNotification(IntPtr hWnd, int dwFlags) => PInvoker.WTSRegisterSessionNotification(hWnd, dwFlags);
public uint GetCurrentThreadId() { return(PInvoker.GetCurrentThreadId()); }
public Int32 OpenDesktop(string lpszDesktop, Int32 dwFlags, bool fInherit, Int32 dwDesiredAccess) => PInvoker.OpenDesktop(lpszDesktop, dwFlags, fInherit, dwDesiredAccess);
public uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId) { return(PInvoker.GetWindowThreadProcessId(hWnd, out lpdwProcessId)); }
public Int32 SwitchDesktop(Int32 hDesktop) => PInvoker.SwitchDesktop(hDesktop);
// When you don't want the ProcessId, use this overload and pass IntPtr.Zero for the second parameter public uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId) { return(PInvoker.GetWindowThreadProcessId(hWnd, ProcessId)); }
public bool GetUserObjectInformation(IntPtr hObj, int nIndex, [Out] byte[] pvInfo, uint nLength, out uint lpnLengthNeeded) => PInvoker.GetUserObjectInformation(hObj, nIndex, pvInfo, nLength, out lpnLengthNeeded);
public bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach) { return(PInvoker.AttachThreadInput(idAttach, idAttachTo, fAttach)); }
public bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint) => PInvoker.MoveWindow(hWnd, x, y, cx, cy, repaint);
public IntPtr SetActiveWindow(IntPtr hWnd) { return(PInvoker.SetActiveWindow(hWnd)); }
public bool AllocConsole() { return(PInvoker.AllocConsole()); }
public int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount) { return(PInvoker.GetClassName(hWnd, lpClassName, nMaxCount)); }