How to se the standalone player Window style on Windows

I need to dynamically switch between bordered borderless window mode at runtime. I’ve tried using P/Invoke on SetWindowLong() but it has no effect. How does one accomplish this?

Note: It’s a Windows-only app.

Thx,
ALF

Based on my testing it now appears almost certain that Unity’s Windows Standalone Player is SUPPRESSING attempts to change the window style at runtime. Thus the ONLY way to change window style is to relaunch your app with " -popupwindow" toggled on the command line. Why have that restriction?

So now the next question would be – how do I make “-popupwindow” the default behavior for my app so that’s what happens when you launch the .exe (rather than having to manually create a special shortcut)?

By the way, if you don’t get responses in the end, you may try to post this in the “Unity Support” forum, where there may be a higher chance for there to be more people with appropriate experience.

I assume you mean between windowed and full screen mode?

In that case set it with

Thanks, I posted there as well.

And nope, I don’t mean between windowed full-screen. I need to always run in windowed mode, but sometimes that window has to have a title bar and other times it cannot have one.