Sign in to follow this  
Followers 0
gottygolly

Input as title.

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



Alrighty, thanks for the quick response.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

That's not what I was really talking about but what you posted could be useful, thanks :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (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

o9efx0.png

Not perfect because the parent lose the focus when click on the input but give an idea

Edited by johnmcloud

Share this post


Link to post
Share on other sites

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!

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
Sign in to follow this  
Followers 0