i was about to suggest using v2 since it has on click event handlers, but apparently not for edits. weird. i see no reason why they shouldnt be supported
anyway, heres more v1 code
Code: Select all
ClickableEdits := [GuiAdd("Edit", "w200 ReadOnly", "First text")
, GuiAdd("Edit", "w200 ReadOnly", "Second text")
, GuiAdd("Edit", "w200 ReadOnly", "Third text")]
Gui, Show, autosize
WM_LBUTTONDOWN := 0x201
OnMessage(WM_LBUTTONDOWN, Func("ClickableEditHandler").Bind(ClickableEdits))
ClickableEditHandler(Edits, wParam, lParam, msg, hwnd) {
for each, hwndEdit in Edits
if (hwnd = hwndEdit)
{
GuiControlGet text, , % hwnd
Clipboard := text
return
}
}
GuiAdd(ControlType, Options := "", Text := "", GuiName := "") {
Gui % (GuiName ? GuiName ":Add" : "Add"), % ControlType, % Options " hwndCtrlHwnd", % Text
return CtrlHwnd
}