JoeCool Posted June 10, 2014 Share Posted June 10, 2014 (edited) I'm pretty sure all autoit gurus here will have an answer for me :-) so here the code : expandcollapse popup#include <guiconstants.au3> #include <constants.au3> func wndMinimize() guiSetState( @SW_MINIMIZE, $gui ) endfunc func wndMaximize() guiSetState( @SW_MAXIMIZE, $gui ) endfunc func wndRestore() guiSetState( @SW_RESTORE, $gui ) endfunc func wndClose() exit endfunc opt( "GUIOnEventMode", 1) $flag = bitOr( $WS_SYSMENU, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS) ;$flag = 0 $gui = guiCreate( "Hello World", 200, 200, 200, 200, $flag ) guiSetOnEvent( $GUI_EVENT_MINIMIZE, "wndMinimize" ) guiSetOnEvent( $GUI_EVENT_MAXIMIZE, "wndMaximize" ) guiSetOnEvent( $GUI_EVENT_RESTORE, "wndRestore" ) guiSetOnEvent( $GUI_EVENT_CLOSE, "wndClose" ) guiSetState( @SW_SHOW ) while 1 sleep( 1000 ) wend I basicly just redefine Minize, Maximize, Restore and Close ... because in my application I will need to do some stuff in there .... but here the problem, script start and display a hello world, if I minimize it, and click on the icon on the task bar( actually restoring it ) the restore works fine, window is at the right place... but if I maximine the window and minimize it , the restore bring back a window NOT maximized ! if you comment out this line guiSetOnEvent( $GUI_EVENT_RESTORE, "wndRestore" ) and let windoze do the restore a maximized window minimized in the task bar will be restore as a maximized window, so do you think ? ... maybe there is a "bug" in the "guiSetState( @SW_RESTORE, $gui )" ... :-) Edited June 10, 2014 by JoeCool Link to comment Share on other sites More sharing options...
JoeCool Posted June 13, 2014 Author Share Posted June 13, 2014 (edited) Ok ? 40 views and nobody ever see that or thing it is a bug ??? lol Edited June 13, 2014 by JoeCool Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2014 Moderators Share Posted June 13, 2014 JowCool,Just addOpt("GUIEventOptions", 1)to your code - it then works as you expect. If you want to code for the window events, best you stop Windows doing its own thing at the same time. 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...
JoeCool Posted June 13, 2014 Author Share Posted June 13, 2014 Arrghh ! I didn't see that option before .... It woks when you cancel Windoze behavior... Thanks ! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 13, 2014 Moderators Share Posted June 13, 2014 JoeCool,I have also closed the Trac ticket you opened - perhaps a little prematurely. 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...
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