How does Windows keep track of application window layout, and how do I reset it? - windows

I've just pulled a piece of code from the company git repo, and when I ran it for the first time, the layout of the components were awkward. I though the software was not working properly, then realized that the source code shows the window with that initial layout. This is a windows forms application written with C#, and my development machine is Windows 7
I've manually changed the layout through moving stuff around, and killed the debugging session. Now when I start the debugging/execution again, the window appears with the layout I've configured. I did not install this program or anything, but windows remembers the layout for this window, and I can't describe or demonstrate the initial layout to other members of the team. Cleaning the solution, rebuilding etc did not help. I can delete the local repo and do everything from scratch, but this is not a solution, just an annoying walkaround.
where is this information kept, and how do I reset it?
Ps: Searching for the solution through Google is another nightmare, since I can't think of keywords other than "windows layout history " etc...

It is not uncommon to write custom code to persist the layout of windows (position, size) and controls like splitpanels (or grid column size). This is usually done to present the last know layout to the end user. Windows doesn't offer a pre-built solution to this task because unintended consequences could arise (think about changing screen resolution and then restore a window to a now, out of screen position).
I am sure that it is your application that write/persist somewhere the information needed to restore its last 'layout'

Related

Calibre's "Live View" Panel Disappeared: Can't Redisplay It

OS Win 10
Calibre's latest version, as it was very recently downloaded and installed.
Can someone please advise as to how to reopen the Live View Panel?
I had been editing an ePUB file's text, and also adding images. It was an easy process to add images; i.e., by clicking the desired position in the Live View Panel, and then importing a image.
Unfortunately, I do believe that I probably inadvertantly clicked on something or another, which caused the disappearance of the Live View Panel. All the other panels on the editing screen were still visible.
A search of the edit screen for a feature enabling me to view display panel agin was unsuccessful.
I tried clicking other HTML files in the Text panel, hoping it would cause the Live View Panel appear, to no avail.
I closed the entire program, and reopened it several times, with the same results.
I loaded different ePub files, and each time I went into edit mode, the Live View Panel was missing. And, all along, I did try the previously mentioned measures.
I even uninstalled Calibre and reinstalled it, twice! And, I made sure that its installation folders had been deleted upon each uninstallation. But, somehow, upon reinstallation startup, Calibre knew the very "special" folder (i.e., which I had designated in an earlier installation) into which to setup its User-related files and its library. [I thought it was probably due to system registry setting.]
Finally, I again uninstalled Calibre. However, this time, before doing a reinstallation, I restored Windows settings. I used a (restore) point that I had created prior to Calibre's first installation. I had hoped that any Registry settings related to Calibre would surely not survive. Nevertheless, upon a subsequent Calibre reinstallation, the program simply failed to display the "Live View Panel." (Go figure!)
I would certaintly appreciate any feedback.

How to change Notepad++ ugly background color on new unsaved windows

Notepad++ has a uniquely useful feature -- you can open a new tab and paste some text in and it will remember that text forever without saving it to any formal location. I have used it this way for a long time as I do a lot of experimental stuff when working with Hyperledger blockchain code and data.
I also like the style configurator, and particularly the solarized-light theme, which is easy on the eyes.
BUT ... when I create my unsaved tabs (new39, new40, etc...) they get an obnoxious background color that is unpleasant to look at and partially obscures text based on the lighter foreground font I am using. I've been searching for a solution off and on for days, and it is driving me nuts.
So does anyone know how to make it stop treating unsaved data so poorly? It is the one feature that makes me want to just use vscode for everything, despite its lack of the ability to act as a persistent cache for random unsaved data.
** EDIT (March 2019): The first comment on this question helped a bit IIRC but fresh installs seem to behave much better, which makes me think that I had managed over time to confuse the app. But in my opinion the choice now is to simply use VSCode, which has similar properties to NP++ but with a much richer and actively maintained plugin / extension system. So as much as I like NP++, it has aged itself out of my current tool set.
The color of your new window is dependant on the theme you have loaded. You can change these theme colors by going settings->style configurator. My best guess is that the specific attribute is going to be in the Global Styles dialog. It should be easy enough to cycle through those options until the color comes up.
Best of luck.
Ok ... my definitive solution since about mid-2018 is to switch to vscode. The reality a few years after my initial complaint:
vscode implements the feature I was using (persistent unsaved tabs) and runs on all OSs that matter
notepad++ eventually started working again when I reinstalled it, which tells me that its state is corruptible as I experienced
vscode has so many extensions and plugins that it is superior in pretty much every way to notepad++ (Note: my opinion and YMMV), although I do have fond memories of that app
I won't go back and I consider this issue closed.
On the version 8, during the installation process, there's options: check the "theme", you can check all themes. and thereafter, go to "prefereence", find the "Dark Mode", check "enable". That's it, all clear and beautiful.

How to make Solution Explorer return to its previous state after clearing search?

I currently have a VS installation with no extensions to see how that works out. For navigation that means making heavy use of Ctrl+; aka Search Solution Explorer. While the search itself is ok, it has one major drawback for me that makes it a pain to use for me (both with keyboard and mouse):
Solution with two projects, one collapsed, one opened:
Use Ctrl+; and start typing until match found from collapsed project
What I want now is to simply clear the search and return to the previous view. Seems like a pretty standard requirement, no? But there seems to be no such functionality built in. Problem with the current commands that come close (pressing Esc, clicking Back or Home buttons in Solution Explorer Toolbar) is all the same: they have the extremely annoying behaviour that they insist on suddenly uncollapsing the previously collapsed project and track the match found! (Btw the Track Active Item in Solution Explorer option is turned of in the options). This makes no sense from a UX point of view? You select some kind of 'undo' command, the search box clears which is expected, but then suddenly there's an item visible from a previous search:
So if the collapsed project has like 50 items in it, solution explorer is now useless visually since it litters the screen with stuff you don't want to see, and worse you have to manually collapse the project again to return to the previous view.
Is there a way around this? I thought maybe keyboard shortcuts for Back/Home would be different, but the commands do not seem to be registered. I looked into EnvDTE80.DTE2.ToolWindows.SolutionExplorer but it has no properties/methods that have anything to do with this issue. And somewhere in the tree there is a Microsoft.VisualStudio.PlatformUI.SolutionPivotNavigator which is probably the class responsible for this behaviour, but I have no idea how to access it?
Recently updated to VS2013 SP3 and I have the impression there was a change (or I didn't notice this properly earlier, though my question says otherwise): if I use the Back button in the Solution Explorer view it properly takes me back to the previous view without expanding anything that wasn't expanded before. Using Esc or clearing the search box still behave the same which is a pitty, but at least if I remember to use just the back button it's workable.
update Not really an answer but since I started using Edit.NavigateTo (which is basically 'Go to Anything' including symbols/files) bound to a keyboard shortcut I found no reason to use Window.SolutionExplorerSearch anymore.

Visualizing read-only folders

My application displays a folder structure in a tree. The user can browse the contents in these folders, and drag content into the folders.
However, some of these folders are readonly (meaning no content can be dragged into them). I'm looking for a clear way of depicting this to the user, so they are aware which folders they can drag to before actually having to try it, i.e. hover state. Something not too alarming or interrupting (no big red crosses overlayed on top of the folder icons, for instance), preferably a recognized standard.
Specifically, we are talking about an Outlook add-in showing a SharePoint folder tree here, but I'd much rather get the answer from a generic viewpoint. From the top of my head, I simply don't seem to know any applications that visually mark readonly folders.
How about a lock icon in the corner of the folder similar to TFS?
I was trying to think of any applications that I've seen that display the notion of something being read only visually, but not many things came to mind.
One that did is SQL Server. When a database is read only, it is greyed-out in the UI (as well as it explicitly saying read only):
alt text http://img203.imageshack.us/img203/7886/sqlr.jpg
I think this works quite well as you are in effect saying that this node/folder is unavailable for the current action (ie. dragging files to it).
As others have mentioned, a lock icon also works well (I've seen this done in Visual Studio when a file is read only).
I would advocate for a grayed-out icon, but I also notice that in most examples I can find, (read only) is specified textually. Graying out or a lock are both somewhat ambiguous without this. Since there doesn't seem to be a uniform standard, you'll probably get some confused users if you rely solely on an icon to get the point across.

Why does my VB6 IDE loses its buttons and menu items?

I still have to use the VB6 IDE.
Unfortunately every time I start the IDE one of the buttons of the toolbar disappears. Almost always it's the Run button which goes first. Sometimes also items from the menu bar or the context menus are missing.
I have to reset the toolbars almost every time I start the IDE (Which is quite often during a typical work day). Recently I bought an IDE plugin which modifies the menu bar and requires a restart after every reset of the menu bar. (Otherwise it would crash)
I could live with just the resetting, but the restart is really annoying.
Is there something I can do?
To solve this problem:
Unload all add-ins.
Right-click on a toolbar and select the Customize... menu.
For each toolbar click the Reset... button (6 times in total).
Reload the add-ins.
For me action 3 was enough.
cf. MZTools faq (thanks to Andrea Bonafini), but these steps are originally from MSDN
It sounds like you recently bought a bad add-in. Can you get your money back? Every time I've had problems with disappearing controls in the IDE it has been due to a bad add-in. You can find out which one it is by disabling them, one by one, each time using the IDE for a while, then re-enable it and disable the next one, until the problem stops.
I still use one problematic add-in. It exhibits behavior similar to yours in that it makes the run button disappear. I avoid the problem by only loading the add-in when I need it, use it (it formats code), then I immediately unload it. If you don't use the functionality of the add-in that often, this could be an acceptable workaround.
Yea, i have this same problem with one of the add-in. But if you reset it. Shut the IDE down and open it back up again without doing anything, the IDE shouuld be able to retain the previous clean setup.
It's just guest, but:
Each graphical element on IDE (like button) is kind of resource (i.e. GDI handle).
Maybe your VB app doesn't manage these resources good enough and after sometime VB IDE cannot redraw elements like buttons (run is used often).
Also, maybe some IDE add-in is in conflict with some other add-in/application and breaks something -- I have this problem with Clip-X and MZ-Tools.
I had a similar problem when I was setting up the IDE to use for the first time, though it may not be helpful if you've been using the same IDE for a while. When I first started using the IDE, I would modify the toolbars and then close the IDE. When prompted if I wanted to save the open file I always said No, since the file was just a dummy file I was using to open the IDE with. Turns out the IDE was saving the toolbar preferences with that file, so they never got saved.
Try opening a file, customizing the UI, saving the file, then closing without modifying the code. This was the solution for me.
I've tracked down the problem and as suggested it was an add-in.
The problem went away as soon as I disabled the Visual Basic 6 Resource Editor.
How to restore your VB6 IDE without reinstalling:
Run Regedit
Find the entry for Visual Basic 6.0
Export your settings in case things
go wrong
Delete the 'UI' setting
Run VB and you will have your popup
menus back
The 'Find' button disappeared from my VB6 toolbar forcing me to select the Edit menu to use Find. I had two add-ins enabled: vbCodePrint and ResourceEditor; so I did away with both of them, turned VB6 off and back on, then put both add-ins back in and my button returned.
If you're still using the VB6 IDE, and I do amongst others, then this problem is not likely to have gone away. I use VB6 in Windows 10, and the problem is still there. But it doesn't affect me anymore.
I have had this problem a few years into using VB5 and VB6. Today, if I start VB6 directly, it may work fine the first time, but buttons will go missing the second time -- ALWAYS.
My solution, which I developed from day one:
Do whatever needs to be done to restore all your buttons. Save the Visual Basic 6.0 registry settings to a file, as suggested previously, and only keep the UI entry. Sometimes, you have to exit VB6 for it to post changes to the registry. So if this doesn't work the first time, try exiting before saving the settings.
I use my own program to launch VB6, which automatically copies my VB6 registry backup back into the registry -- by calling "RegEdit.exe /S D:\VB\IDE_Fix.reg" -- before I launch the IDE . This works every single time, and requires no action on my part.
If you read this, that means you are a programmer. You can make this work by yourself.
Mike
Reinstall,clean registry and update with SPacks etc....

Resources