Post Reply

Forums -> UltraMon™ -> How to fix Desktop Centred to Monitor Centred
Gary Mugford   2012-11-09 06:39
One of the 'bugs' in the latest LockHunter beta version is that it comes up in Desktop Centre mode (stradling two monitors) instead of Monitor centre mode where the dialog box (or it could be an app window, more further on) comes up in the centre of the monitor it was raised from.

LockHunter is a Windows Menu add-on. You select a file or folder in you file manager, mine happens to be xPlorer2, and choose 'What is Locking this File (or Folder)' and up comes a resizable dialog box (or, as previously mentioned, it COULD be an app window), entitled LockHunter - a free 32 / 64 bit tool for enforced removal of locked files or folders.' And it sits athwart the middle of my desktop ... which combined across two monitors. I then drag it right to see the complete form and hit the Delete It! button and then the Exit button after it has done its business.

I have tried the Position App and Position Dialogs scripts. Don't seem to have any effect. (and yes, I modified the Position App to use the fully pathed exe for LockHunter)

Any suggestions? I HAVE contacted the makers of LockHunter and they acknowledge the issue and have suggested a fix will come in the next update. However, updates a few and sparse for whatever reason and I was irked enough today to see if I could find an alternative solution. I am a registered UltraMon user, not a prospective purchaser.

Thanks in advance for any help.

GM
Christian Studer   2012-11-09 09:28
The problem is that 1) UltraMon treats LockHunter as being on the primary monitor, and 2) because LockHunter runs with elevated privileges it can't be moved by the script.

I have uploaded a new version of the PositionApp script which adds support for centering an application in addition to moving it to a different monitor, to configure this option set CENTER on line 3 to True.

To run the script as administrator, create a new shortcut and set the 'location of item' field to the following:

%WINDIR%\System32\wscript.exe "<script>"

For example: %WINDIR%\System32\wscript.exe "C:\Temp\PositionApp.vbs". Then right-click the newly created shortcut, select Properties from the menu, select the Shortcut tab and click on Advanced, then check the 'Run as administrator' option.

Christian Studer - www.realtimesoft.com
Gary Mugford   2012-11-09 21:02
Christian,

I failed to include the information that I am running Win 7 Pro 64 bit. I downloaded the new version of the Position App (versioning might be an idea if this script gets further development).
I changed the CENTRE constant to True. I initially changed the DEST_MON constant to 0 and the APP_EXE constant to the LockHunter executable, complete with full path.

It didn't work. I killed the wscript process in Process Explorer and then tried various combos of the APP_EXE and DEST_MON constants, reverting back to CMD.EXE on the first and using 0, 1 and 3 on the second. The changes covered all six cases. In all situations, I tried to delete an empty folder by right-clicking the folder and choosing to delete through LockHunter. In each case, the form came up DESKTOP CENTRE rather than centered on the monitor the file manager was on at the time. I then repeated the sequence with the file manager being on the second monitor. In each case, the form always showed up half-on, half-off the originating monitor.

The shortcut target was:
%WINDIR%\System32\wscript.exe "F:\Shez\PositionApp2.vbs"

Thanks in advance for any help.

GM
Christian Studer   2012-11-10 00:46
Do you have the shortcut set to run as administrator?

I tested on 64-bit Windows 7 with LockHunter 2.0.2.103 64-bit and UltraMon 3.2.1. The script was configured as follows:Const APP_EXE = "LockHunter.exe" Const DEST_MON = 0 Const CENTER = True Const ONLY_MOVE_ONCE = True Const RESIZE_TO_FIT = True Const INTERVAL = 3

Christian Studer - www.realtimesoft.com
Gary Mugford   2012-11-10 19:16
Christian,

Thanks for the detailed example. It revealed my issue immediately. I was using the fully-pathed executable name. And if you do that, it doesn't work. Changing it to just LockHunter.exe fixed the issue. I have now put the FixLockHunter shortcut into my startup. And that will get me by the issue until LockHunter's programmers get around to issuing anothre beta or the official 2.0 release. It's too bad the program is SO necessary in Windows 7 x64. But this is one itch that's been scratched. Appreciate you taking the time to work out a solution AND then work me through getting the settings correct.

Thanks in advance for any help.

GM
Forums -> UltraMon™ -> How to fix Desktop Centred to Monitor Centred

Post Reply