0

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

Rohab12321
  • 31
  • 3
  • https://stackoverflow.com/questions/24009579/put-a-semi-transparent-mark-on-screen-windows-xp this might help – EpicKip Feb 14 '23 at 16:07
  • @EpicKip thank you! it wasn't what I was looking for but certainly making things better for my second need! – Rohab12321 Feb 14 '23 at 17:52

1 Answers1

0

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}");
}
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
Rohab12321
  • 31
  • 3