Komawoyo Posted October 3, 2007 Share Posted October 3, 2007 how can i set the Ibeam to not become inactive in an input box... i want to use buttons on screen to send keys into an input box but every time i click the created button, the Ibeam would be out of the inputbox so nothing would be inputted Link to comment Share on other sites More sharing options...
qazwsx Posted October 3, 2007 Share Posted October 3, 2007 try using controlsend Link to comment Share on other sites More sharing options...
Komawoyo Posted October 4, 2007 Author Share Posted October 4, 2007 try using controlsendhi, would this work if my button was in the same Gui as my input boxes? Link to comment Share on other sites More sharing options...
Nahuel Posted October 4, 2007 Share Posted October 4, 2007 Wait... you mean you want something like this? #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 200, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input1,GUICtrlRead($Input1)&"Hello") EndSwitch WEnd Or you want to send text to an external window? Would you mind re-phrasing your question for non-english speaking people? Link to comment Share on other sites More sharing options...
BrettF Posted October 4, 2007 Share Posted October 4, 2007 (edited) I came up with this... expandcollapse popup#include <GUIConstants.au3> #Include <GuiEdit.au3> $GUI = GUICreate ("Not Loose Focus in Edit", 400, 400) $edit = GUICtrlCreateEdit ("", 0, 0, 250, 400, $ES_NOHIDESEL + $ES_WANTRETURN) $btn1 = GUICtrlCreateButton ("INSERT: AN", 250, 0, 150, 30) $btn2 = GUICtrlCreateButton ("INSERT: EXAMPLE", 250, 30, 150, 30) $btn3 = GUICtrlCreateButton ("INSERT: PHRASE", 250, 60, 150, 30) $btn4 = GUICtrlCreateButton ("INSERT: CAN", 250, 90, 150, 30) $btn5 = GUICtrlCreateButton ("INSERT: BE", 250, 120, 150, 30) $btn6 = GUICtrlCreateButton ("INSERT: INSERTED", 250, 150, 150, 30) GUISetState () ControlFocus ($GUI, "", $edit) While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $btn1 $text = "AN" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn2 $text = "EXAMPLE" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn3 $text = "PHRASE" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn4 $text = "CAN" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn5 $text = "BE" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn6 $text = "INSERTED" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) EndSwitch WEnd Edited October 4, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Komawoyo Posted October 4, 2007 Author Share Posted October 4, 2007 Wait... you mean you want something like this? #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 200, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input1,GUICtrlRead($Input1)&"Hello") EndSwitch WEnd Or you want to send text to an external window? Would you mind re-phrasing your question for non-english speaking people? yes this is what i wanted.... but can the $Input1 change depending on what inputbox my Ibeam is current in?? so if my Ibeam is in $Input2 GUICtrlSetData($Input2,GUICtrlRead($Input2)&"Hello") Link to comment Share on other sites More sharing options...
Komawoyo Posted October 4, 2007 Author Share Posted October 4, 2007 I came up with this... expandcollapse popup#include <GUIConstants.au3> #Include <GuiEdit.au3> $GUI = GUICreate ("Not Loose Focus in Edit", 400, 400) $edit = GUICtrlCreateEdit ("", 0, 0, 250, 400, $ES_NOHIDESEL + $ES_WANTRETURN) $btn1 = GUICtrlCreateButton ("INSERT: AN", 250, 0, 150, 30) $btn2 = GUICtrlCreateButton ("INSERT: EXAMPLE", 250, 30, 150, 30) $btn3 = GUICtrlCreateButton ("INSERT: PHRASE", 250, 60, 150, 30) $btn4 = GUICtrlCreateButton ("INSERT: CAN", 250, 90, 150, 30) $btn5 = GUICtrlCreateButton ("INSERT: BE", 250, 120, 150, 30) $btn6 = GUICtrlCreateButton ("INSERT: INSERTED", 250, 150, 150, 30) GUISetState () ControlFocus ($GUI, "", $edit) While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $btn1 $text = "AN" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn2 $text = "EXAMPLE" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn3 $text = "PHRASE" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn4 $text = "CAN" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn5 $text = "BE" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) Case $btn6 $text = "INSERTED" _GUICtrlEditReplaceSel ($edit, TRUE, $text) ControlFocus ($GUI, "", $edit) EndSwitch WEnd is it possible for this to work if i have more than 1 inputbox? Link to comment Share on other sites More sharing options...
BrettF Posted October 4, 2007 Share Posted October 4, 2007 is it possible for this to work if i have more than 1 inputbox?Yes. But have you tried? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Nahuel Posted October 4, 2007 Share Posted October 4, 2007 This is what I did. It doesn't work the way you want yet. #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 200, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) $Input2 = GUICtrlCreateInput("", 40, 94, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $input=$Input1 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $input1 $input=$input1 Case $input2 $input=$input2 Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input,GUICtrlRead($Input)&"Hello") EndSwitch WEnd It will send 'hello' to the last input you typed something in. For example, type something in the first one and press the button. It will send hello to that inputbox. Now type something in the second one and press the button, will send hello to that inputbox. There's a way of doing it the way you want, let me see if I can find that UDF... Link to comment Share on other sites More sharing options...
Komawoyo Posted October 4, 2007 Author Share Posted October 4, 2007 Yes. But have you tried?This only send to $edit.... but what if my Ibeam was in $edit1 or $edit2... i want it to change every time depending on what Inputbox im in Link to comment Share on other sites More sharing options...
Nahuel Posted October 4, 2007 Share Posted October 4, 2007 This will send 'hello' to the inputbox your mouse is over... not what you want, but might give you ideas. I'm off to bed now.expandcollapse popup#include <GUIConstants.au3> #include <_ControlHover.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 200, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) $Input2 = GUICtrlCreateInput("", 40, 94, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $input=$Input1 _ControlHover(2, "", $Input1); add controls here _ControlHover(2, "", $Input2); add controls here While 1 Sleep(25) $Over = _ControlHover(0, $Form1); or _ControlHover() - or _ControlHover(0) If $Over = 1 Then $tempID = @extended If $tempID = $input1 Then GUICtrlSetData($Input1,GUictrlread($Input1)&"Hello") EndIf If $tempID = $input2 Then GUICtrlSetData($Input2,GUictrlread($Input2)&"Hello") EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $input1 $input=$input1 Case $input2 $input=$input2 Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input,GUICtrlRead($Input)&"Hello") EndSwitch WEndPS. You'll need _ControlHover.au3 Link to comment Share on other sites More sharing options...
Komawoyo Posted October 5, 2007 Author Share Posted October 5, 2007 This will send 'hello' to the inputbox your mouse is over... not what you want, but might give you ideas. I'm off to bed now. expandcollapse popup#include <GUIConstants.au3> #include <_ControlHover.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 200, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) $Input2 = GUICtrlCreateInput("", 40, 94, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $input=$Input1 _ControlHover(2, "", $Input1); add controls here _ControlHover(2, "", $Input2); add controls here While 1 Sleep(25) $Over = _ControlHover(0, $Form1); or _ControlHover() - or _ControlHover(0) If $Over = 1 Then $tempID = @extended If $tempID = $input1 Then GUICtrlSetData($Input1,GUictrlread($Input1)&"Hello") EndIf If $tempID = $input2 Then GUICtrlSetData($Input2,GUictrlread($Input2)&"Hello") EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $input1 $input=$input1 Case $input2 $input=$input2 Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input,GUICtrlRead($Input)&"Hello") EndSwitch WEnd PS. You'll need _ControlHover.au3 TY!!! i got it to work i just edited this script of yours a bit #include <GUIConstants.au3> #include <_ControlHover.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 200, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) $Input2 = GUICtrlCreateInput("", 40, 94, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $input=$Input1 _ControlHover(2, "", $Input1); add controls here _ControlHover(2, "", $Input2); add controls here While 1 Sleep(25) $Over = _ControlHover(0, $Form1); or _ControlHover() - or _ControlHover(0) If $Over = 1 Then $tempID = @extended If $tempID = $input1 Then $Input= $INput1 EndIf If $tempID = $input2 Then $input = $input2 EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input,GUICtrlRead($Input)&"Hello") EndSwitch WEnd Link to comment Share on other sites More sharing options...
Nahuel Posted October 5, 2007 Share Posted October 5, 2007 Ohh yeah that works great Btw, I just figured out what TY means haha.. I'm so lame. Link to comment Share on other sites More sharing options...
Komawoyo Posted October 5, 2007 Author Share Posted October 5, 2007 (edited) Ohh yeah that works great Btw, I just figured out what TY means haha.. I'm so lame.hey!!, do you know how to get it to send if my buttons and inputbox where in different Guis? Edited October 5, 2007 by Komawoyo Link to comment Share on other sites More sharing options...
Nahuel Posted October 5, 2007 Share Posted October 5, 2007 expandcollapse popup#include <GUIConstants.au3> #include <_ControlHover.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 296, 231, 100, 135) $Button1 = GUICtrlCreateButton("Hello", 32, 184, 225, 25, 0) $Input1 = GUICtrlCreateInput("", 40, 64, 201, 21) $Input2 = GUICtrlCreateInput("", 40, 94, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Form2", 296, 231, 300, 135,-1,-1,$Form1) $Input3 = GUICtrlCreateInput("", 40, 64, 201, 21) $Input4 = GUICtrlCreateInput("", 40, 94, 201, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### _ControlHover(2, "", $Input1); add controls here _ControlHover(2, "", $Input2); add controls here _ControlHover(2, "", $Input3); add controls here _ControlHover(2, "", $Input4); add controls here $input=$input1 While 1 Sleep(25) $Over = _ControlHover(0, $Form1); or _ControlHover() - or _ControlHover(0) ; or _ControlHover() - or _ControlHover(0) If $Over = 1 Then $tempID = @extended If $tempID = $input1 Then $Input= $INput1 EndIf If $tempID = $input2 Then $input = $input2 EndIf EndIf $Over2 = _ControlHover(0, $Form2) If $Over2 = 1 Then $tempID1 = @extended If $tempID1 = $input3 Then $Input= $INput3 EndIf If $tempID1 = $input4 Then $input = $input4 EndIf EndIf $nMsg = GUIGetMsg(1) Switch $nMsg[0] Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetData($Input,GUICtrlRead($Input)&"Hello") EndSwitch WEnd Link to comment Share on other sites More sharing options...
BrettF Posted October 5, 2007 Share Posted October 5, 2007 hey!!, do you know how to get it to send if my buttons and inputbox where in different Guis?ControlSend should do the job. Use AutoIt V3 Info tool to get the control names... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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