"Inputting" GUI input into a program

Get help with using AutoHotkey and its commands and hotkeys
Posts: 1
Joined: 10 Jan 2020, 00:49

"Inputting" GUI input into a program

10 Jan 2020, 01:23

Hi Guys, new here, yay.

I've done a smattering of coding over the years but I'm really first encountering a lot of the language in AHK while trying to learn how to use it. Like a lot of people I learn by doing not reading >.<

I'm attempting to setup a GUI which will work as follows..
  • Person types #AHK into a text box in a program.
  • GUI window pops up.
  • Person reads instructions , types some things into certain Input Boxes in the GUI, presses GUI button.
  • Text is printed into the original text box, including the text put in the Input Box.
I hope that makes sense.

So far I've been able create input in other hotkeys, as well as making the gui and the buttons, but I can't work out how to take the text from the input box and put it into the text.
User avatar
Posts: 1446
Joined: 19 Dec 2013, 11:16
Location: USA

Re: "Inputting" GUI input into a program

10 Jan 2020, 09:08

Try this:

Code: Select all

#SingleInstance, Force

Gui, Margin, 10, 10
Gui, Add, Edit, w200 r1 vEdit1
Gui, Add, Edit, w200 r1 vEdit2
Gui, Add, Edit, w200 r1 vEdit3
Gui, Add, Edit, w200 r1 vEdit4
Gui, Add, Edit, w200 r1 vEdit5
Gui, Add, Button, w200 r1 gSubmitForm, OK
Gui, Show, Hide Autosize, Example

	Gui, Submit
	Str := "Field 1: " Edit1 "`nField 2: " Edit2 "`nField 3: " Edit3 "`nField 4: " Edit4 "`nField 5: " Edit5
	Send, % Str

	Gui, Show
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], mikeyww, thebbandit and 44 guests