Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by alfarmer · Jan 06, 2014 at 05:35 PM · sizewindowslocationstyle

Windows Player Behavior

Hello.

I need to customize my window's size, location, and style based on parameters in an .ini file on Windows. So far I've written a "WindowManger.cs" script with hooks into the required Win32 functions (SetWindowLong, SetWindowPos, etc.). The Awake() function reads from the .ini file and sets the window's location, etc.

While size & location seem to be working properly, there's a strange issue with style. The two options are (1) Borderless and (2) With TitleBar, etc. There are multiple ways to force each of those and I've tried them all, and they work -- sort of.

What's happening is that regardless of which window style I set (#1 or #2), my window shows up the opposite of that every other launch. For example, if I set the .ini value to "borderless" and launch my app five times, it will launch differently each time -- borderless, bordered, borderless, bordered, borderless. Same behavior if the .ini value is the opposite.

I've not been able to target the source of this behavior but can only deduce it's something being done by the Unity Player (because my code doesn't change from run to run). Someone mentioned it may be storing window configuration in the Registry, but I'm overriding that after launch so would expect my values to take effect consistently.

Or perhaps it's a timing issue that could be solved by moving my .ini file processing until after some Unity Player initialization state?

Any ideas what's behind this behavior and/or how to get around it?

Thanks, ALF

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image alfarmer · Jan 06, 2014 at 11:16 PM 0
Share

Is there a way to 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 with that command line option)?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by alfarmer · Jan 06, 2014 at 08:53 PM

Well that's interesting. No code changes and now the behavior is I can't get rid of the window decorations. No matter what I try the window has a titlebar, border, sys_menu, etc.

Based on my testing it 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.

Seems like a needless restriction...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity does not change the size of the window 0 Answers

Font size and style overrides are only supported for dynamic fonts 2 Answers

How to resize camera view port without changing what is on screen 1 Answer

Is there a way to get the size of text? 1 Answer

Build size problem, I couldnt reduce it 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges