Jump to content

Click Select


Recommended Posts

How can I make it so that when you click anywhere within an input box, everything will be selected?

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

I thought of that, but I was really trying to go around having to send any keys...is there a way without having to send any keys?

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Test-GUI",300,100,100,100,Default,$WS_EX_TOPMOST)
$input1 = GUICtrlCreateInput("Input 1...",10,10,200)
$input2 = GUICtrlCreateInput("Input 2...",10,40,200)
GUISetState(@SW_SHOW)

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

while 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
wend


Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord
    Local $iCode = BitShift($wParam, 16);HiWord
    Switch $iIDFrom
        Case $input1
            if $iCode = 256 then; = input receives focus; 512 = loses focus
                GUICtrlSetState($input1, $GUI_FOCUS)
            endif
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc;==>WM_COMMAND

Edited by KaFu
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...