CyberSlug 6 Posted March 30, 2004 When an AutoGUI window is minimized then restored, is it possible to automatically return focus to the last active control? The workaround is only two lines, but I think this should be the default behaviour.Global $title = "text editor foo", $focus Opt("GuiNotifyMode",1) GUICreate($title, 440, 280, 100, 100) WinActivate($title) Global $txt1 = GUISetControl("edit", "AutoGUI is cool", 0, 30 ,430 ,220) GUISetControlEx ($txt1, 256, 0) GUIShow() while 1;loop until user clicks the close button sleep(100) $message = GuiMsg(0) If $message = -3 Then Exit ; WORKAROUND ----> If $message = -4 Then $focus = ControlGetFocus ($title);save If $message = -5 Then ControlFocus ( $title, "", "Edit1");restore Wend Exit Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Share this post Link to post Share on other sites
Valik 478 Posted March 30, 2004 I think that's something the user should handle on their own, and since it is only a 2 line (Actually that would be 3 counting the declaration of the global variable...), it shouldn't be any big deal. Share this post Link to post Share on other sites
jpm 91 Posted March 30, 2004 When an AutoGUI window is minimized then restored, is it possible to automatically return focus to the last active control? The workaround is only two lines, but I think this should be the default behaviour.Global $title = "text editor foo", $focus Opt("GuiNotifyMode",1) GUICreate($title, 440, 280, 100, 100) WinActivate($title) Global $txt1 = GUISetControl("edit", "AutoGUI is cool", 0, 30 ,430 ,220) GUISetControlEx ($txt1, 256, 0) GUIShow() while 1;loop until user clicks the close button sleep(100) $message = GuiMsg(0) If $message = -3 Then Exit ; WORKAROUND ----> If $message = -4 Then $focus = ControlGetFocus ($title);save If $message = -5 Then ControlFocus ( $title, "", "Edit1");restore Wend ExitI try to correct this situation related with the {TAB}. Can you give me an example so I can see what happens? Your example does show the problem with 102.12 the caret still blinking Share this post Link to post Share on other sites