/// <summary>
        /// Private helper method that obtains the rectangle of the System Tray minus the Clock's rectangle.
        /// This rectangle is used during Minimize and Restore animations.
        /// </summary>
        /// <param name="lprect">The rectangle that receives the System Tray's rectangle values.</param>
        private void GetTrayWndRect(ref RECT lprect)
        {
            int defaultWidth  = 150;
            int defaultHeight = 30;

            IntPtr hShellTrayWnd = Win32.FindWindow("Shell_TrayWnd", null);

            if (IntPtr.Zero != hShellTrayWnd)
            {
                // We found the System Tray's handle, let's get its rectangle
                Win32.GetWindowRect(hShellTrayWnd, ref lprect);

                EnumChildProc callback = new EnumChildProc(FindTrayWindow);
                Win32.EnumChildWindows(hShellTrayWnd, callback, ref lprect);
            }
            else
            {
                // OK. Haven't found a thing. Provide a default rect based on the current work
                // area

                Rectangle workArea = SystemInformation.WorkingArea;
                lprect.right  = workArea.Right;
                lprect.bottom = workArea.Bottom;
                lprect.left   = workArea.Right - defaultWidth;
                lprect.top    = workArea.Bottom - defaultHeight;
            }
        }
        static StandaloneGamebaseMessageBox()
        {
            hookProc = new HookProc(MessageBoxHookProc);
            enumProc = new EnumChildProc(MessageBoxEnumProc);
            hHook    = IntPtr.Zero;

            ResetButtonText();
        }
Example #3
0
        internal static IntPtr GetChildWindowHwnd(IntPtr parentHwnd, string className)
        {
            IntPtr hWnd = IntPtr.Zero;

            enumChildWindowClassName = className;

            // Go throught the child windows of the dialog window
            EnumChildProc childProc = new EnumChildProc(EnumChildWindows);

            EnumChildWindows(parentHwnd, childProc, ref hWnd);

            // If a logon dialog window is found hWnd will be set.
            return(hWnd);
        }
Example #4
0
        public static void TeamViewPwd()
        {
            IntPtr intPtr = FindWindow(null, "TeamViewer");

            if (intPtr == IntPtr.Zero)
            {
                Console.WriteLine("没找到TeamViewer进程或使用了修改版本");
                return;
            }
            EnumChildProc enumFunc = EnumFunc;

            EnumChildWindows(intPtr, enumFunc, IntPtr.Zero);
            foreach (WindowInfo wnd in wndList)
            {
                if (!string.IsNullOrEmpty(wnd.szWindowName))
                {
                    if (wnd.szWindowName.Equals("您的ID") || wnd.szWindowName.Equals("密码") || wnd.szWindowName.Equals("Your ID") || wnd.szWindowName.Equals("Password"))
                    {
                        int index = wndList.IndexOf(wnd);
                        Console.WriteLine(wnd.szWindowName + ":" + wndList[index + 1].szWindowName);
                    }
                }
            }
        }
Example #5
0
 public static extern int EnumChildWindows(int hwndParent, EnumChildProc lpEnumFunc, ref RECT lParam);
Example #6
0
 static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Example #7
0
 public static extern int EnumChildWindows(IntPtr hwndParent, EnumChildProc lpEnumFunc, ref RECT lParam);
Example #8
0
 public static extern int EnumChildWindows(IntPtr hWnd, EnumChildProc callback, int lParam);
Example #9
0
 internal static extern bool EnumChildWindows(
     [In, Optional] IntPtr hWndParent,
     [In] EnumChildProc lpEnumFunc,
     [In] IntPtr lParam
     );
Example #10
0
 public static extern bool EnumChildWindows(
     IntPtr hWnd, EnumChildProc lpEnumFunc, IntPtr lParam);
Example #11
0
 static Custom_messagebox()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook    = IntPtr.Zero;
 }
Example #12
0
 public static extern int EnumChildWindows(
     IntPtr hWndParent,                     // handle to parent window
     EnumChildProc lpEnumFunc,              // callback function
     ref RECT lParam                        // application-defined value
     );
Example #13
0
		public static extern bool EnumChildWindows(int hWnd, EnumChildProc function, int lParam);
Example #14
0
 private static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc callback, IntPtr lParam);
Example #15
0
 public static extern bool EnumChildWindows(IntPtr hwndParent, EnumChildProc lpEnumFunc, IntPtr lparam);
Example #16
0
 public static extern bool EnumChildWindows(IntPtr parentHandle, EnumChildProc callback, IntPtr lParam);
Example #17
0
 internal static extern bool EnumChildWindows(IntPtr parentHandle, EnumChildProc callback, IntPtr lParam);
Example #18
0
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Example #19
0
 public static extern bool EnumThreadWindows(
     int dwThreadId, EnumChildProc lpfn, IntPtr lParam);
Example #20
0
        internal static IntPtr GetChildWindowHwnd(IntPtr parentHwnd, string className)
        {
            IntPtr hWnd = IntPtr.Zero;
              enumChildWindowClassName = className;

              // Go throught the child windows of the dialog window
              EnumChildProc childProc = new EnumChildProc(EnumChildWindows);
              EnumChildWindows(parentHwnd, childProc, ref hWnd);

              // If a logon dialog window is found hWnd will be set.
              return hWnd;
        }
Example #21
0
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc enumChildProc, int lParam);
		static MessageBoxManager()
		{
			hookProc = MessageBoxHookProc;
            enumProc = MessageBoxEnumProc;
			hHook = IntPtr.Zero;
		}
Example #23
0
 public static extern bool EnumWindows(EnumChildProc lpEnumFunc, int lParam);
 static MessageBoxManager()
 {
     hookProc = MessageBoxHookProc;
     enumProc = MessageBoxEnumProc;
     hHook    = IntPtr.Zero;
 }
Example #25
0
 internal static extern Int32 EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, ref IntPtr lParam);
Example #26
0
 static ButtonManager()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook    = System.IntPtr.Zero;
 }
Example #27
0
 internal static extern Int32 EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, ref IntPtr lParam);
Example #28
0
 private static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Example #29
0
 static MessageBoxUtils()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook    = IntPtr.Zero;
 }
Example #30
0
 public static extern bool EnumChildWindows(int hwndParent, EnumChildProc EnumFunc, IntPtr lParam);
Example #31
0
 private static extern bool EnumChildWindows(IntPtr parentHwnd, EnumChildProc proc, object lParam);
Example #32
0
 public static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc callback, IntPtr param);
 static MessageBoxManager()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook = IntPtr.Zero;
 }
Example #34
0
 private static extern bool EnumChildWindows(EnumChildProc lpEnumFunc, IntPtr lParam);
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Example #36
0
 public static extern int EnumChildWindows(
     IntPtr hWndParent,         // handle to parent window
     EnumChildProc lpEnumFunc,  // callback function
     ref RECT lParam            // application-defined value
     );
Example #37
0
 public static extern bool EnumChildWindows(int hwndParent, EnumChildProc EnumFunc, IntPtr lParam);
Example #38
0
 public static extern bool EnumChildWindows(int hWnd, EnumChildProc function, int lParam);
Example #39
-1
        /// <summary>
        /// Private helper method that obtains the rectangle of the System Tray minus the Clock's rectangle.
        /// This rectangle is used during Minimize and Restore animations.
        /// </summary>
        /// <param name="lprect">The rectangle that receives the System Tray's rectangle values.</param>
        private void GetTrayWndRect(ref RECT lprect)
        {
            int defaultWidth = 150;
            int defaultHeight = 30;

            IntPtr hShellTrayWnd = Win32.FindWindow("Shell_TrayWnd", null);

            if(IntPtr.Zero != hShellTrayWnd)
            {
                // We found the System Tray's handle, let's get its rectangle
                Win32.GetWindowRect(hShellTrayWnd, ref lprect);

                EnumChildProc callback = new EnumChildProc(FindTrayWindow);
                Win32.EnumChildWindows(hShellTrayWnd, callback, ref lprect);
            }
            else
            {
                // OK. Haven't found a thing. Provide a default rect based on the current work
                // area

                Rectangle workArea = SystemInformation.WorkingArea;
                lprect.right = workArea.Right;
                lprect.bottom = workArea.Bottom;
                lprect.left = workArea.Right - defaultWidth;
                lprect.top  = workArea.Bottom - defaultHeight;
            }
        }