Jump to content
Sign in to follow this  

trouble recording handle

Recommended Posts

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)
            $NewArray[$i] = $list[$i][1]
EndFunc  ;==>_hide

Func _show()
    MsgBox(0, "", "show")
    For $i = 0 To $list[0][0] - 1
        WinSetState($NewArray[$i], "", @SW_SHOW)
        _processnormal ()
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

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


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




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

Global $show = True

Func ToggleShow()
    $show = NOT $show
    If $show Then

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

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...