gottygolly Posted January 8, 2015 Share Posted January 8, 2015 I just thought of something weird to do for a gui and I was wondering if it's possible to put an input box in the title area. I searched around but wasn't able to find anything, just wondering if it's actually possible. Link to comment Share on other sites More sharing options...
JohnOne Posted January 8, 2015 Share Posted January 8, 2015 Probably, with a whole lot of subclassing and farting about. Easier to just get rid of title bar and emulate it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
gottygolly Posted January 8, 2015 Author Share Posted January 8, 2015 Alrighty, thanks for the quick response. Link to comment Share on other sites More sharing options...
jdelaney Posted January 8, 2015 Share Posted January 8, 2015 (edited) How about an input box that modifies the title? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> Local $myinput, $msg, $h $sTitle = "My GUI edit" $h = GUICreate($sTitle) ; will create a dialog box that when displayed is centered $myinput = GUICtrlCreateInput ($sTitle,15,15) GUISetState() ; will be append dont' forget 3rd parameter ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If ControlGetText($h,"",$myinput)<>WinGetTitle($h) Then WinSetTitle($h,"",ControlGetText($h,"",$myinput)) EndIf If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Edited January 8, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
gottygolly Posted January 8, 2015 Author Share Posted January 8, 2015 That's not what I was really talking about but what you posted could be useful, thanks Link to comment Share on other sites More sharing options...
johnmcloud Posted January 9, 2015 Share Posted January 9, 2015 (edited) Think outside of the box ; Johnmcloud - 2015 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hParent = GUICreate("Johnmcloud", 310, 225) $hButton = GUICtrlCreateButton("Read input", 25, 25, 70, 30) GUISetState(@SW_SHOW, $hParent) $aParent = WinGetPos($hParent) $hChild = GUICreate("", 75, 25, $aParent[0] + 160, $aParent[1] + 3, $WS_POPUP, $WS_EX_TOOLWINDOW, $hParent) $hInput = GUICtrlCreateInput("Test code", 0, 0, 75, 25) GUISetState(@SW_SHOWNOACTIVATE, $hChild) GUIRegisterMsg($WM_MOVE, "WM_MOVE") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hButton MsgBox(0, "Info", ControlGetText($hChild, "", $hInput)) EndSwitch WEnd Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam If ($hWnd = $hParent) Then $aParent = WinGetPos($hParent) WinMove($hChild, "", $aParent[0] + 160, $aParent[1] + 3) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_MOVE Not perfect because the parent lose the focus when click on the input but give an idea Edited January 9, 2015 by johnmcloud Link to comment Share on other sites More sharing options...
gottygolly Posted January 9, 2015 Author Share Posted January 9, 2015 Thanks johnmcloud I didn't think to do that but it works really good so I'll try to use it and make it a tad bit better. Thanks for the help guys! 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