求教大学:如何将google earth嵌入c#开发的窗体中 看不到你的图片,不过觉得你使用WebBrowser控件指定Url后就可以显示到form上了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public partial class TestForm : Form { public eTerm_Form() { InitializeComponent(); } Process process = null; IntPtr appWin; [DllImport("user32.dll", SetLastError = true)] private static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent); [DllImport("user32.dll", SetLastError = true)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll", SetLastError = true)] private static extern long SetWindowPos(IntPtr hwnd, long hWndInsertAfter, long x, long y, long cx, long cy, long wFlags); [DllImport("user32.dll", SetLastError = true)] private static extern bool MoveWindow(IntPtr hwnd, int x, int y, int cx, int cy, bool repaint); private void eTerm_Form_Resize(object sender, EventArgs e) { if (this.appWin != IntPtr.Zero) MoveWindow(appWin, 0, 0, this.Width, this.Height, true); } private void eTerm_Form_Load(object sender, EventArgs e) { try { process = System.Diagnostics.Process.Start("路径"); process.WaitForInputIdle(); appWin = FindWindow(null, "EXE窗体标题"); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error",MessageBoxButtons.OK, MessageBoxIcon.Error); } SetParent(appWin, this.Handle); MoveWindow(appWin, 0, 0, this.Width, this.Height, true); } private void eTerm_Form_FormClosing(object sender, FormClosingEventArgs e) { try { if (!process.HasExited) process.Kill(); } catch { } } } 如果你使用Google Earth Plugin开发,可以将其放到WebBrowser控件中显示。如果是Google Earth COM API开发,建议你去这里看看http://www.cnblogs.com/wpwen/archive/2009/02/22/1395622.html 问个最基本的正则表达式 这里用过Team Coherence的同学们请举手! 初学C#碰到的问题 怎样获取机器的像素位?16位,24位,32位真彩色... 求xde for.net2003的序列号,google了n多,都无效,郁闷中!! 很急很难的问题。在线等!! 谁能给我详细讲讲快速排序原理 怎么实现低权限的用户不能将文件save到C:\Windows下 自动刷新注册标的修改到程序中 请问:如何用licenses发行自己的控件 购物车原理 GDI+ 的问题
public partial class TestForm : Form
{
public eTerm_Form()
{
InitializeComponent();
} Process process = null;
IntPtr appWin; [DllImport("user32.dll", SetLastError = true)]
private static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", SetLastError = true)]
private static extern long SetWindowPos(IntPtr hwnd, long hWndInsertAfter, long x, long y, long cx, long cy, long wFlags);
[DllImport("user32.dll", SetLastError = true)]
private static extern bool MoveWindow(IntPtr hwnd, int x, int y, int cx, int cy, bool repaint); private void eTerm_Form_Resize(object sender, EventArgs e)
{
if (this.appWin != IntPtr.Zero)
MoveWindow(appWin, 0, 0, this.Width, this.Height, true);
} private void eTerm_Form_Load(object sender, EventArgs e)
{
try
{
process = System.Diagnostics.Process.Start("路径");
process.WaitForInputIdle();
appWin = FindWindow(null, "EXE窗体标题");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error",MessageBoxButtons.OK, MessageBoxIcon.Error);
} SetParent(appWin, this.Handle);
MoveWindow(appWin, 0, 0, this.Width, this.Height, true);
} private void eTerm_Form_FormClosing(object sender, FormClosingEventArgs e)
{
try
{
if (!process.HasExited)
process.Kill();
}
catch
{
}
}
}
如果是Google Earth COM API开发,建议你去这里看看http://www.cnblogs.com/wpwen/archive/2009/02/22/1395622.html