Help! My app only works maximized

A built-in feature of Windows Forms applications is that the main window remembers its size and position. Normally this is an OK feature. If you had your app sized small and in the bottom left of the screen last time you used it, it opens at the same place next time.

Unfortunately, perhaps because of a bug somewhere in Windows or somewhere in Windows Forms, this can go wrong. What happens is that somehow your app saves negative position coordinates and in effect disappears. The application icon appears on the taskbar, but if you click on it the app still doesn’t appear. The workaround is to right-click the taskbar icon and choose Maximize. Then the app appears full-screen. However, you can’t resize a maximized app, and when you hit “Restore down”, your app disappears again.

One possibility is to figure out where the app writes its old position. Somewhere in the registry, or in an XML config file somewhere? You tell me. So here’s another workaround. Display the app normally, so you can’t see it but it isn’t actually minimized. At this point, the focus is on the app. Hit Alt+Spacebar to display the window menu. Because of some quirk in Windows, this seems to appear on the visible screen, even if the rest of the app does not. Now press M for “Move”, hold the left mouse button down, and drag the app to where you can see it. Sounds strange? Sure, but it worked for me. Thank goodness for keyboard shortcuts.

3 thoughts on “Help! My app only works maximized”

  1. If i’ve providing remote assistance to a user that has multiple monitors i sometimes have to do the same thing

    I was very confused the first time i saw it though!

  2. Remember, Windows 3.1 and the control box at the top left of windows (here The main Window’s control box is a long ‘dash’ while the sub (document) window in an MDI app is a short dash. They correspond to their shortcuts – the long dash refers to the spacebar (ALT+SPACE), the short dash refers to ALT+minus or dash. ALT+dash still works in MDI apps (such as Excel 2007 when the document window is restored).

Comments are closed.