Yuljup

[SOLVED] Minimize 'pop-up' window from taskbar

12 posts in this topic

#1 ·  Posted (edited)

Hi,

Is it possible to minimize pop-up windows from the taskbar?

I've previously created minimize buttons in my projects, which works fine, but I just thought I'd ask in case anyone knew.

 

#include <GUIConstants.au3>
#include <SendMessage.au3>
Global Const $SC_DRAGMOVE = 0xF012

$ExampleGUI = GUICreate("Example", 300, 220, -1, -1, BitOR($WS_POPUP, $WS_BORDER))

GUISetState()

While 1
    Local $aMsg = GUIGetMsg(1)
    Switch $aMsg[1]
        Case $ExampleGUI
            Switch $aMsg[0]
                Case $GUI_EVENT_CLOSE
                    GUIDelete($ExampleGUI)
                    ExitLoop
                Case $GUI_EVENT_PRIMARYDOWN
                    _SendMessage($ExampleGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
            EndSwitch
    EndSwitch
WEnd

 

Edited by Yuljup

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Just gonna give this one bump to give it some more attention, then I'll let it go. :)

Might be a bad time with the holidays and all, though. -- Understandably.

Edited by Yuljup

Share this post


Link to post
Share on other sites

Yuljup,

You could certainly minimize and restore the GUI using the menu from the systray icon - I have no idea how you might do it from the icon in the taskbar itself.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

M23,

Ok - Thank you for your input. :)

Share this post


Link to post
Share on other sites

Yuljup,

Other than simply clicking on the taskbar icon as you do for any other window, of course!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

M23,

Are you saying that you do not get the same behaviour as I do?

This is pretty much what I've been doing.

#include <GUIConstants.au3>
#include <SendMessage.au3>
Global Const $SC_DRAGMOVE = 0xF012

$ExampleGUI = GUICreate("Example", 300, 220, -1, -1, BitOR($WS_POPUP, $WS_BORDER))
Local $MinimizeButton = GUICtrlCreateButton("Minimize", 90, 30, 50, 20)
Local $CloseButton = GUICtrlCreateButton("Close", 155, 30, 50, 20)

GUISetState()

While 1
    Local $aMsg = GUIGetMsg(1)
    Switch $aMsg[1]
        Case $ExampleGUI
            Switch $aMsg[0]
                Case $GUI_EVENT_CLOSE
                    GUIDelete($ExampleGUI)
                    ExitLoop
                Case $GUI_EVENT_PRIMARYDOWN
                    _SendMessage($ExampleGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
             Case $MinimizeButton
                 GUISetState(@SW_MINIMIZE)
             Case $CloseButton
                 Exit
            EndSwitch
    EndSwitch
WEnd

 

If you remove the "BitOR($WS_POPUP, $WS_BORDER)" part, minimize works fine from the taskbar.

#include <GUIConstants.au3>
#include <SendMessage.au3>
Global Const $SC_DRAGMOVE = 0xF012

$ExampleGUI = GUICreate("Example", 300, 220, -1, -1)
Local $MinimizeButton = GUICtrlCreateButton("Minimize", 90, 30, 50, 20)
Local $CloseButton = GUICtrlCreateButton("Close", 155, 30, 50, 20)

GUISetState()

While 1
    Local $aMsg = GUIGetMsg(1)
    Switch $aMsg[1]
        Case $ExampleGUI
            Switch $aMsg[0]
                Case $GUI_EVENT_CLOSE
                    GUIDelete($ExampleGUI)
                    ExitLoop
                Case $GUI_EVENT_PRIMARYDOWN
                    _SendMessage($ExampleGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
             Case $MinimizeButton
                 GUISetState(@SW_MINIMIZE)
             Case $CloseButton
                 Exit
            EndSwitch
    EndSwitch
WEnd

 

Edited by Yuljup

Share this post


Link to post
Share on other sites

Yuljup,

I see now - just add the $WS_MINIMIZEBOX & $WS_SYSMENU styles and you will find that the taskbar icon will also minimize/restore on clicking.

M23

2 people like this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

 just add the $WS_MINIMIZEBOX & $WS_SYSMENU styles and you will find that the taskbar icon will also minimize/restore on clicking.

Oh, wow! - That did it!

Thank you!

 

Happy holidays! :D

Share this post


Link to post
Share on other sites

Yuljup,

And you too. Glad I could help.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@Melba, my 2c worth. Would it clarify the issue to place it in one of the Help file pages that "in order to behave as expected from a standard Window, the following styles need to be present..." ?

Merry Christmas


Skysnake

Why is the snake in the sky?

Share this post


Link to post
Share on other sites

Skysnake,

a standard Window

There is the problem with that suggestion - what is "a standard Window"? For me, it is probably the default as defined on the GUICreate Help file page - for others it could well be very different. Anyway, adding the $WS_MINIMIZEBOX  style to a GUI which apparently would not minimize seemed a pretty logical thing to try.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thanks for the reply. On another platform the question arose as to "the one best way" to do anything.  Those who can, have many tools available to them. Those who are still learning need a clear path to follow, in order to develop their own tools.  All that I am suggesting is that when working in a Windows environment, users expect certain -standard- behaviour. Guiding the novice on the correct path initially can do no harm?


Skysnake

Why is the snake in the sky?

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