Skip to content

Instantly share code, notes, and snippets.

@musahi0128
Last active May 7, 2022 11:50
Show Gist options
  • Save musahi0128/239dbb81b1ab7dd39c9acada24b3b4a8 to your computer and use it in GitHub Desktop.
Save musahi0128/239dbb81b1ab7dd39c9acada24b3b4a8 to your computer and use it in GitHub Desktop.
Sample codes to make an AutoIT frontend using IE UDF and HTML
#include <GUIConstantsEx.au3>
#include <IE.au3>
$Form1 = GUICreate("HTML Button Test",600,600,-1,-1)
$oIE = _IECreateEmbedded()
$oIE_ctrl = GUICtrlCreateObj($oIE,16,16,568,568)
_IENavigate($oIE, "about:blank")
_IEDocWriteHTML($oIE, "<html><head></head><body scroll=""no"" style=""background:'f0f0f0';border:0;font-family:verdana;font-size:64px"" oncontextmenu=""return false""><input type=""button"" value=""Click me!"" id=""Button1"" style=""width:128;height:128""/></body></html>")
$oButton1 = _IEGetObjById($oIE, "Button1")
ObjEvent($oButton1, "Button1_")
GUISetState(@SW_SHOW,$Form1)
Func Button1_onclick()
MsgBox(0, "HTML Button Test", "Hello world! It works!!!")
EndFunc
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment