Windows app in full screen autostart?

Hi everyone, I'm currently facing the following problem and would appreciate any possible solutions. I want the Windows app "Wireless Display," which allows me to use my Windows computer as a Miracast receiver, launch automatically at boot time, and do so in full screen. If I put the app in shell:startup, it does open, but only as a window and not in full screen. For this, there's a full screen button in the app to the left of the close, maximize, and minimize buttons. The app is installed as an optional Windows feature.

Thanks in advance.

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
CompilerGuru
1 year ago

Open the app and make a right click on the title bar. There you select properties and can therefore permanently edit the size of the window.

Erzesel
1 year ago

As easy as you imagine, unfortunately, the number is not.

Usually, developers don't give their GUI applications any command line parameters to the way to do something automated… that would be necessary for such an "action".

Nowadays, no real fullscreen is used anymore. Instead, the programmer provides a function that changes the properties of a window so that it fills the entire screen without a frame. ( in the GUI framework there are corresponding "properties" )

The full-screen button is not a standard switch and was "tinkered" by the app developer to set the necessary parameters internally… but I have no access to it from outside…

In a window-based system, a (fullsreen) window does not make any sense, as a window without operating elements did not even stop in the worst case! Therefore, there is no such standard button and also no normally accessible parameters that could set a lay! …and because errors on the part of a laity could make Windows unusable. (a dead/empty window that covers the screen is a horror)

…that was the explanation for the layman

..and of course you can know with the appropriate and tool also not intended things…

So also to force a (other) window to do something that should not be allowed😣

Here is a small demo in Powershell, which forces the Windows editor (notepad.exe) into a kind of "full image" mode. (can be closed via ALT+F4)

demo.ps1

 #!!!Hier Dein Programmpfad!!! $ProgramToStart = 'c:\windows\notepad.exe' #ab hier die eigentlich Funktionalität (für Programmierer) #define Flags # https://learn.microsoft.com/en-us/windows/win32/winmsg/window-styles [Flags()] enum WindowStyles { WS_BORDER = 0x800000 WS_CAPTION = 0xc00000 WS_CHILD = 0x40000000 WS_CLIPCHILDREN = 0x2000000 WS_CLIPSIBLINGS = 0x4000000 WS_DISABLED = 0x8000000 WS_DLGFRAME = 0x400000 WS_GROUP = 0x20000 WS_HSCROLL = 0x100000 WS_MAXIMIZE = 0x1000000 WS_MAXIMIZEBOX = 0x10000 WS_MINIMIZE = 0x20000000 WS_MINIMIZEBOX = 0x20000 WS_OVERLAPPED = 0x0 WS_POPUP = 0x80000000 WS_THICKFRAME = 0x40000 WS_SYSMENU = 0x80000 WS_TABSTOP = 0x10000 WS_VISIBLE = 0x10000000 WS_VSCROLL = 0x200000 WS_OVERLAPPEDWINDOW = 0 -bor 0xc00000 -bor 0x80000 -bor 0x40000 -bor 0x20000 -bor 0x10000 WS_POPUPWINDOW = 0x80000000 -bor 0x800000 -bor 0x80000 } #WS_OVERLAPPEDWINDOW = 0x00cf0000 (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX) #WS_POPUPWINDOW = 0x80880000 (WS_POPUP | WS_BORDER | WS_SYSMENU) # https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowlonga [Flags()] enum GWL{ GWL_WNDPROC = -4 GWL_HINSTANCE = -6 GWL_HWNDPARENT = -8 GWL_STYLE = -16 GWL_EXSTYLE = -20 GWL_USERDATA = -21 GWL_ID = -12 } # https://learn.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles [Flags()] enum ExtendedWindowStyles { WS_EX_DLGMODALFRAME = 0x0001 WS_EX_NOPARENTNOTIFY = 0x0004 WS_EX_TOPMOST = 0x0008 WS_EX_ACCEPTFILES = 0x0010 WS_EX_TRANSPARENT = 0x0020 WS_EX_MDICHILD = 0x0040 WS_EX_TOOLWINDOW = 0x0080 WS_EX_WINDOWEDGE = 0x0100 WS_EX_CLIENTEDGE = 0x0200 WS_EX_CONTEXTHELP = 0x0400 WS_EX_RIGHT = 0x1000 WS_EX_LEFT = 0x0000 WS_EX_RTLREADING = 0x2000 WS_EX_LTRREADING = 0x0000 WS_EX_LEFTSCROLLBAR = 0x4000 WS_EX_RIGHTSCROLLBAR = 0x0000 WS_EX_CONTROLPARENT = 0x10000 WS_EX_STATICEDGE = 0x20000 WS_EX_APPWINDOW = 0x40000 WS_EX_OVERLAPPEDWINDOW = (0x0100 -bor 0x0200) WS_EX_PALETTEWINDOW = ( 0x100 -bor 0x80 -bor 0x8) WS_EX_LAYERED = 0x00080000 WS_EX_NOINHERITLAYOUT = 0x00100000 WS_EX_LAYOUTRTL = 0x00400000 WS_EX_COMPOSITED = 0x02000000 WS_EX_NOACTIVATE = 0x08000000 } #WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE) #WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST) # https://learn.microsoft.com/de-de/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters [Flags()] enum SWPuFlags { SWP_NoSize = 0x0001 SWP_NoMove = 0x0002 SWP_NoZOrder = 0x0004 SWP_NoRedraw = 0x0008 SWP_NoActive = 0x0010 SWP_FrameChanged = 0x0020 SWP_ShowWindow = 0x0040 SWP_HideWindow = 0x0080 SWP_NoCopyBits = 0x0100 SWP_NoOwnerZOrder = 0x0200 SWP_NoReposition = 0x0200 SWP_NoSendChanging = 0x0400 SWP_DeferErase = 0x2000 SWP_AsyncWindowPos = 0x4000 } #define access to needed systemfunctions $code = @" [DllImport("user32.dll")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); [DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr hWnd,IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); "@ $User32=Add-Type -MemberDefinition $code -Name Win32Util -Passthru #get displayproperties of prior monitor Add-Type -a System.Windows.Forms $Display = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds $ProcessData=Start-Process -FilePath $ProgramToStart -Passthru do{ $Hwnd=$ProcessData.MainWindowHandle}while($Hwnd -eq 0) #wait for Window is drawn #manipulate windowpropeties $CurrendStyle = $User32::GetWindowLong($Hwnd,[GWL]::GWL_STYLE) $BorderElementsOff = -bnot([WindowStyles]::WS_CAPTION -bor [WindowStyles]::WS_THICKFRAME -bor [WindowStyles]::WS_MINIMIZE -bor [WindowStyles]::WS_MAXIMIZE -bor [WindowStyles]::WS_SYSMENU -bor [WindowStyles]::WS_VSCROLL -bor [WindowStyles]::WS_HSCROLL) $BorderlesStyle = $CurrendStyle -band $BorderElementsOff 'no BorderlerElements Flags: 0x{0:X} = {0}'-f $BorderElementsOff #show it for Demo [WindowStyles]$BorderlesStyle #there is not so many over... [void]$User32::SetWindowLong($Hwnd,[GWL]::GWL_STYLE, $BorderlesStyle) [void]$User32::SetWindowPos($Hwnd,0,0,0,0,0,0) #better! all to Zero to force later redraw [void]$User32::SetWindowPos($Hwnd,0,$Display.X,$Display.Y,$Display.Width,$Display.Height,[SWPuFlags]::SWP_FrameChanged) #!!important!! SWP_FRAMECHANGED (0x0020) to recalculate/redraw the Clientarrea at fullsize pause

because this already intervenes quite deeply in the "mechanics of the system I have deliberately played with open cards and defined the whole stuff openly, which can actually be expressed by a pair of numbers.

Of course, this goes shorter and packed in a batch file that can be placed in the autostart.

demo.cmd

 <# : Batch Abschnitt Zeile nicht ändern start "" /min powershell -WindowStyle hidden "iex (gc '%~f0' -Encoding UTF8 -Raw | out-string)" exit /b : Ende Batch #> #!!!Hier Dein Programmpfad!!! $ProgramToStart = 'c:\windows\notepad.exe' $code = @" [DllImport("user32.dll")] public static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); [DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr hWnd,IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); "@ $User32=Add-Type -MemberDefinition $code -Name Win32Util -Passthru Add-Type -a System.Windows.Forms $Display = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds $ProcessData=Start-Process -FilePath $ProgramToStart -Passthru do{ $Hwnd=$ProcessData.MainWindowHandle}while($Hwnd -eq 0) #wait for Window is drawn $CurrendStyle = $User32::GetWindowLong($Hwnd,-16) $BorderlesStyle = $CurrendStyle -band -570163201 [void]$User32::SetWindowLong($Hwnd,-16, $BorderlesStyle) [void]$User32::SetWindowPos($Hwnd,0,0,0,0,0,0) [void]$User32::SetWindowPos($Hwnd,0,$Display.X,$Display.Y,$Display.Width,$Display.Height,0x20)

The only line you need to change in the editor is " $ProgramToStart = '…' .

Your program path comes in and the batch comes (if everything works as desired) into the autostart.

Of course, I can't guarantee that every program accepts such a defensive operation uncomplicatedly. However, you don't need to worry about something that's going to break up. No matter what could happen, no matter what after a restart, the manipulation is unshakable…

(I don't give anything to hurt anyone)