Classic Shell
http://www.classicshell.net/forum/

VB Application Appears on Incorrect Monitor When Launched
http://www.classicshell.net/forum/viewtopic.php?f=12&t=2306
Page 1 of 1

Author:  LGotkin [ Wed Mar 12, 2014 6:51 pm ]
Post subject:  VB Application Appears on Incorrect Monitor When Launched

I am running Classic Shell 4.0.4 on a Windows 8.1 system. I'm having a problem when running a custom Microsoft Visual Basic .NET application from the Classic Shell start menu. The application is appearing on the wrong monitor (I have a 3 monitor configuration).

My custom VB application has code similar to this
Dim xPosition As Long = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\MyApps\TestProject", "X Position", Nothing)
Dim yPosition As Long = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\MyAppss\TestProject", "Y Position", Nothing)
Me.Location = New Point(xPosition, yPosition)

The VB application basic loads my application window location, stored in the Windows registry, and positions the form it brings up at that location. The application, when closed, updates these registry values with the current form location so it comes up the next time at the previous location. That is, the application remembers it's last location and always comes up at the same place.

Now, I can launch the application with a standard Windows shortcut link without difficulty. It will come up on the correct monitor. However, when I pin this link to the Classic Shell Start Menu and launch it through the Classic Shell start menu it exhibits some strange behavior. It will initially come up properly on the correct monitor. However, it immediately moves to the primary monitor. So, it may come up on the left monitor, disappear, and then reappear on the center monitor (primary Monitor).

Now the interesting thing is that if I go to the standard Windows location when the application link is stored (Users\account\AppData\Roaming\Microsoft\Windows\StartMenu\Programs and just double-click on the link to start the application it works fine. There is only a problem when the link is executed through clicking on it's name in the Classic Start Menu.

I'm assuming that the problem is related to something Classic Shell is doing. Any ideas or thoughts?

Attachments:
ClassicShellUtilityOutput.txt [307 Bytes]
Downloaded 808 times

Author:  Ivo [ Wed Mar 12, 2014 10:10 pm ]
Post subject:  Re: VB Application Appears on Incorrect Monitor When Launche

Classic Shell does not reposition any applications. What is that file ClassicShellUtilityOutput.txt that you have attached?

Author:  LGotkin [ Thu Mar 13, 2014 9:35 am ]
Post subject:  Re: VB Application Appears on Incorrect Monitor When Launche

Sorry, included the wrong file. That file is the Visual Basic code I'm using. The correct file is attached.

I assumed it was due to Classic Shell because only when the program link is executed through the Classic Shell menu does this problem occur. Any other way of launching the application (selecting link from Windows explorer, pinning link to taskbar and running from there, or directly double-clicking on the .exe file) and things work fine.

I'm also running DisplayFusion to manage my multiple monitors. Any known incompatibilities with Classic Shell and that?

Attachments:
ClassicShellUtilityOutput.txt [141.26 KiB]
Downloaded 898 times

Author:  Ivo [ Thu Mar 13, 2014 9:40 am ]
Post subject:  Re: VB Application Appears on Incorrect Monitor When Launche

Ah, yes, Display Fusion indeed tries to reposition windows. I don't know under what circumstances it tries to do it, and when it gets it wrong. Maybe there is an option to disable that behavior. You should contact them.

Author:  LGotkin [ Thu Mar 13, 2014 6:19 pm ]
Post subject:  Re: VB Application Appears on Incorrect Monitor When Launche

I got a note in to DisplayFusion support to check on this.

However, one thing I have noticed subsequent to my original post is that Classic Shell seems to always launch my application on the monitor from which I brought up the Classic Shell start menu. In my original post, I noted that the app always came up on the primary monitor That, apparently, is because I used the Classic Shell start menu that was located on the primary monitor. If I launch my application from another monitor, the app comes up in it's correct location than always always moves to the monitor from which I brought up the Classic Shell start menu. So say I set my app to launch from the primary (center) menu. If I launch my app from the left most monitor, it comes up in the center menu and then eventually ends up displaying on the left monitor. If I launch my app from the right most monitor, it eventually ends up displaying the app on the right monitor.

So just want to confirm this is not a feature of Classic Shell; that is, always instantiating the application on the monitor from which the Classic Shell start menu is used?

Author:  LGotkin [ Thu Mar 13, 2014 6:30 pm ]
Post subject:  Re: VB Application Appears on Incorrect Monitor When Launche  Topic is solved

Sorry, ignore previous post. Problem was in DisplayFusion.

One of the 100's of hidden options 'Launch Start Menu shortcuts on current monitor'. Unchecked it and things are fine now. :D :D :D

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/