C# 窗体如何嵌入到win7桌面中,置于桌面图标之下?
下面这个代码不管用:publicpartialclassForm1:Form{[DllImport("user32.dll",CharSet=CharSet.Auto)]...
下面这个代码不管用:
public partial class Form1 : Form
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr FindWindow([MarshalAs (UnmanagedType.LPTStr)] string lpClassName, [MarshalAs(UnmanagedType.LPTStr)] string lpWindowName);
[DllImport("user32")]
private static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string lpsz1, string lpsz2);
[DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
IntPtr pWnd = FindWindow("Progman", null);
pWnd = FindWindowEx(pWnd, IntPtr.Zero, "SHELLDLL_DefVIew", null);
pWnd = FindWindowEx(pWnd, IntPtr.Zero, "SysListView32", null);
//IntPtr tWnd = new System.Windows.Interop.WindowInteropHelper(this).Handle;
SetParent(this.Handle, pWnd);
}
}
请问在Win7中如何将C#窗体嵌入桌面,置于桌面图标下面啊?
帮帮偶啊~~! 展开
public partial class Form1 : Form
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr FindWindow([MarshalAs (UnmanagedType.LPTStr)] string lpClassName, [MarshalAs(UnmanagedType.LPTStr)] string lpWindowName);
[DllImport("user32")]
private static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string lpsz1, string lpsz2);
[DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
IntPtr pWnd = FindWindow("Progman", null);
pWnd = FindWindowEx(pWnd, IntPtr.Zero, "SHELLDLL_DefVIew", null);
pWnd = FindWindowEx(pWnd, IntPtr.Zero, "SysListView32", null);
//IntPtr tWnd = new System.Windows.Interop.WindowInteropHelper(this).Handle;
SetParent(this.Handle, pWnd);
}
}
请问在Win7中如何将C#窗体嵌入桌面,置于桌面图标下面啊?
帮帮偶啊~~! 展开
2013-08-27
展开全部
我有联系程序,如果你感兴趣就留个邮箱,发给你看看。
这需要调用系统API,如果你是初学者,这很难,但慢慢你就会发现,只是调用现成函数问题。
这需要调用系统API,如果你是初学者,这很难,但慢慢你就会发现,只是调用现成函数问题。
追问
哈哈,没事没事,再难的程序也能看懂些;
e-mail:sdfwegewrger#126.com ;可恶Bai度不让发邮*箱,把#换成@!
先谢了~~
追答
我都把你给忘了,做一张假的屏幕,把桌面图标位置都透出来就好了。这有点假就是
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询