ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

SOLVED: WinWarden send window to back / bottom

(1/2) > >>

rodp:
Hi All,

Please can you help me in settin gup WinWarden...

Briefly, I use a program (called Execute) which processes data and creates multiple tables.  I generally work on other pieces of work whilst this runs (say in word or excel).  Execute has about 20 tables to run.  After finishing each table it closes and brings another little window up to show it's progress (see pic).  The problem is if I am typing away and don't notice that a new instance of Execute has appeared I can be prone to causing it to stop, eg pressing the space bar will cause the Cancel button to be pressed!  I would like to use WinWarden to return the focus back to the previous application (say excel for example).  So far I've been able to setup a line in the ini file that moves the Execute window to the bottom of the sreen but I've been unable to make it lose focus / unactivate it.




This line works fine - it detect the correct window when it pops up and moves it to the bottom of the screen.
Active      ,Execute,,,,,-Bottom,,,,,,,,,,,,,

in the ini file it stated the 18th or higher attribute can contain the following features.  I'm guessing I need to use Bottom, as I want the previous application to have the focus back - is this the correct one?

;>17 Maximize       Maximizes the window
;    Minimize       Minimizes the window
;    Restore        Restores the window
;    Show           Shows the window
;    Hide           Hides the window
;    Top            Moves the window on top of the other windows
;    Bottom         Moves the window to the bottom of the other windows
;    Enable         Enables mouse and keyboard input
;    Disable        Disables mouse and keyboard input
;    Ghost          Makes mouse clicks go through to the underlying window

Active      ,Execute,,,,,,,,,,,,,,,,Bottom,,

The problem is this doesn't work and infact none of the other ones seem to work, eg Minimize.

Hope someone can help

Thanks in advance

Rodp


lanux128:
i am not sure if what you're asking is possible with WinWarden but if you want to go the Autohotkey route, this might be of help:

this is untested and you may have to change the "Sleep' duration a bit.


--- Code: Autohotkey ---#Persistent#SingleInstance, Force#NoEnv SendMode, InputSetTitleMatchMode, 2            ; partial matchSetWorkingDir, %A_ScriptDir%DetectHiddenWindows, Off        ; they're hidden for a reason. var1 := "NPD PowerView: Execute Table" Loop {IfWinNotActive, % var1        {        WinGetActiveTitle, active_title        WinGetClass, active_class, A        }IfWinActive, % var1        {        WinActivate % active_title        WinActivate % "ahk_class " . active_class        TrayTip,Note:,The NPD PowerView window has lost focus. `nPlease press Ctrl+Esc if you wish to interact with it.,10,1        }Sleep, 500}Return ^Esc::Pause                     ; Ctrl + Esc pauses+Esc::ExitApp                   ; Shift + Esc exits
Edit: added a visual hint for users.

rodp:
Hi Lanux128,

Thanks very much for the guidance and script - that worked a treat and the focus is returned back to the previous application it seems.  There is one slight change I need.  I need the script to only run when the Execute window is first activated / created.  Currently as soon as I click on the window manually (eg to manually cancel it) the AHK script runs meaning it's hard to click the cancel button.  I could increase the sleep time but then this would impact the response time for when the window pops up initially.

I'm thinking that you could put a line in detecting if the mouse position intersects the same area as the Execute window or if the script registers some sort of session ID that is unique to that instance.  Could you help me with that additional condition?

Many thanks in advance.

Rodp

EDIT...... just came across this example: http://stackoverflow.com/questions/15696684/timer-runs-only-once.  See Update 2.  Do you think this is on the right tracks?
Or... (just reading the syntax list available) would WinWait actually do all what I need or is this more CPU intensive compared to a normal loop?

lanux128:
Hi rodp,

glad to be see the script working. if you want to interact with the said window (Execute window), you can press Ctrl+Esc to pause the script. give it a try and see if that works for you.

rodp:
ah yes, that would work - sorry wasn't thinking!  Is it possible then to place a brief message (balloon message!) from the H icon in the task bar to state that the window has been deactivated, press Ctrl+Esc to stop the script (incase you need to cancel), or something to that effect?  I might roll this out to other people and they would need to know what's going on you see.

To further my understanding however, are there drawbacks if I was to try using WinWait?

Thanks

Rodp

Navigation

[0] Message Index

[#] Next page

Go to full version