private static void SendChar(ClientWindowHandle hWnd, char c) { int value = (int)c; int lParam = 1 | ((NativeMethods.OemKeyScan(value) & 0xFF) << 16) | (0x3 << 30); NativeMethods.SendMessage(hWnd, WM_CHAR, value, lParam); }
/// <summary> /// Brings the Client window to the foreground. /// </summary> /// <returns>True if the Client is running, false if not.</returns> public static bool BringToTop() { ClientWindowHandle hWnd = Handle; if (!hWnd.IsInvalid) { NativeMethods.SetForegroundWindow(hWnd); return(true); } return(false); }
/// <summary> /// Sends a <see cref="String" /> of characters (<paramref name="text" />) to the Client. /// </summary> /// <returns>True if the Client is running, false if not.</returns> public static bool SendString(string text) { ClientWindowHandle hWnd = Handle; if (!hWnd.IsInvalid) { for (int i = 0; i < text.Length; ++i) { SendChar(hWnd, text[i]); } return(true); } else { return(false); } }
public static extern int CloseHandle(ClientWindowHandle handle);
public static extern int SendMessage(ClientWindowHandle hWnd, int wMsg, int wParam, int lParam);
public static extern bool PostMessage(ClientWindowHandle hWnd, int wMsg, int wParam, int lParam);
public static extern int IsWindow(ClientWindowHandle window);
public static extern int SetForegroundWindow(ClientWindowHandle hWnd);
public static extern int GetWindowThreadProcessId(ClientWindowHandle window, ref ClientProcessHandle processID);
private static void SendChar(ClientWindowHandle hWnd, char c) { int value = c; int lParam = 1 | ((NativeMethods.OemKeyScan(value) & 0xFF) << 16) | (0x3 << 30); NativeMethods.PostMessage(hWnd, WM_CHAR, value, lParam); }
public WindowProcessStream( ClientWindowHandle window ) { m_Window = window; m_ProcessID = ClientProcessHandle.Invalid; }
public WindowProcessStream(ClientWindowHandle window) { m_Window = window; m_ProcessID = ClientProcessHandle.Invalid; }