I have a WPF application. When it starts, I need to check if the instance is running. If so, then I will βshowβ the executable instance using PInvoke:
SendNotifyMessage(proc.MainWindowHandle, ShowYourself, IntPtr.Zero, IntPtr.Zero);
where proc is another instance executing
the problem is that proc hiding in the system tray. MainWindowHandle is 0. I did a lot of searching, but no luck getting MainWindowHandle .
Does anyone know how?
thanks
source share