Welcome Guest.   Make a donation to an author on the site October 21, 2014, 06:59:49 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: Move dialog boxes to the center of the (correct) monitor  (Read 7535 times)
David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« on: April 06, 2011, 04:43:49 AM »

... or where the parent application is (make that an option).

This would be great for multi-monitor-systems where dialog boxes for some reason can always pop up on the wrong monitor.

DialogMove does a good job in this sense, already (see discussion here) -- however DialogMove can't be restricted in order to not additionaly move all dialogs under the mouse pointer (because the latter actually is what it is SUPPOSED to do).

Therefore it would be great to have a little tool that could move dialogs similar as DialogMove does, but ONLY when dialogs pop up on the wrong monitor (or when they come up on the correct monitor, but not centered).

Recapitulating: The IDEA is, popups and dialogs should only be moved (to the center of the monitor where the mouse pointer is OR where the parent application is, possibly make that an option) when they are either a) on the wrong monitor or b) on the correct monitor, but not centered (on the monitor).

Thanks HEAPS already,
Cheers David.P

« Last Edit: April 07, 2011, 01:03:57 AM by David.P; Reason: defined \"centered\" » Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: April 06, 2011, 06:50:19 PM »

Just to clarify, by "centered" you mean at the middle of the screen, not "centered" on the mouse like DialogMove does, right?
Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #2 on: April 07, 2011, 12:54:59 AM »

Exactly jgpaiva (have edited my top post respectively in order to clarifiy).

Regards David
« Last Edit: April 07, 2011, 01:04:19 AM by David.P » Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: April 07, 2011, 06:06:13 AM »

I have just modified DialogMove's code to do what you asked.
I'm not 100% sure this will work, as I can't test it right now since I don't have a Windows machine with 2 screens.
You will need to install autohotkey to run it.

At least this can be a good starting point for anyone who might want to pick this up.

* DialogMove_modified.ahk (15.08 KB - downloaded 119 times.)
« Last Edit: April 14, 2011, 03:34:12 AM by jgpaiva; Reason: updated file with changes posted in the thread » Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #4 on: April 07, 2011, 07:19:34 AM »

Great, jgpaiva -- thank you very much!

So far, the modified version seems to work almost perfect.

There's only one "phenomenon": If the mouse pointer already is in the very area where a window WILL popup, then that window will not get centered (this happens on the same monitor, therefore should be present with single monitor systems also).

Only if the mouse pointer is moved outside this area (which the popup/dialog will be covering afterwards) BEFORE the window actually comes up, then the window will get centered.

Isn't that a little strange...?  embarassed
« Last Edit: April 07, 2011, 07:20:52 AM by David.P; Reason: typo » Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: April 07, 2011, 08:40:51 AM »

Actually, that was on purpose smiley It doesn't move a dialog if it is already below the mouse.
If you wish to change it, just delete the following lines (right after "move window"):

[copy or print]
 CoordMode,Mouse,Relative
   MouseGetPos, MouseX, MouseY, MouseWin,
   If (MouseX > - WinBorder)
     If (MouseX < WinWidth + WinBorder)
       If (MouseY > - WinBorder)
         If (MouseY < WinHeight + WinBorder)
           return  

I'm not sure if this won't create other unexpected effects, though smiley
Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #6 on: April 07, 2011, 09:03:15 AM »

Actually, that was on purpose smiley

Grin I see!

Works perfect! Now FINALLY after all these years of shoving those eBay "Enlarge Image" Popups in the middle of the screen manually, they do so automatically! Thmbsup

(Of course, the same applies to lots of other popup windows and dialogs).

Thanks -- I'll donate!

Cheers David
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: April 07, 2011, 11:17:29 AM »

 cheesy Glad to know it works for you!
Logged

AndyM
Charter Member
***
Posts: 616


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #8 on: April 07, 2011, 11:44:57 AM »

Of course, the same applies to lots of other popup windows and dialogs
Take a look at the Include and Exclude subroutines in the original script.

If you wanted to include or exclude certain dialog boxes from going to the center of the proper screen, you could probably do that.  (I don't have a dual monitor setup so I'm not going to look into the details.)
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #9 on: April 07, 2011, 12:27:29 PM »

Of course, the same applies to lots of other popup windows and dialogs
Take a look at the Include and Exclude subroutines in the original script.

If you wanted to include or exclude certain dialog boxes from going to the center of the proper screen, you could probably do that.  (I don't have a dual monitor setup so I'm not going to look into the details.)
Actually, I think David is glad that this modification of DialogMove works for all windows Wink
Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #10 on: April 07, 2011, 12:32:03 PM »

Yep  Cool
Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #11 on: April 13, 2011, 03:27:09 AM »

Still very happy with this variation of DialogMove.

Only one question: is there a (simple) way to prevent movement of things that are no "proper" windows (e.g. with title bars)?

At the moment, DialogMove even moves floating (tray) notifications, context menus and even the start menu (to the center of the screen).

I'd however really only need "regular" popup windows and program dialogs to be moved. Everything else should not be touched.

Is there a way to do that, i.e. to exclude things that have no title bar from being touched by DialogMove?

Thanks heaps
David
Logged

AndyM
Charter Member
***
Posts: 616


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: April 13, 2011, 07:01:13 AM »

Get a copy of Window Spy from the Autohotkey site.  It will give you the ahk_class of any window you hover the mouse over, including the kind of not "proper" windows you are talking about.

You can then use the ahk_class name in the include or exclude list of DialogMove.
Logged
David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #13 on: April 13, 2011, 07:10:30 AM »

I know -- but I'd rather not having to maintain an ever growing black list... Instead, I'd very much like to tell the program: "ONLY touch things that have a title bar".

Can that be done?
Logged

AndyM
Charter Member
***
Posts: 616


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #14 on: April 13, 2011, 08:04:55 AM »

dunno, but you can get clever with the two size filters...
Logged
MilesAhead
Member
**
Posts: 4,931



View Profile WWW Give some DonationCredits to this forum member
« Reply #15 on: April 13, 2011, 05:15:29 PM »

I know -- but I'd rather not having to maintain an ever growing black list... Instead, I'd very much like to tell the program: "ONLY touch things that have a title bar".

Can that be done?

You can experiment with the spy. I just messed with it a bit.  Seems like non title bar windows should return blank for WinGetTitle function.  If WinGetTitle on the active window returns blank, it's not one you want etc..

Although the spy did pick up the title from this window:

http://www.favessoft.com/reopen.html

you can see it says "ReOpen" in what would be the caption bar, even though it's not the ordinary popup window.
« Last Edit: April 13, 2011, 05:17:19 PM by MilesAhead » Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #16 on: April 14, 2011, 01:17:26 AM »

Yeah, but how can I insert "Blank" or "nil" into DialogMove's preferences then?
Logged

MilesAhead
Member
**
Posts: 4,931



View Profile WWW Give some DonationCredits to this forum member
« Reply #17 on: April 14, 2011, 01:42:37 AM »

Yeah, but how can I insert "Blank" or "nil" into DialogMove's preferences then?

I haven't looked at Dialog Move code since I don't have multiple monitors. If I can't try it out myself it's kind of a dead end.
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
nudone
Cody's Creator
Columnist
***
Posts: 4,116



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: April 14, 2011, 02:18:49 AM »

Yeah, but how can I insert "Blank" or "nil" into DialogMove's preferences then?

I haven't looked at Dialog Move code since I don't have multiple monitors. If I can't try it out myself it's kind of a dead end.

Just a note: dialogmove works on any monitor, single or multi setup. The original purpose was to work on a single large monitor; it was then tweaked for multi screens.

I even find it useful on a tiny netbook screen.
Logged
David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #19 on: April 14, 2011, 02:46:01 AM »

It's the same on single monitors: for example the start menu gets moved to the center in my case (admittedly at least partially caused because I wanted DialogMove to center windows even when the mouse is already over them, see further up the thread).

I guess that probably around these parts in DialogMove something (?) would have to be changed in order not to detect windows without title bars:

[copy or print]
   WinGetTitle,WinTitle,ahk_id %ActiveWindow%
   WinClass=ahk_class%A_space%%Winclass%
   If NotDetectableWindow(WinTitle,WinClass)
     return
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: April 14, 2011, 03:17:02 AM »

Hi David!

Jut modify that code to:

[copy or print]
   WinGetTitle,WinTitle,ahk_id %ActiveWindow%
   WinClass=ahk_class%A_space%%Winclass%
   if WinTitle=""
      return
   If NotDetectableWindow(WinTitle,WinClass)
     return
Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #21 on: April 14, 2011, 03:30:17 AM »

"Grea-heat", jgpaiva as usual! Afterwards, things can look quite simple sometimes   embarassed

Thanks very much,
Cheers David
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #22 on: April 14, 2011, 03:34:46 AM »

"Grea-heat", jgpaiva as usual! Afterwards, things can look quite simple sometimes   embarassed

Thanks very much,
Cheers David
Great! I have updated the modified dialogMove I posted in this thread with the changes Wink
Logged

David.P
Supporting Member
**
Posts: 145


Ergonomics Junkie

View Profile Give some DonationCredits to this forum member
« Reply #23 on: April 14, 2011, 03:36:33 AM »

Thanks!
Logged

MilesAhead
Member
**
Posts: 4,931



View Profile WWW Give some DonationCredits to this forum member
« Reply #24 on: April 14, 2011, 08:54:33 PM »

Yeah, but how can I insert "Blank" or "nil" into DialogMove's preferences then?

I haven't looked at Dialog Move code since I don't have multiple monitors. If I can't try it out myself it's kind of a dead end.

Just a note: dialogmove works on any monitor, single or multi setup. The original purpose was to work on a single large monitor; it was then tweaked for multi screens.

I even find it useful on a tiny netbook screen.

I believe.  All I'm saying is the OP wants a function for multiple monitors and it seems futile to get into it if I don't have a MM set up.  Simulation ain't always the same as running 2 real physical devices. If I can't test it myself I don't want to code it.  Unless I was somebody's employee then I guess I'd haveta'. smiley

Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.044s | Server load: 0.12 ]