I have used the brilliant article from CodeProject. http://www.codeproject.com/Articles/856020/Draw-Behind-Desktop-Icons-in-Windows This project running fine for me on windows 8.1
The example using Forms. Now I'll change the Form to WPF-Window (using Visualstudio 2015 with .net 4.5.2).
// 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);
}
The version using Forms running without problems. When I am trying this with changes to WPF the second window is starting but it is not running between desktop and icons. Is there a way to solve this? Or it is better way to use furthermore the Form? (sorry I am a newbee in C#)
The problem was too simple and easy. I solved this
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?
}
with
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();
}
Now it works fine for me. I did not see it...... ;)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.