Sign in to follow this  
Followers 0
confutatis

Maximize and Show Window

3 posts in this topic

#1 ·  Posted (edited)

Hello to all,

Now that I was able to resolve my problem of minimizing my AutoIT menu to the tray, a smaller problem has popped up. I've included a piece of the code here:

Select
        case $opt[0]=""
            ContinueLoop
        case $opt[0]=$GUI_EVENT_CLOSE
            exitloop
        case $opt[0]=$GUI_EVENT_MINIMIZE
            GUISetState(@SW_HIDE)
            Opt("TrayIconHide",0)
            while 1
                $trayMsg=TrayGetMsg()
                If $trayMsg = $tlist_2 Then
                    exitloop 2
                EndIf
                If $trayMsg = $tlist_1 Then
                    GuiSetState(@SW_SHOW)
                    Opt("TrayIconHide", 1)
                    exitloop
                EndIf
            WEnd

The var $tlist_1 is a tray menu item which restores the window. The item selection pops up when the user right-clicks on the tray icon. But when the item is selected, instead of maximizing the window, the window minimizes to the standard task bar. Curiously, I set the default to this item (traySetItemState) and with a double-click to the tray icon, the window does maximize properly. I've tried changing the GuiSetState to basically every @SW_ macro to no avail.

What am I missing here?

Thanks for the help in advance,

David

Edited by confutatis

Share this post


Link to post
Share on other sites



Hello to all,

What am I missing here?

What about using these both:

GUISetState(@SW_SHOW)

GUISetState(@SW_RESTORE)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

What about using these both:

GUISetState(@SW_SHOW)

GUISetState(@SW_RESTORE)

That did it...Thanks for the help!

David

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