Code: Select all
#Singleinstance force
html=
(
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html {overflow:hidden}
body {background:#AAAAAA;}
.first {background: #AAAAAA; color: #111111;}
.second {background: #111111; color: #AAAAAA;}
</style>
</head>
<body>
<button class='first' id='stuff' value='1'>Button 1</button>
<button class='second'id='stuff' value='2'>Button 2</button>
</body>
</html>
)
Gui,Margin,0,0
Gui, Add, ActiveX, W400 H300 x0 y0 vdoc, HTMLFile
doc.write(html)
add_ButtonHandler()
gui, show
return
add_ButtonHandler() {
global
Loop % doc.getElementsByTagName("Button").length
ComObjConnect(b_%A_Index%:=doc.getElementsByTagName("Button")[A_Index-1], b_%A_Index%.GetAttribute("Id") "_")
}
stuff_OnClick() {
;get the contents of the values from a button here
MsgBox A
}