Esempio n. 1
0
        private void GetInfo()
        {
            Point MouseCoords = MousePosition;

            Parent_hwnd = (IntPtr)FindRoot(WindowEditor.WindowFromPointm(MouseCoords.X, MouseCoords.Y));

            WindowGUIEditor.WINDOWPLACEMENT placement = new WindowGUIEditor.WINDOWPLACEMENT();
            placement.length = Marshal.SizeOf(placement);
            WindowEditor.GetWindowPlacementm(Parent_hwnd, out placement);

            if (RealChildWFPRB.Checked == true)
            {
                Child_hwnd = WindowEditor.RealChildWindowFromPointm(Parent_hwnd, new Point(
                    MouseCoords.X - placement.rcNormalPosition.X - Cursor.Size.Width / 4,
                    MouseCoords.Y - placement.rcNormalPosition.Y - Cursor.Size.Height));
            }
            else if (ChildWFPRB.Checked == true)
            {
                Child_hwnd = WindowEditor.ChildWindowFromPointm(Parent_hwnd, new Point(
                       MouseCoords.X - placement.rcNormalPosition.X - Cursor.Size.Width / 4,
                       MouseCoords.Y - placement.rcNormalPosition.Y - Cursor.Size.Height));
            }
            else if (ChildWFPExRB.Checked == true)
            {
                UInt32 grabFlags;

                switch (GrabTypeComboBox.SelectedIndex)
                {
                    case 0:
                        grabFlags = 0x0000;
                        break;
                    case 1:
                        grabFlags = 0x0001;
                        break;
                    case 2:
                        grabFlags = 0x0002;
                        break;
                    case 3:
                        grabFlags = 0x0004;
                        break;
                    default:
                        grabFlags = 0x0000;
                        break;
                }

                Child_hwnd = WindowEditor.ChildWindowFromPointExm(Parent_hwnd, new Point(
                    MouseCoords.X - placement.rcNormalPosition.X - Cursor.Size.Width / 4,
                    MouseCoords.Y - placement.rcNormalPosition.Y - Cursor.Size.Height), grabFlags);
            }

            GetWindowPosition();

            uint PID;
            PID = WindowEditor.GetWindowThreadProcessIdm(Parent_hwnd, out PID);
            ProcessIDLabel.Text = Conversions.ToHex(PID.ToString());

            //Update data on form
            ChildHandleLabel.Text = Conversions.ToAddress(Child_hwnd.ToString());
            ChildTextLabel.Text = childText;

            ParentHandleLabel.Text = Conversions.ToAddress(Parent_hwnd.ToString());// +" TODO: #ID";
            ParentTextLabel.Text = WindowText((int)Parent_hwnd);
            childText = WindowText((int)Child_hwnd);
        }
Esempio n. 2
0
        private void GetInfo()
        {
            Point MouseCoords = MousePosition;

            Parent_hwnd = (IntPtr)FindRoot(WindowEditor.WindowFromPointm(MouseCoords.X, MouseCoords.Y));

            WindowGUIEditor.WINDOWPLACEMENT placement = new WindowGUIEditor.WINDOWPLACEMENT();
            placement.length = Marshal.SizeOf(placement);
            WindowEditor.GetWindowPlacementm(Parent_hwnd, out placement);

            if (RealChildWFPRB.Checked == true)
            {
                Child_hwnd = WindowEditor.RealChildWindowFromPointm(Parent_hwnd, new Point(
                                                                        MouseCoords.X - placement.rcNormalPosition.X - Cursor.Size.Width / 4,
                                                                        MouseCoords.Y - placement.rcNormalPosition.Y - Cursor.Size.Height));
            }
            else if (ChildWFPRB.Checked == true)
            {
                Child_hwnd = WindowEditor.ChildWindowFromPointm(Parent_hwnd, new Point(
                                                                    MouseCoords.X - placement.rcNormalPosition.X - Cursor.Size.Width / 4,
                                                                    MouseCoords.Y - placement.rcNormalPosition.Y - Cursor.Size.Height));
            }
            else if (ChildWFPExRB.Checked == true)
            {
                UInt32 grabFlags;

                switch (GrabTypeComboBox.SelectedIndex)
                {
                case 0:
                    grabFlags = 0x0000;
                    break;

                case 1:
                    grabFlags = 0x0001;
                    break;

                case 2:
                    grabFlags = 0x0002;
                    break;

                case 3:
                    grabFlags = 0x0004;
                    break;

                default:
                    grabFlags = 0x0000;
                    break;
                }

                Child_hwnd = WindowEditor.ChildWindowFromPointExm(Parent_hwnd, new Point(
                                                                      MouseCoords.X - placement.rcNormalPosition.X - Cursor.Size.Width / 4,
                                                                      MouseCoords.Y - placement.rcNormalPosition.Y - Cursor.Size.Height), grabFlags);
            }

            GetWindowPosition();

            uint PID;

            PID = WindowEditor.GetWindowThreadProcessIdm(Parent_hwnd, out PID);
            ProcessIDLabel.Text = Conversions.ToHex(PID.ToString());

            //Update data on form
            ChildHandleLabel.Text = Conversions.ToAddress(Child_hwnd.ToString());
            ChildTextLabel.Text   = childText;

            ParentHandleLabel.Text = Conversions.ToAddress(Parent_hwnd.ToString());// +" TODO: #ID";
            ParentTextLabel.Text   = WindowText((int)Parent_hwnd);
            childText = WindowText((int)Child_hwnd);
        }