2

When I start a desktop application on Windows 8 tablet, Explorer starts it with SW_SHOWMAXIMIZED. For example, if you start Notepad from command prompt, it opens in normal window size, but if you do that from Explorer, maximized window is opened. I have seen this Explorer behavior only on tablet PC and I guess Explorer is doing that on purpose.

I understand that it may be useful for many application programs, but I want my program to start with normal size unless user explicitly requests Explorer to open it maximized.

Is there a way to stop this for my application? I'm hoping that there is an API or manifest to do that, but I couldn't find any information at MSDN.

Thanks in advance.

Susumu Arai
  • 309
  • 1
  • 2
  • 7
  • I assume you realize that your program is free to ignore SW_SHOWMAXIMIZED? – Harry Johnston Dec 06 '14 at 08:27
  • Yes. But, I also want to start my program with maximized window If user wants to do so (by setting shortcut option, etc). – Susumu Arai Dec 07 '14 at 04:58
  • In this thread, someone seems to have the same issue. It might be, however weird it may sound, a driver issue: http://www.msfn.org/board/topic/173349-windows-81-maximize/?p=1093262 – ShinNoNoir Apr 18 '15 at 20:50
  • And here's a similar question asked on Stack Overflow: http://stackoverflow.com/questions/28930582/how-to-stop-explorer-starting-my-application-maximized -- One of the comments is by Raymond Chen and he gives a workaround. – ShinNoNoir Apr 18 '15 at 20:56

1 Answers1

0

See if this helps:

  1. Open any program that is affected with this issue. Note: Make sure that it is the only open window of that program. eg. You can only do this if you have one window of command prompt open.
  2. Adjust the window size and position to your liking.
  3. While holding Ctrl on your keyboard, close the window by clicking (or touching, for tablet) the X in the top-right corner of the window to close it.
  4. Re-open the program. Your window should now open in the way you set it in step 3.
LyricWulf
  • 308
  • 3
  • 9
  • Sorry, I hit enter key by mistake.... As I wrote in my original question, Explorer starts the program SW_SHOWMAXIMIZED on tablet PC even after doing what you suggested. It only works on non-tablet PC, where Explorer starts application with SW_SHOWNORMAL. – Susumu Arai Dec 07 '14 at 04:54
  • What other programs have this issue? All desktop programs? Only programs when launched from the desktop? Only Microsoft programs? Does cmd open maximized? – LyricWulf Dec 07 '14 at 06:48
  • See if manually running the .exe from C:\Program Files\[Program] will open normally from Explorer (not in cmd). – LyricWulf Dec 07 '14 at 06:49
  • Done that, no difference. Are you actually seeing different result? – Susumu Arai Dec 08 '14 at 17:48
  • Just to be clear, this is not a question about each program remembering its window size. It's about Explorer always starting desktop application with SW_SHOWMAXIMIZED on Windows 8 tablet. I'm not sure if it happens with all Windows 8 tablets, but I'm seeing this with HP Stream 7. As I wrote in my original question, it doesn't happen when the program is started from command prompt. So, I'm pretty sure that it's Explorer's behavior. – Susumu Arai Dec 08 '14 at 18:22
  • Yes, I was thinking that maybe your desktop shortcuts had an additional flag for SW_SHOWMAXIMIZED, but I'm looking into this issue. We know it is obviously something with Explorer, of course. – LyricWulf Dec 09 '14 at 00:54