Jump to content

Recommended Posts

Posted

I'm codding a program to close a dialog opened by a program.

I can easily close the dialog.. but i wanna give the focus to the window active before the dialog opened

how can i do it?

Posted

I'm codding a program to close a dialog opened by a program.

I can easily close the dialog.. but i wanna give the focus to the window active before the dialog opened

how can i do it?

HI,

if you have got the title, use WinActivate().

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

but that way the active window is the dialog opened.

i want to give the focus to the previous active window.

is there a simple way to get the list of the windows of the ALT+TAB it has the last active window

Posted

Bundy is right.

Run this in Scite.

$OldWin=WinGetTitle('')
While 1
    $NewWin = WinGetTitle('')
    If $NewWin='' OR $NewWin = 'program manager' Then ContinueLoop
    If $NewWin = $OldWin Then
        Sleep (100)
    Else
        ConsoleWrite('Old Window was ' & $OldWin&@CR)
        $OldWin=$NewWin
    EndIf   
WEnd    
Exit
Posted (edited)

thanks :)

here is the script...

it closes the annoying dialog that bores me :(

$OldWin=WinGetTitle("")
While 1
    If WinExists("Profile storage space") Then
;closes the window
    WinClose("Profile storage space")
;restores the focus
    WinActivate($OldWin)
    Else
    $OldWin=WinGetTitle("")
    EndIf
    Sleep(100)
WEnd

cheers

Edited by raca
Posted

better version

$OldWin=WinGetTitle("")
$oldControl=ControlGetFocus($OldWin)
While 1
    If WinExists("Profile storage space") Then
    ;fecha a janela
        WinClose("Profile storage space")
    ;restora o focus
        ControlFocus ($OldWin,"",$oldControl)
    Else
        $OldWin=WinGetTitle("")
        $oldControl=ControlGetFocus ($OldWin)
    EndIf
    Sleep(100)
WEnd

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...