C# 桌面和图标之间的WPF窗口(Windows 8.1)
我使用了CodeProject的精彩文章。 此项目在windows 8.1上运行良好 该示例使用表单。现在我来换一下表格 使用Visualstudio 2015和.net 4.5.2连接到WPF窗口C# 桌面和图标之间的WPF窗口(Windows 8.1),c#,.net,wpf,windows,C#,.net,Wpf,Windows,我使用了CodeProject的精彩文章。 此项目在windows 8.1上运行良好 该示例使用表单。现在我来换一下表格 使用Visualstudio 2015和.net 4.5.2连接到WPF窗口 // The WPF-Window for infos behind the icon public partial class InfoBehindIcon : Window { public InfoBehindIcon() { InitializeCompone
// The WPF-Window for infos behind the icon
public partial class InfoBehindIcon : Window
{
public InfoBehindIcon()
{
InitializeComponent();
// in .xaml: the decoration switched off
}
}
// The MainWindow - class
....
private HInfoBehindIcon.InfoBehindIcon infoBehindIcon = new HInfoBehindIcon.InfoBehindIcon();
public MainWindow()
{
InitializeComponent();
....
iniDesktopHandlerWPF();
... in CodeProject example starting here the Form with
// System.Windows.Forms.Application.Run(InfoBIForm);
... how to start here the WPF-Window behind the Icon?
}
private void iniDesktopHandlerWPF()
{
... Code from CodeProject example
if(dc != IntPtr.Zero)
{
// here I change the Form to WPF-Window
infoBehindIcon.Loaded += infoBehindIcon_EventWPF;
}
}
private void infoBehindIcon_EventWPF(object sender, EventArgs e)
{
infoBehindIcon.Topmost = false;
InfoPanel.HW32.SetParent(new WindowInteropHelper(infoBehindIcon).Handle, workerw);
}
使用表单运行的版本没有问题。
当我尝试更改WPF时,第二个窗口正在启动,但是
它不在桌面和图标之间运行。
有办法解决这个问题吗?
还是使用表单更好?
对不起,我是C的新手,这个问题太简单了。我解决了这个问题
public MainWindow()
{
InitializeComponent();
....
iniDesktopHandlerWPF();
... in CodeProject starting here the Form with
// System.Windows.Forms.Application.Run(InfoBIForm);
... how to start here the WPF-Window behind the Icon?
}
与
现在对我来说很好。我没有看到
public MainWindow()
{
InitializeComponent();
....
iniDesktopHandlerWPF();
... in CodeProject starting here the Form with
// System.Windows.Forms.Application.Run(InfoBIForm);
... how to start here the WPF-Window behind the Icon?
infoBehindIcon.Show();
}