Example #1
0
        /// <summary>
        /// Gets the main thread of a given process.
        /// </summary>
        /// <param name="hWindowHandle">The window handle of the process whose main thread will be returned.</param>
        /// <returns>Returns the main thread on success, null on failure.</returns>
        public static ProcessThread GetMainThread(IntPtr hWindowHandle)
        {
            if (hWindowHandle == IntPtr.Zero)
            {
                return(null);
            }

            return(GetMainThread(SProcess.GetProcessFromWindow(hWindowHandle)));
        }
Example #2
0
        /// <summary>
        /// Opens a process for interaction.
        /// </summary>
        /// <param name="WindowHandle">Window handle of main window of process with which we wish to interact.</param>
        /// <returns>Returns true on success, false on failure.</returns>
        public bool Open(IntPtr WindowHandle)
        {
            if (WindowHandle == IntPtr.Zero)
            {
                return(false);
            }

            return(this.Open(SProcess.GetProcessFromWindow(WindowHandle)));
        }
Example #3
0
        /// <summary>
        /// Gets the main thread ID of a given process.
        /// </summary>
        /// <param name="hWindowHandle">The window handle of the process whose main thread ID will be returned.</param>
        /// <returns>Returns non-zero on success, zero on failure.</returns>
        public static int GetMainThreadId(IntPtr hWindowHandle)
        {
            if (hWindowHandle == IntPtr.Zero)
            {
                return(0);
            }

            return(GetMainThreadId(SProcess.GetProcessFromWindow(hWindowHandle)));
        }
Example #4
0
 /// <summary>
 /// Allows interfacing with an external process (memory manipulation, thread manipulation, etc.)
 /// </summary>
 /// <param name="WindowHandle">Window handle of main window of process with which we wish to interact.</param>
 public BlackMagic(IntPtr WindowHandle) : this(SProcess.GetProcessFromWindow(WindowHandle))
 {
 }