Sign in to follow this  
Followers 0
qazwsx

trouble recording handle

4 posts in this topic

Func _hide()
    MsgBox(0, "", "hide")
    $list = WinList()
    Global $NewArray [UBound($list) ]
    For $i = 1 To $list[0][0]
        If $list[$i][0] <> "" And $list[$i][0] <> "Program Manager" And _IsVisible($list[$i][1]) Then
            WinSetState($list[$i][1], "", @SW_HIDE)
            _processlow()
            $NewArray[$i] = $list[$i][1]
        EndIf
    Next
EndFunc  ;==>_hide

Func _show()
    MsgBox(0, "", "show")
    For $i = 0 To $list[0][0] - 1
        WinSetState($NewArray[$i], "", @SW_SHOW)
        _processnormal ()
    Next
EndFunc  ;==>_show

The hide func works fine but the show func does not return the windows to their previous state. I think it gets into some sort of loop because in the script i have a hotkey that changes between hiding and showing, and after i hide the windows the hotkey only does the the show func. That was probably not the best way to explain it but it means that the show func is never completing.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You should add $list = WinList() to your _show() function. If it's the hotkey toggle that you're having trouble with, it should look similar to the TogglePause from the helpfile.

Func TogglePause()

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

HotKeySet("{INS}", "ToggleShow")

Global $show = True

Func ToggleShow()
    $show = NOT $show
    If $show Then
        _show()
    Else
        _hide()
    EndIf
EndFunc

Edit: typo

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

the problem is not the hotkey becasue the message box for _show appears but the window never show. If i add winlist to the show func won't it overwrite the windows that were stored before. I only want to bring back the windows that were previously hidden.

Edited by sccrstvn93

Share this post


Link to post
Share on other sites

*bump*

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0