topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 4:55 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: how to get to a dialog window that won't come into focus by using the keyboard?  (Read 13897 times)

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
i'm using filezilla - which brings up a dialog asking me if i want to upload edited files that it is monitoring...

the problem is that this dialog hardly ever has focus when it appears - and i can't alt+tab to bring it into focus. okay, i can use the mouse to click the buttons on it but it's annoying as it would be about a million times more convenient to keep my hands on the keyboard.

any idea how to bring a dialog window into focus that doesn't respond to alt+tab?

thanks.

(is this vista being dumb or just me.)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
maybe this tool by Skrommel could help - ShowDialogsToo?


nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
ooh, that looks promising.

i shall test it out now.

thanks, lanux128.

(i'll say what happens later.)

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
oh well. it nearly worked. it does display the dialog in the taskbar - BUT there still doesn't appear to be a way of using the keyboard to get to it.

alt+tab, ctrl+tab and using vistaswitchers ctrl+alt+tab doesn't work.

and yet, the dialog will come in to focus if you click on and use other programs that are running.

maybe it's a bug in filezilla.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
maybe AHK can help here? get the dialog's title/class with AU3 Spy then use something like WinActivate to bring it to focus.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
yes, i think that might be the way to go. i'll see if i can figure something out - but i'll probably have to post a coding snack request.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
here, you go.. just substitute your own dialog box's id in the WindowsID section.

#Persistent
#SingleInstance force
#NoEnv
SetTitleMatchMode 2 ; partial title match

WindowsID=Open ahk_class #32770  ; windows title and ahk class goes here. either will do..

SetTimer, ActivateMe, 500  ;increase or decrease timer
Return

ActivateMe:
;auto-activate
IfWinExist %WindowsID%
  {
  WinActivate
  ;do something here like press the ok button
  ;ControlClick, OK
  ;sleep for a while - good for cpu cycle
  Sleep, 3000
  }
Return

Source: http://www.autohotke...mands/IfWinExist.htm

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
excellent. i think this is working correctly.

thanks very much for that, lanux128. i'm sure it would have taken me a few hours to figure that out.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
aaaaargh. i can't believe it. it doesn't work. seems to have been just the stupid nature of how it comes into focus of it's own accord sometimes.

i'm blaming FileZilla on this. it's making itself unfocussed somehow. the swine.

edit:
i think the little ahk script is working - something just upsets it sometimes.
« Last Edit: May 13, 2010, 12:28 PM by nudone »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
i use filezilla too. where is this option? maybe i can try to get it to appear on my PC.

Edit:
in this thread here. this guy has the opposite problem, it seems but the reply is quite enlightening.

FileZilla only sets the focus window of its own process to the file exists dialog, it does not mark itself as the active program. Further, it requests user attention through some well-documented API. Either GTK+ or your window manager misinterprets this and makes the program active.
-site admin


Edit2: maybe the script's timing is flaky, try changing Sleep, 3000 to a smaller number.
« Last Edit: May 13, 2010, 12:39 PM by lanux128 »

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
for the edit monitoring to work you have to open/edit a file from the panel inside FileZilla - otherwise it doesn't know you are editing things.

then you'll get the prompt to appear when you save your opened/edited file.

snap044.jpg

snap045.jpg

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
try changing the "windows id" line to this:

WindowsID=File has changed ahk_class #32770  ; windows title and ahk class goes here. either will do..

that would help, i guess.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
erm, that's what i'd changed it to - BUT i'd put quote marks around the File has changed bit.

i'll try again though - perhaps it was looking for a title with " " marks in it - never thought of that.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
ooooh, i think that's working properly now...

i did say it would take me several hours to do on my own - as you can see, i should pay more attention to whether ahk will actually accept things like " " thrown randomly around the place.

thanks very much, lanux128.
« Last Edit: May 27, 2010, 11:27 AM by nudone »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
you're welcome.. :) just curious why did you put the quote marks?

btw, the title matching mode is set to partial match so any of the word will do.
SetTitleMatchMode 2   ; partial title match

however, with the quote marks, AHK will look for one of these words:
"File
has
changed".

which leaves "has" as the only match.


nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
i put the quote marks in as i just thought as the string had spaces in it (in File[space]has[space]changed) that's how ahk would work. i didn't realise it was clever enough to just take the whole string as it is - and i didn't understand what the partial match thing was doing. i definitely didn't expect it to match single words.

which all explains why my own ahk scripts tend not to work.


cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
a dialog window that won't come into focus
Actual Window Manager www.ActualTools.com is pretty good at this stuff.
I was using Ultramon 3 and a bunch of home-made macros for stuff like this but found AWM suited me a bit better.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
thanks. i've looked at Actual Window Manager a long time back - i might find it more useful this time around. i'll investigate and then say how i get on...

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
hmm, haven't tested Actual Window Manager yet (can't until tomorrow); just reading what it can do - it looks like it would instantly replace several programs i have constantly running.

looks pretty good to me.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
i've been running Actual Window Manager (AWM) for a while now and it could almost be described as a "super" tool. i say almost as it has not managed to replace 100% of the small apps i was hoping for - but it's still impressive.

so far, i've turned off these system tray running utils, as AWM replaces many of their functions:

1. DialogMove - my can't live without app (that jgpaiva was kind enough to make for me).

2. Taskbar Shuffle - drag taskbar items about.

3. WindowSpace - like win7 aero snap (i'm on vista).

4. UltraMon - multi-monitor support taskbars, etc.

5. AutoHotKey scripts that were needed to control specific program windows and dialogs boxes.

AWM has the ability to display the Alt+tab box on every screen on a multi-monitor setup. BUT, as it only replicates the default appearance of the alt+tab box it looks absolutely awful (does anyone on this planet think the Aero alt+tab is usable). i was hoping for a little more in this area and then i could have replaced the otherwise excellent VistaSwitcher - which is the best alt+tab replacement i've seen (you can make it very minimal) but it doesn't display on all monitors simultaneously.

(i've just been searching for a solution to the alt+tab situation.)
i've found that you can re-enable the old alt+tab in win7 by unchecking "Enable Aero Peek" in the Performance settings of System Properties (not tried it myself).

AND, in Vista use this in your registry to get the good old basic alt+tab back again.

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"AltTabSettings"=dword:00000001

so, at the moment, i'm undecided what i'll be keeping.

Ultramon has better methods of sending windows to adjacent screens. but AWM has far better options for each taskbar on each screen

VistaSwitcher still looks the best (and has more options for alt+tabbing on multi-monitors in many ways).

WindowSpace might have more options for snapping windows around the screen, not sure yet.

DialogMove works more automatically at controlling small windows - but maybe AWM has more power in this area that i need to look into.

Actual Window Manager can do a lot of the functions i use AutoHotKey for - but nothing will completely replace AHK, it's just less convenient to use for a novice like me.

i was trying not to, but it might just be that Actual Window Manager will be running alongside all of the above tools (except for Taskbar Shuffle). the battle for supremacy begins...
« Last Edit: May 14, 2010, 04:27 AM by nudone »

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
more standard alt+tab registry modifications:

HKEY_CURRENT_USER\Control Panel\Desktop
CoolSwitchColumns - set the number of icon columns
CoolSwitchRows - set the number of icon rows

there appears to be a bit of a delay when AWS displays the alt+tab box on all screens at the same time. it's a bit annoying having a slight pause when tabbing through the open programs - so, it looks like i'll be keeping VistaSwitcher (i posted a feature request on their forum to have simultaneous screen support).

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
i said i didn't want to do it but i'm now using Actual Window Manager with everything else. This is probably overkill as it is only replacing functions that can be done with AutoHotKey - well, and it adds a few buttons to the titlebars that might come in handy.

the problem with all of these programs is that they never quite go for enough. e.g. AWM doesn't allow complete control of right clicking on the title bar buttons - so i've got WindowSpace still performing those functions.

it seems using ready made apps it's a trade-off all the time - whereas AutoHotKey would allow for total freedom in the long run.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
i was trying not to, but it might just be that Actual Window Manager will be running alongside all of the above tools (except for Taskbar Shuffle). the battle for supremacy begins...
  ;D ;D ;D ;D ;D

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Nudone
There are reasonably frequent updates to Actual Window Manager, and I've found the developer open to ideas and suggestions.

If you're using as many screens as you are, and you haven't already investigated WiLMA, you might find it useful. Although I'm just a poor relation with only two screens, WiLMA is great for a few tasks where I prefer a bunch of windows to be in specific places on each.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,119
    • View Profile
    • Donate to Member
thanks. i'd no idea about WiLMA. i'll probably not get chance to look at it until monday - it must be useful though when that guy has got about 50 screens plugged into it.

is there no end to this quest?

edit:
things were so simple back when i had only one screen - and yet, there is no going back now...
« Last Edit: May 14, 2010, 11:15 AM by nudone »