Force Application frame windows to open on the correct monitor |
By default both the ABC and Clarion (Legacy) templates and classes don't save the X and Y coordinates of the application frame window if it is maximized. This causes the appframe to open up on the primary monitor which may or may not be the monitor that it was open on when the appframe was closed. This can easily cause confusion an annoyance when the appframe will not open on the correct monitor. Below are very simple methods that you can use to fix this problem. One involves using our derived ITINIClass in your ABC application instead of the INIClass. The other one involves writing some very simple code in your Clarion (Legacy) application.
ABC
If you have Icetips Utilities build 1.1.2355 or later and you are working with ABC applications you can optionally also add the Utilities to the application and change the INI manager class to use the one provided by the Icetips Utilities. This build (2355) includes new method for the INI class that fixes a problem with the application frame window not being opened on the correct monitor if it was closed maximized.
Go to the Global | Classes section and click on the "General" tab.
Then drop the list down for the INI Manager and select the ITINIClass instead of the INIClass. Your application frame is now fixed and it will always open on the same monitor that it was closed on.
Clarion (Legacy)
For Clarion (Legacy) applications this is a little trickier. You will have to write some code to omit the generated code that closes the window and duplicate it with some additional code.
Note that the saving of the window position and closing of the window is omitted and then duplicated. You then need to save the X and Y positions of the appframe procedure to wherever it is supposed to be saved - in this case an INI file in the application folder. Since Legacy does not allow much flexibility in this regard I'm afraid it will have to be up to you to implement this code, at least for now. For ABC applications