/// <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(); }
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); }
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); } } } }
public static extern int EnumChildWindows(int hwndParent, EnumChildProc lpEnumFunc, ref RECT lParam);
static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
public static extern int EnumChildWindows(IntPtr hwndParent, EnumChildProc lpEnumFunc, ref RECT lParam);
public static extern int EnumChildWindows(IntPtr hWnd, EnumChildProc callback, int lParam);
internal static extern bool EnumChildWindows( [In, Optional] IntPtr hWndParent, [In] EnumChildProc lpEnumFunc, [In] IntPtr lParam );
public static extern bool EnumChildWindows( IntPtr hWnd, EnumChildProc lpEnumFunc, IntPtr lParam);
static Custom_messagebox() { hookProc = new HookProc(MessageBoxHookProc); enumProc = new EnumChildProc(MessageBoxEnumProc); hHook = IntPtr.Zero; }
public static extern int EnumChildWindows( IntPtr hWndParent, // handle to parent window EnumChildProc lpEnumFunc, // callback function ref RECT lParam // application-defined value );
public static extern bool EnumChildWindows(int hWnd, EnumChildProc function, int lParam);
private static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc callback, IntPtr lParam);
public static extern bool EnumChildWindows(IntPtr hwndParent, EnumChildProc lpEnumFunc, IntPtr lparam);
public static extern bool EnumChildWindows(IntPtr parentHandle, EnumChildProc callback, IntPtr lParam);
internal static extern bool EnumChildWindows(IntPtr parentHandle, EnumChildProc callback, IntPtr lParam);
public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
public static extern bool EnumThreadWindows( int dwThreadId, EnumChildProc lpfn, IntPtr lParam);
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; }
public static extern int EnumChildWindows(IntPtr hWndParent, EnumChildProc enumChildProc, int lParam);
static MessageBoxManager() { hookProc = MessageBoxHookProc; enumProc = MessageBoxEnumProc; hHook = IntPtr.Zero; }
public static extern bool EnumWindows(EnumChildProc lpEnumFunc, int lParam);
internal static extern Int32 EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, ref IntPtr lParam);
static ButtonManager() { hookProc = new HookProc(MessageBoxHookProc); enumProc = new EnumChildProc(MessageBoxEnumProc); hHook = System.IntPtr.Zero; }
private static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc lpEnumFunc, IntPtr lParam);
static MessageBoxUtils() { hookProc = new HookProc(MessageBoxHookProc); enumProc = new EnumChildProc(MessageBoxEnumProc); hHook = IntPtr.Zero; }
public static extern bool EnumChildWindows(int hwndParent, EnumChildProc EnumFunc, IntPtr lParam);
private static extern bool EnumChildWindows(IntPtr parentHwnd, EnumChildProc proc, object lParam);
public static extern bool EnumChildWindows(IntPtr hWndParent, EnumChildProc callback, IntPtr param);
static MessageBoxManager() { hookProc = new HookProc(MessageBoxHookProc); enumProc = new EnumChildProc(MessageBoxEnumProc); hHook = IntPtr.Zero; }
private static extern bool EnumChildWindows(EnumChildProc lpEnumFunc, IntPtr lParam);
/// <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; } }