I have a winform application (C#) that I am running on a windows tablet which is running in tablet mode. When I close the application however, the screen goes to the desktop, which in tablet mode is just the taskbar with a blank screen. It's not until you click on the screen that it pulls up the start menu.
This appears to be consistent with any winform applications running in tablet mode for some reason, but regardless I would like to find a way to simply bring up the start menu after closing the application.
I have tried to simulate a mouse click after the application closes with calling (credit to https://www.gamedev.net/topic/321029-how-to-simulate-a-mouse-click-in-c/):
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}
but this does not work. I have tried playing with the taskbar settings to see if it can be fixed through Windows with no luck.
Does anyone know how to simply bring up the start menu after closing a winform application by code or by settings?