Jump to content

Maximize and Show Window


confutatis
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Developers

Hello to all,

What am I missing here?

What about using these both:

GUISetState(@SW_SHOW)

GUISetState(@SW_RESTORE)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...