Basically I have a GUI which presents a number of buttons, each of which is the name of a country. It looks something like this (in the actual version there are loads more options).
Code: Select all
Gui, Add, Button, w120 h40 gAlbania, Albania
Gui, Add, Button, w120 h40 gAustria, Austria
Gui, Add, Button, w120 h40 gBelgium, Belgium
Gui, Add, Button, w120 h40 gBulgaria, Bulgaria
Gui, Add, Button, w120 h40 gCyprus, Cyprus
Gui, Add, Button, w120 h40 gCzechia, Czechia
Gui, Show
Return
Code: Select all
Albania:
DoUrl( "Albania" )
Austria:
DoUrl( "Austria" )
Belgium:
DoUrl( "Belgium" )
Bulgaria:
DoUrl( "Bulgaria" )
Czechia:
DoUrl( "Czechia" )
But this seems very clumsy to me. Is there a simpler way of doing this? Can I have a small snippet which will take the name of the button clicked and send that straight away to the DoUrl function?
Any suggestions more than welcome!