There is a full screen Windows POS Application(Aloha), that contains button, which opens a Windows form. The Form is set to be TopMost=true
, ShowIcon = false
and ShowInTaskbar = false
. Once the button pressed, POS stays open full screen on top of Taskbar with a form above it.
If the form is closed\out of focus, its process exits and everything stays the same. But if button pressed while the form is open, it kills another instances of itself and then Taskbar pops-up on top of POS(once other instances are killed).
KillRunningProcess Function
private void KillRunningProccess()
{
try
{
Process[] proc = System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location));
Process currentProcess = Process.GetCurrentProcess();
if (proc != null)
{
foreach (Process currProc in proc)
{
if (currentProcess.Id != currProc.Id)
{
currProc.Kill();
}
}
}
}
catch
{ }
}
I've tried using different PINVOKE API functions on Shown\GotFocus events, without any success. Hiding the taskbar fully is out of the question.