Ejemplo n.º 1
0
        /// <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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
                    }
                }
            }
        }
Ejemplo n.º 5
0
 public static extern int EnumChildWindows(int hwndParent, EnumChildProc lpEnumFunc, ref RECT lParam);
Ejemplo n.º 6
0
 static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Ejemplo n.º 7
0
 public static extern int EnumChildWindows(IntPtr hwndParent, EnumChildProc lpEnumFunc, ref RECT lParam);
Ejemplo n.º 8
0
 public static extern int EnumChildWindows(IntPtr hWnd, EnumChildProc callback, int lParam);
Ejemplo n.º 9
0
 internal static extern bool EnumChildWindows(
     [In, Optional] IntPtr hWndParent,
     [In] EnumChildProc lpEnumFunc,
     [In] IntPtr lParam
     );
Ejemplo n.º 10
0
 public static extern bool EnumChildWindows(
     IntPtr hWnd, EnumChildProc lpEnumFunc, IntPtr lParam);
Ejemplo n.º 11
0
 static Custom_messagebox()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook    = IntPtr.Zero;
 }
Ejemplo n.º 12
0
 public static extern int EnumChildWindows(
     IntPtr hWndParent,                     // handle to parent window
     EnumChildProc lpEnumFunc,              // callback function
     ref RECT lParam                        // application-defined value
     );
Ejemplo n.º 13
0
		public static extern bool EnumChildWindows(int hWnd, EnumChildProc function, int lParam);
Ejemplo n.º 14
0
 private static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc callback, IntPtr lParam);
Ejemplo n.º 15
0
 public static extern bool EnumChildWindows(IntPtr hwndParent, EnumChildProc lpEnumFunc, IntPtr lparam);
Ejemplo n.º 16
0
 public static extern bool EnumChildWindows(IntPtr parentHandle, EnumChildProc callback, IntPtr lParam);
Ejemplo n.º 17
0
 internal static extern bool EnumChildWindows(IntPtr parentHandle, EnumChildProc callback, IntPtr lParam);
Ejemplo n.º 18
0
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Ejemplo n.º 19
0
 public static extern bool EnumThreadWindows(
     int dwThreadId, EnumChildProc lpfn, IntPtr lParam);
Ejemplo n.º 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;
        }
Ejemplo n.º 21
0
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc enumChildProc, int lParam);
Ejemplo n.º 22
0
		static MessageBoxManager()
		{
			hookProc = MessageBoxHookProc;
            enumProc = MessageBoxEnumProc;
			hHook = IntPtr.Zero;
		}
Ejemplo n.º 23
0
 public static extern bool EnumWindows(EnumChildProc lpEnumFunc, int lParam);
Ejemplo n.º 24
0
 static MessageBoxManager()
 {
     hookProc = MessageBoxHookProc;
     enumProc = MessageBoxEnumProc;
     hHook    = IntPtr.Zero;
 }
Ejemplo n.º 25
0
 internal static extern Int32 EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, ref IntPtr lParam);
Ejemplo n.º 26
0
 static ButtonManager()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook    = System.IntPtr.Zero;
 }
Ejemplo n.º 27
0
 internal static extern Int32 EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, ref IntPtr lParam);
Ejemplo n.º 28
0
 private static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Ejemplo n.º 29
0
 static MessageBoxUtils()
 {
     hookProc = new HookProc(MessageBoxHookProc);
     enumProc = new EnumChildProc(MessageBoxEnumProc);
     hHook    = IntPtr.Zero;
 }
Ejemplo n.º 30
0
 public static extern bool EnumChildWindows(int hwndParent, EnumChildProc EnumFunc, IntPtr lParam);
Ejemplo n.º 31
0
 private static extern bool EnumChildWindows(IntPtr parentHwnd, EnumChildProc proc, object lParam);
Ejemplo n.º 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;
 }
Ejemplo n.º 34
0
 private static extern bool EnumChildWindows(EnumChildProc lpEnumFunc, IntPtr lParam);
 public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
Ejemplo n.º 36
0
 public static extern int EnumChildWindows(
     IntPtr hWndParent,         // handle to parent window
     EnumChildProc lpEnumFunc,  // callback function
     ref RECT lParam            // application-defined value
     );
Ejemplo n.º 37
0
 public static extern bool EnumChildWindows(int hwndParent, EnumChildProc EnumFunc, IntPtr lParam);
Ejemplo n.º 38
0
 public static extern bool EnumChildWindows(int hWnd, EnumChildProc function, int lParam);
Ejemplo n.º 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;
            }
        }