Axel Williot
Axel Williot

Reputation: 505

Setting foreground window with Windows scheduled task

I build a fullscreen GUI application for Windows (using LabVIEW but the language should not matter much) that should start with Windows. I want it to be fullscreen (hiding the Windows taskbar), so I set the window bounds to the screen's resolution.

When I manually launch the exe from explorer, the window hides correctly the taskbar. But when I launch it from a scheduled task at Windows logon, it is behind the taskbar, until I click on the application. Same thing when I run the scheduled task manuallay in the task scheduler.

I tried the Win32 API function SetForegroundWindow but without success. Maybe the conditions are not met but I do not understand why, there is no other visible window.

How could I force the fullscreen of the app when it auto-starts?

If this is impossible from the application itself, an external solution to the application's code might be ok (e.g. some script running with the scheduled task), but I don't see one either.

Upvotes: 0

Views: 1036

Answers (1)

Daniel Rountree
Daniel Rountree

Reputation: 1

I was having the same trouble when I scheduled a full screen application to run at login.

The way I got around this was by creating a mouse click macro and scheduling it at user login with the app (had to set a 10-second delay to allow for the app to load).

It's a bit dodgy, but it got it done for me.

Upvotes: 0

Related Questions