C # source code. You can use APIs to obtain browser objects across processes, and then perform the next step.
1 using System;
2 using System. Runtime. InteropServices;
3 using mshtml;
4
5 class Win32API {
6 [DllImport ("user32.dll", EntryPoint = "FindWindow")]
7 public static extern IntPtr FindWindow (string lpClassName, string lpWindowName );
8 [DllImport ("user32.dll", EntryPoint = "find1_wex")]
9 public static extern IntPtr find1_wex (IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow );
10 [DllImport ("user32.dll", SetLastError = true, CharSet = CharSet. Auto)]
11 public static extern uint RegisterWindowMessage (string lpString );
12 [DllImport ("oleacc. dll", PreserveSig = false)]
13 [return: financialas (UnmanagedType. Interface)]
14 public static extern object ObjectFromLresult (UIntPtr lResult, [financialas (UnmanagedType. LPStruct)] Guid refiid, IntPtr wParam );
15 [DllImport ("user32.dll", SetLastError = true, CharSet = CharSet. Auto)]
16 public static extern IntPtr SendMessageTimeout (IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam, SendMessageTimeoutFlags fuFlags, uint uTimeout, out UIntPtr lpdwResult );
17
18 public enum SendMessageTimeoutFlags: uint {
19 SMTO_NORMAL =