Gui data input

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Gui data input

18 Jul 2018, 01:03

Guys, hello. Is it possible to send all commands from the keyboard to GUI Edit when it is even inactive?

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

SendMessage, 0x50,, 0x4090409,, A 

Gui, +AlwaysOnTop +LastFound -Caption ;+ToolWindow 
Gui, Add, Edit, Password  x10 y9 w180 h20 vtest1, %password%
Gui, add, button, Default,GO
WinSet, TransColor, %CustomColor% 90
Gui, Show, x1400y800 w200 h36, InputBox 
;Gui, Show, x1080y980 w200 h36, InputBox 
return

ButtonGO:
gui, submit, nohide
Run % LTrim(test1, "start "" /min "),,hide
send ^{A}
;Gui, Destroy
return

Esc::ExitApp
Last edited by inseption86 on 18 Jul 2018, 04:56, edited 1 time in total.
Ridwan
Posts: 144
Joined: 17 Oct 2015, 21:06
Location: Indonesia

Re: Gui data input

18 Jul 2018, 03:45

Yes, you can get the ClassNN with Window spy and use it for ControlSend command.
Ridwan
Posts: 144
Joined: 17 Oct 2015, 21:06
Location: Indonesia

Re: Gui data input

18 Jul 2018, 04:38

You can use this line of code (launch it with Ctrl+J)

Code: Select all

^j::ControlSend, Edit1, Ok, InputBox
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Re: Gui data input

18 Jul 2018, 04:56

I have QR scanner, how to nibble ControlSend in my code?
Ridwan
Posts: 144
Joined: 17 Oct 2015, 21:06
Location: Indonesia

Re: Gui data input

18 Jul 2018, 05:28

I don't really sure that i understand the problem, is it something like you scan a QR code using QR scanner device than it send the result to the PC, but you also want the result to the GUI Edit field too?
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Re: Gui data input

18 Jul 2018, 05:48

Yes, i scaned qr-code, for example,

Code: Select all

 start "" /min C:\Users\Desktop\1.bat
, starts abobe reader, if bat file finish, then gui edit active and i scaned again qr code. But i want scaned qr code
when abobe reader active - gui edit not working Until I click on his window
explorer.exe - disable
Sorry my english!
Ridwan
Posts: 144
Joined: 17 Oct 2015, 21:06
Location: Indonesia

Re: Gui data input

18 Jul 2018, 06:10

Just an example, this code send the key (A until Z) to the Gui Edit if they are typed, even if the InputBox window are minimized.
You can tweak this code as needed.

Code: Select all

~*a::ControlSend, Edit1, a, InputBox
~*b::ControlSend, Edit1, b, InputBox
~*c::ControlSend, Edit1, c, InputBox
~*d::ControlSend, Edit1, d, InputBox
~*e::ControlSend, Edit1, e, InputBox
~*f::ControlSend, Edit1, f, InputBox
~*g::ControlSend, Edit1, g, InputBox
~*h::ControlSend, Edit1, h, InputBox
~*i::ControlSend, Edit1, i, InputBox
~*j::ControlSend, Edit1, j, InputBox
~*k::ControlSend, Edit1, k, InputBox
~*l::ControlSend, Edit1, l, InputBox
~*m::ControlSend, Edit1, m, InputBox
~*n::ControlSend, Edit1, n, InputBox
~*o::ControlSend, Edit1, o, InputBox
~*p::ControlSend, Edit1, p, InputBox
~*q::ControlSend, Edit1, q, InputBox
~*r::ControlSend, Edit1, r, InputBox
~*s::ControlSend, Edit1, s, InputBox
~*t::ControlSend, Edit1, t, InputBox
~*u::ControlSend, Edit1, u, InputBox
~*v::ControlSend, Edit1, v, InputBox
~*w::ControlSend, Edit1, w, InputBox
~*x::ControlSend, Edit1, x, InputBox
~*y::ControlSend, Edit1, y, InputBox
~*z::ControlSend, Edit1, z, InputBox
inseption86
Posts: 203
Joined: 19 Apr 2018, 00:24

Re: Gui data input

19 Jul 2018, 03:18

Please explain how it works, I have the codes, example - C:\Users\user\Desktop\Test\RVP\Instruction_RVP.bat, C:\Users\webt2182\Desktop\Test\VZ\Istoria\istoria2_VZ.bat........

Code: Select all

Loop 10
   Hotkey, % "$~" A_Index-1, BarCodeHandler, on
BarCodeHandler:
Accu .= SubStr(A_ThisHotkey, 0)
If Strlen(Accu) > 1 && A_TimeSincePriorHotkey < 60
   SetTimer, TheBigShebang, -60
If (A_TimeSincePriorHotkey > 100)
   Accu := SubStr(A_ThisHotkey, 0)
return
TheBigShebang:
If Accu
   msgbox You scanned barcode %Accu%
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: jaka1, ReyAHK, Rohwedder and 314 guests