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