Jump to content

[Solved] Can you restore a Window to "Factory Defaults"?


 Share

Recommended Posts

You can do so many things to Windows. Totally manipulate them and change their styles, menu options, etc.

Is there any way to restore a Window to the defaults that were present when the original program opened the Window? i.e. un-do any manipulations that I have done to it?

Edited by CountyIT
Link to comment
Share on other sites

Not without writing the code yourself. When you first open a window, you could gather all the information that you can about its original size, position etc. Store the information for when you wish to restore the window to its original state. In the Index of the help file, type WinGet. Several functions (such as WinGetPos) begin with the same prefix. The opposite is WinSet.

Edit 1

This is not restoring factory settings of course. Factory settings vary according to the program. To restore factory settings for some programs, you may sometimes need to reinstall them, and this method isn't always guaranteed to work. Restoring system settings on windows is something else.

Edit 2

I just came across It could be useful.

Edited by czardas
Link to comment
Share on other sites

You would at least need to get the characteristics of the window when it first opened. Like get its state, minimized,maximized,retored.. position, Style ExStyle etc.. Also you could get the complete path of the exe that owns the window etc..

SDI type programs where you have one main window are pretty easy to deal with. MDI I've avoided since it's a headache. Still I imagine if you get the parent window info that should handle most of it.

If you get the WinAPIEx UDF there are functions to get the path of the process that owns the window, it's command line etc..

So the idea would be to scan all top level windows and make a list of their positions, the path of the program etc...

There are freeware scripts out there to position windows the first time they open once you have set the parameters. You would need to add the list of programs to a set of apps. When launching a set, any that weren't already running you'd start and then position etc..

If you get the logic down the WinAPIEx functions should have most of what you need. Also see AutoIt Snippets Wiki.

Edited by MilesAhead
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...