I have an app that uses TabTip
. When i want to close it i do this:
public void CloseTabTip()
{
foreach (Process pkiller in Process.GetProcesses())
{
if (pkiller.ProcessName.ToString() == "TabTip")
{
pkiller.Kill();
return;
}
}
}
And it trows an exception: access denied
. Now the strange thing is that it only does that when i close the TabTip
manually. And even stranger than that it only does that when i close it manually using the touch screen. Because when i close it using the mouse it works fine.
The function CloseTabTip
is called when i click a button. If i click the button after manually closing the TabTip with touch screen it trows exception but if i close it using mouse it does not.
Now, i have pondered that it was because of this, however even if i wait some seconds for the process to close it still trows this exception. I am thinking this is a Windows bug since it only give an error when i close TabTib using the touch screen.
Any ideas on how to "fix" this? I know i can use a try catch
statement but that is not the most correct way of doing things.
Running app in WIN10