Not at all, I was just trying to correct myself; I had the name of your
script wrong.
 
my issue was that in vista, sometimes, when you alt-tabbed to a windows
explorer window, you would find that the list view of files would not be
the focused control.  others mentioned noticing the same annoyance, so I
was trying to correct it with a small script that would focus the list
view immediately after the activation of a windows explorer window.
 
that's when I ran into some weird issue where the focus command would
not work for me.
 
I disabled all scripts, then slow re-enabled them one at a time, until
they were all enabled, and it's all working now (I mean I'm able to
focus the list view control now).  I haven't a clue as to why it wasn't
working for a while (of course I did reboot several times, and the
problem still existed for me).
 
I'm just glad it's working now, and I'm sorry Doug and Aaron had to
spend some time working on it needlessly.
 
Chip
 
 
 




------------------------------

Chip Orange
Database Administrator
Florida Public Service Commission

chip.ora...@psc.state.fl.us
(850) 413-6314

 (Any opinions expressed are solely those of the author and do not
necessarily reflect those of the Florida Public Service Commission.)


 


________________________________

        From: Kevin Simon Huber [mailto:kevin.hub...@gmail.com] 
        Sent: Thursday, July 02, 2009 9:41 AM
        To: gw-scripting@gwmicro.com
        Subject: Re: example for vista control not focusing problem
        
        
        Hi Chip:
        Did I steal your original name for a script,
"MakePointerFollowCursor"?  
        I'm sorry about that.  (smile)
        Kevin Huber

                ----- Original Message ----- 
                From: Chip Orange <mailto:cora...@psc.state.fl.us>  
                To: gw-scripting@gwmicro.com 
                Sent: Tuesday, June 30, 2009 4:06 PM
                Subject: RE: example for vista control not focusing
problem

                Well, I meant to call it "make pointer follow cursor",
but it seems to have nothing to do with the issue for me anyway.  still,
I cannot get it to fail in my xp.
                 
                very interesting.
                 
                Chip
                 
                 




                ------------------------------
                
                Chip Orange
                Database Administrator
                Florida Public Service Commission
                
                chip.ora...@psc.state.fl.us
                (850) 413-6314
                
                 (Any opinions expressed are solely those of the author
and do not necessarily reflect those of the Florida Public Service
Commission.)
                

                 


________________________________

                        From: Chip Orange
[mailto:cora...@psc.state.fl.us] 
                        Sent: Tuesday, June 30, 2009 4:02 PM
                        To: gw-scripting@gwmicro.com
                        Subject: RE: example for vista control not
focusing problem
                        
                        
                        Thanks Jeff, now that really is interesting.
                         
                        When I ran it here once or twice on my xp
machine it ran ok.
                         
                        Do you have the "make mouse pointer follow
focus" script running?
                         
                        Chip
                         
                         




                        ------------------------------
                        
                        Chip Orange
                        Database Administrator
                        Florida Public Service Commission
                        
                        chip.ora...@psc.state.fl.us
                        (850) 413-6314
                        
                         (Any opinions expressed are solely those of the
author and do not necessarily reflect those of the Florida Public
Service Commission.)
                        

                         


________________________________

                                From: Jeff Weiss
[mailto:jnwe...@lwsb.org] 
                                Sent: Tuesday, June 30, 2009 3:12 PM
                                To: gw-scripting@gwmicro.com
                                Subject: RE: example for vista control
not focusing problem
                                
                                
                                Chip,
                                I may not have done this just right, but
I tested this code on my xp pro sp3 machine.
                                I used hotkeys to open three windows
explorer windows.
                                I got the messages "setting focus to
some other window"
                                Then I got the message "failed to set
focus to listview control.
                                This was with my xp machine and we 7.1.
                                I know you meant this to be tested  on
vista machine, but it seems to have failed here also.
                                Jeff Weiss
                                 
                                    
                                
________________________________

                                From: Chip Orange
[mailto:cora...@psc.state.fl.us] 
                                Sent: Tuesday, June 30, 2009 11:43 AM
                                To: gw-scripting@gwmicro.com
                                Subject: example for vista control not
focusing problem
                                
                                
                                Hi Doug and Aaron,
                                 
                                I can't test this here where I wrote it,
at least I can but it doesn't fail on xp, but below is an example of a
script which waits for a windows explorer window to be made the active
window, then when it is the script attempts to demonstrate the problem
by setting some other control to be focused, then setting the list view
to have the focus.
                                 
                                thanks.
                                 
                                Chip
                                 
                                ---------
                                 
                                option explicit
                                 
                                ' watch for newly activated windows
(looking for Windows Explorer)
                                connectEvent  desktopWindow,
"onChildActivate", "onChildActivate" 
                                 
                                sub onChildActivate ( window )
                                 
                                

                                if window is nothing then exit sub
                                if not window.isValid then exit sub
                                if strComp ( uCase ( window.moduleName),
"BROWSEUI") <> 0 then exit sub
                                if strComp ( uCase ( WINDOW.className),
"CABINETWCLASS") <> 0 THEN EXIT SUB
                                ' this is a windows explorer window,
find the list view control
                                ' do so with a slight delay to give the
window time to populate, and to clear this handler routine as soon as
possible
                                queue "handleWindowsExplorerWindow",
window
                                 
                                end sub
                                 
                                sub HandleWindowsExplorerWindow ( window
)
                                ' search the children of this window,
looking for the list of files, which we want to make the focused control
when we return to this type of window
                                dim oChild
                                for each oChild in
window.Children.filterByType(wtListView)
                                if not window.isValid then exit sub
                                if not oChild.isValid then exit sub
                                If  oChild.Accessible.State.Focusable
And oChild.Visible And oChild.Enabled  then
                                ' this is the list of files in a windows
explorer window
                                If   oChild.Accessible.State.Focused
then setSomethingElseAsFocus ( window )
                                If  not oChild.Accessible.State.Focused
then 
                                speak "setting the focus to the list
view control" ' temporary
                                oChild.focus
                                sleep 1000
                                If  not oChild.Accessible.State.Focused
then  speak "failed to set the list view as the focus!"
                                end if
                                exit sub
                                end if
                                next
                                 

                                end sub
                                 
                                 
                                 
                                sub setSomethingElseAsFocus ( window )
                                ' make some other control than the
listview be the focus
                                dim oChild
                                for each oChild in window.Children
                                if not window.isValid then exit sub
                                if not oChild.isValid then exit sub
                                if oChild.type <> wtListView then
                                ' it's not a list view, so see if it can
be focused
                                If  oChild.Accessible.State.Focusable
And oChild.Visible And oChild.Enabled  then
                                ' this is focusable
                                If  not oChild.Accessible.State.Focused
then 
                                speak "setting the focus to something
else"
                                oChild.focus
                                sleep 1000
                                If  not oChild.Accessible.State.Focused
then  speak "failed to set the alternate control as the focus!"
                                end if
                                exit sub
                                end if
                                end if '  oChild.type <> wtListView
                                next
                                 

                                end sub
                                
                                 




                                ------------------------------
                                
                                Chip Orange
                                Database Administrator
                                Florida Public Service Commission
                                
                                chip.ora...@psc.state.fl.us
                                (850) 413-6314
                                
                                 (Any opinions expressed are solely
those of the author and do not necessarily reflect those of the Florida
Public Service Commission.)
                                

                                 



                __________ Information from ESET Smart Security, version
of virus signature database 4205 (20090701) __________
                
                The message was checked by ESET Smart Security.
                
                http://www.eset.com
                

Reply via email to