Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 03, 2016, 01:47:41 PM
  • Proudly celebrating 10 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 6584 times)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,366
    • View Profile
    • Donate to Member
is there no end to this quest?
Yes, it's "ion".  ;)

Good luck with WiLMA, it seems a good match with your layout.
(You may find you have to suspend AWM in some cases but that can be automatic.)

Thanks for all the info you're posting here. You're on an interesting journey.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
i'm glad someone else is finding it interesting.

when you say AWM can be suspended automatically, do you mean it will suspend operation when a specific window has focus? i'd seen how you can set rules/exclusions but not a "global" kind of suspend.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
also there is a Actual Window Manager mini review by tranglos.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
also there is a Actual Window Manager mini review by tranglos.
oh right. i didn't know that either. i must have brushed past it when i wasn't after such a tool. thanks, lanux128.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,366
    • View Profile
    • Donate to Member
when you say AWM can be suspended automatically, do you mean it will suspend operation when a specific window has focus? i'd seen how you can set rules/exclusions but not a "global" kind of suspend.
Oh, sorry, no.
I meant only that you, yourself, could set up however you call WiLMA to switch off AWM.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
oh right. that's intersting though. if WiLMA can disable things then that does open up possibilities.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,366
    • View Profile
    • Donate to Member
oh right. that's intersting though. if WiLMA can disable things then that does open up possibilities.
Oh dear, sorry again, I must learn to express myself better.  :-[
I don't think WiLMA will do that, so you'd just call WiLMA by launching something (of your own): step 1 stop AWM, step 2 start WiLMA -- batch file, a line or two of ahk, whatever. You'll need to see if you need that, and what if any interactions you have on your system, and what works best for you.

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
oooohhh. i see. well, thanks for clarifying that.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
this is a newer version of this script. the changes are ini file support for adding new windows/dialogs to be watched and tray menu customization. please give it a try.


nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
thanks very much, lanux128.

i've commented out the tooltip in the loop as it wouldn't stop floating around my cursor when it appeared.

is it a complicate addition to make the loop perform different actions depending on which window is activated?

currently it works fine for me - as the "Yes" button is always the one to click in the dialogs used. but i expect this will not always be the case.

here's the current script.

Code: AutoIt [Select]
  1. #Persistent
  2. #SingleInstance force
  3. #NoEnv
  4. ;#NoTrayIcon
  5. SetBatchLines, -1
  6. SetTitleMatchMode, 2    ; partial title match
  7. SetWorkingDir, %A_ScriptDir%
  8. DetectHiddenWindows, Off ; they are hidden for a reason..
  9.  
  10. Gosub, Get_INI              ; go to INI section
  11. IfExist, %TrayIcon%         ;TrayMenu Customisation
  12.   Menu, Tray, Icon, %TrayIcon%
  13.   Menu, Tray, Tip, Activate the specified window/dialog whenever it appears.
  14. SetTimer, ActivateMe, 500   ; timer starts - increase or decrease the value as necessary
  15.  
  16. ActivateMe:
  17. ;parse and auto-activate
  18. Loop, Parse, WatchThese, |
  19. {
  20.         ;Tooltip, %A_LoopField%
  21.         IfWinExist %A_LoopField%
  22.         {    
  23.                 WinActivate    ;do something here like press the ok button
  24.                 ControlClick, Yes
  25.                 ;sleep for a while - good for cpu cycle
  26.                 Sleep, 2000
  27.         }
  28. }
  29.  
  30. Get_INI:
  31. If (!FileExist("ActivateDialogs.ini")) ;if the ini file doesn't exist, create it with the info below
  32. {
  33.         FileAppend, [Settings]`nWatchThese=File has changed ahk_class #32770|Delete Shortcut ahk_class #32770`nTrayIcon=Application-warn.ico, ActivateDialogs.ini
  34. }
  35.  
  36. IniRead,WatchThese,ActivateDialogs.ini,Settings,WatchThese
  37. IniRead,TrayIcon,ActivateDialogs.ini,Settings,TrayIcon
  38.  

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
thanks very much, lanux128.

i've commented out the tooltip in the loop as it wouldn't stop floating around my cursor when it appeared.

is it a complicate addition to make the loop perform different actions depending on which window is activated?

currently it works fine for me - as the "Yes" button is always the one to click in the dialogs used. but i expect this will not always be the case.

ah, apologies for the tooltip, it's a left-over debug tool.. :)

yes you can perform different actions based on the activated window, put something like this in the inner loop (lines 24-27).

Code: AutoIt [Select]
  1. If A_LoopField = metapad ahk_class metapad
  2.     MsgBox The metapad window is detected.
  3. Else If A_LoopField = ahk_class notepad
  4. {
  5.         ;notepad window - let's do something else
  6.         WinActivate
  7.         ;do something else
  8. }

nudone

  • Cody's Creator
  • Columnist
  • Joined in 2005
  • ***
  • Posts: 4,117
    • View Profile
    • Donate to Member
thanks, lanux128. that works great. i think that is going to come in very handy now.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
you're welcome.. :)