打开IE窗口并最大化显示

1 //API Constant
2 private const int SW_MAXIMIZE = 3;
3
4 [DllImport("user32.dll")]
5 public static extern int ShowWindow(int hwnd, int nCmdShow);
6
7 private void button1_Click(object sender, RoutedEventArgs e)
8 {
9 SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer();
10
11 ie.Visible = true;
12
13 object objFlags = 0;
14 object objTargetFrameName = string.Empty;
15 object objPostData = string.Empty;
16 object objHeaders = string.Empty;
17
18 ie.Navigate("http://www.baidu.com", ref objFlags, ref objTargetFrameName, ref objPostData, ref objHeaders);
19
20 ShowWindow(ie.HWND, SW_MAXIMIZE);
21 }

posted on 2011-07-12 16:31  Ivan Sun  阅读(366)  评论(0编辑  收藏  举报

导航