Jump to content
Sign in to follow this  
Skrip

Click Select

Recommended Posts

Skrip

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]

Share this post


Link to post
Share on other sites
KaFu
Skrip

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]

Share this post


Link to post
Share on other sites
KaFu

#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

Share this post


Link to post
Share on other sites
Skrip

Perfect. Thank you very much.


[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]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.