Inheritance: Microsoft.Win32.SafeHandles.CriticalHandleZeroOrMinusOneIsInvalid
Beispiel #1
0
        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);
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
        /// <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);
            }
        }
Beispiel #4
0
 public static extern int CloseHandle(ClientWindowHandle handle);
Beispiel #5
0
		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 SendMessage(ClientWindowHandle hWnd, int wMsg, int wParam, int lParam);
Beispiel #10
0
		public static extern bool PostMessage(ClientWindowHandle hWnd, int wMsg, int wParam, int lParam);
 public static extern int GetWindowThreadProcessId(ClientWindowHandle window, ref ClientProcessHandle processID);
Beispiel #12
0
		public static extern int SetForegroundWindow(ClientWindowHandle hWnd);
Beispiel #13
0
 public static extern int CloseHandle(ClientWindowHandle handle);
Beispiel #14
0
		public static extern int GetWindowThreadProcessId(ClientWindowHandle window, ref ClientProcessHandle processID);
Beispiel #15
0
		public static extern int IsWindow(ClientWindowHandle window);
Beispiel #16
0
        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;
 }