Yuljup Posted December 21, 2015 Share Posted December 21, 2015 (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 December 23, 2015 by Yuljup Link to comment Share on other sites More sharing options...
Yuljup Posted December 23, 2015 Author Share Posted December 23, 2015 (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 December 23, 2015 by Yuljup Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 23, 2015 Moderators Share Posted December 23, 2015 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Yuljup Posted December 23, 2015 Author Share Posted December 23, 2015 M23,Ok - Thank you for your input. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 23, 2015 Moderators Share Posted December 23, 2015 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Yuljup Posted December 23, 2015 Author Share Posted December 23, 2015 (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 December 23, 2015 by Yuljup Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 23, 2015 Moderators Share Posted December 23, 2015 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 Yuljup and Synapsee 2 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Yuljup Posted December 23, 2015 Author Share Posted December 23, 2015 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! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 23, 2015 Moderators Share Posted December 23, 2015 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skysnake Posted December 28, 2015 Share Posted December 28, 2015 @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? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 28, 2015 Moderators Share Posted December 28, 2015 Skysnake,a standard WindowThere 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skysnake Posted December 29, 2015 Share Posted December 29, 2015 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? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now