Force WinForm Application on top Windows 10 Tablet Mode

89 Views Asked by At

Is there any way to force a simple winforms application to run on top the tablet mode main screen ?

It can be Vb script or anything, the idea is to show a count down application on top the main screen to announce the upcoming "force shutdown" of that tablet.

screnshot

1

There are 1 best solutions below

0
Rohab12321 On BEST ANSWER

Whoever face the same problem, there is a "hack" I was reading about.

When on tablet mode, your application will be start as "minimized" in the taskbar, therefore you will not be able to see it, just a "Home screen".

What worked for me was adding to my Form_Load event the SendKey Function, with alt + tab. That, mixing with @EpicKip answer just above, will always send the app (even when on start screen of "Tablet Mode" and the app on "Minimized").

private void form1_Load(object sender, EventArgs e)
{
  //SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS);

  Thread.Sleep(1000);
  SendKeys.SendWait("%{TAB}");
}