using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace MultitabBrowser { public partial class Form1 : Form { [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)] public static extern void mouse_event(uint dwFlags, int dx, int dy, uint cButtons, uint dwExtraInfo); private const int MOUSEEVENTF_MOVE = 0x01; private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04; private const int MOUSEEVENTF_RIGHTDOWN = 0x08; private const int MOUSEEVENTF_RIGHTUP = 0x10; public Form1() { InitializeComponent(); } public void DoMouseClick(int iX, int iY) { //Call the imported function with the cursor's current position mouse_event(MOUSEEVENTF_MOVE, -10000, -10000, 0, 0); mouse_event(MOUSEEVENTF_MOVE, iX, iY, 0, 0); mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, iX, iY, 0, 0); } private void CheckKeyDown(PreviewKeyDownEventArgs e, int iViewIdx) { Console.WriteLine(iViewIdx); if((e.Modifiers & Keys.Control) == Keys.Control) { if(e.KeyCode == Keys.D1) webBrowser1.Refresh(); else if(e.KeyCode == Keys.D2) webBrowser2.Refresh(); else if(e.KeyCode == Keys.D3) webBrowser3.Refresh(); else if(e.KeyCode == Keys.D4) webBrowser4.Refresh(); System.Windows.Forms.WebBrowser[] aWebView = { webBrowser1, webBrowser2, webBrowser3, webBrowser4 }; if(e.KeyCode == Keys.U || e.KeyCode == Keys.H) iViewIdx = 0; else if(e.KeyCode == Keys.I || e.KeyCode == Keys.J) iViewIdx = 1; else if(e.KeyCode == Keys.O || e.KeyCode == Keys.K) iViewIdx = 2; else if(e.KeyCode == Keys.P || e.KeyCode == Keys.L) iViewIdx = 3; int iBaseX = this.Left; int iBaseY = this.Top; for(int i=0; i