[DllImport("user32.dll", EntryPoint = "FindWindow")]
public static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName
);
[DllImport("user32.dll", EntryPoint = "GetWindow")]
public static extern IntPtr GetWindow(
IntPtr hwnd,
IntPtr wCmd
);[DllImport("user32.dll", EntryPoint = "SetParent")]
public static extern IntPtr SetParent(
IntPtr hWndChild,
IntPtr hWndNewParent
);
const int GW_CHILD = 5;private void mainfrm_Load(object sender, EventArgs e)
{
#region win2000--win2003下嵌入桌面,不支持vista和win7以上系统
IntPtr hDesktop = FindWindow("Progman", null);
hDesktop = GetWindow(hDesktop,(IntPtr) GW_CHILD);
SetParent((IntPtr)this.Handle, hDesktop);
#endregion
}
以上方法只能在win2000 win2003 XP 下实现,在vista和win7下无法实现,个人觉得是因为vista和win7的主题提样式导致的,但是没有这方面的资料。哪位能提供一些?谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货