Пример #1
0
 private void SetWeGameForm(UserForm userForm, IntPtr HWND)
 {
     if (HWND == IntPtr.Zero)
     {
         userForm.isOpen = false;
         userForm.Hide();
     }
     else
     {
         Win32Native.RECT lpRect = new Win32Native.RECT();
         Win32Native.GetWindowRect(HWND, ref lpRect);
         int num  = lpRect.Right - lpRect.Left;
         int num2 = lpRect.Bottom - lpRect.Top;
         if ((num != 0x35e) && (num2 != 0x1e1))
         {
             try
             {
                 this.WeGameFourShow(HWND);
                 if (!UrlManage.weGameBlock)
                 {
                     if ((ComHelp.GetPixelColor(userForm.hideLocation1, HWND).ToString() == userForm.hideColor1) || (userForm.hideColor1 == "0"))
                     {
                         if (!userForm.isOpen)
                         {
                             if (!userForm.text.Contains("自适应"))
                             {
                                 Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location1.X, userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
                             }
                             Win32Native.SetParent(userForm.Handle, HWND);
                             userForm.isOpen = true;
                             userForm.Show();
                             //userForm.ShowDialog();
                         }
                         if (userForm.text.Contains("自适应X"))
                         {
                             Win32Native.SetWindowPos(userForm.Handle, 0, num + userForm.location1.X, userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
                         }
                         if (userForm.text.Contains("自适应Y"))
                         {
                             Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location1.X, num2 + userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
                         }
                     }
                     else if (userForm.isOpen)
                     {
                         userForm.isOpen = false;
                         userForm.Hide();
                     }
                 }
             }
             catch
             {
             }
         }
     }
 }
Пример #2
0
 private void SetOtherParnetForm(UserForm userForm, IntPtr HWND)
 {
     if (HWND == IntPtr.Zero)
     {
         userForm.isOpen = false;
         userForm.Hide();
     }
     else
     {
         Win32Native.RECT lpRect = new Win32Native.RECT();
         Win32Native.GetWindowRect(HWND, ref lpRect);
         int num  = lpRect.Right - lpRect.Left;
         int num2 = lpRect.Bottom - lpRect.Top;
         if ((ComHelp.GetPixelColor(userForm.hideLocation1, HWND).ToString() == userForm.hideColor1) || (userForm.hideColor1 == "0"))
         {
             if (!userForm.isOpen)
             {
                 if (!userForm.text.Contains("自适应"))
                 {
                     Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location1.X, userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
                 }
                 Win32Native.SetParent(userForm.Handle, HWND);
                 userForm.isOpen = true;
                 userForm.Show();
             }
             if (userForm.text.Contains("自适应X"))
             {
                 Win32Native.SetWindowPos(userForm.Handle, 0, num + userForm.location1.X, userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
             }
             if (userForm.text.Contains("自适应Y"))
             {
                 Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location1.X, num2 + userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
             }
         }
         else if (userForm.isOpen)
         {
             userForm.isOpen = false;
             userForm.Hide();
         }
     }
 }
Пример #3
0
        private void SetLoLForm(UserForm userForm, IntPtr HWND)
        {
            if (!UrlManage.lolBlock)
            {
                if (HWND == IntPtr.Zero)
                {
                    userForm.isOpen = false;
                    userForm.Hide();
                }
                else
                {
                    Win32Native.RECT lpRect = new Win32Native.RECT();
                    Win32Native.GetWindowRect(HWND, ref lpRect);
                    switch ((lpRect.Right - lpRect.Left))
                    {
                    case 0x400:
                        if ((ComHelp.GetPixelColor(userForm.hideLocation1, HWND).ToString() != userForm.hideColor1) && (userForm.hideColor1 != "0"))
                        {
                            if (!userForm.isOpen)
                            {
                                break;
                            }
                            userForm.isOpen = false;
                            userForm.Hide();
                            return;
                        }
                        Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location1.X, userForm.location1.Y, userForm.size1.Width, userForm.size1.Height, 0);
                        Win32Native.SetParent(userForm.Handle, HWND);
                        userForm.isOpen = true;
                        userForm.Show();
                        return;

                    case 0x500:
                        ComHelp.GetPixelColor(userForm.hideLocation2, HWND).ToString();
                        if (ComHelp.GetPixelColor(userForm.hideLocation2, HWND).ToString() == userForm.hideColor2)
                        {
                            if (!userForm.isOpen)
                            {
                                Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location2.X, userForm.location2.Y, userForm.size2.Width, userForm.size2.Height, 0);
                                Win32Native.SetParent(userForm.Handle, HWND);
                                userForm.isOpen = true;
                                userForm.Show();
                                return;
                            }
                            break;
                        }
                        if (!userForm.isOpen)
                        {
                            break;
                        }
                        userForm.isOpen = false;
                        userForm.Hide();
                        return;

                    case 0x640:
                        if (ComHelp.GetPixelColor(userForm.hideLocation3, HWND).ToString() == userForm.hideColor3)
                        {
                            Win32Native.SetWindowPos(userForm.Handle, 0, userForm.location3.X, userForm.location3.Y, userForm.size3.Width, userForm.size3.Height, 0);
                            Win32Native.SetParent(userForm.Handle, HWND);
                            userForm.isOpen = true;
                            userForm.Show();
                            return;
                        }
                        if (!userForm.isOpen)
                        {
                            break;
                        }
                        userForm.isOpen = false;
                        userForm.Hide();
                        return;

                    default:
                        userForm.isOpen = false;
                        userForm.Hide();
                        break;
                    }
                }
            }
        }