[AHK]用HTML做ahk界面
来源:互联网 发布:microsoft画图软件 编辑:程序博客网 时间:2024/06/07 03:14
;activex gui 2 - test joedf - 2014/09/19;http://ahkscript.org/boards/viewtopic.php?f=7&t=4588&p=26809#p26809 ;~ >Read & Write<;~ Webpage >> AHK;~ AHK >> WebPage#SingleInstance, offOnExit,OnExitHTML_page =( Ltrim Join<!DOCTYPE html><html> <head> <style> body{font-family:sans-serif;background-color:#1A1A1A;color:white} #title{font-size:36px;} input{margin:4px;Border: 2px white solid;background-color:black;color:white;} p{font-size:16px;border:solid 1px #666;padding:4px;} #footer{text-align:center;} </style> </head> <body> <div id="title">Hello World</div> <textarea rows="4" cols="70" id="MyTextBox">1234567890-=\ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$^&*()_+|~</textarea> <p id="footer"> <input type="button" id="MyButton1" value="Show Content in AHK MsgBox"> <input type="button" id="MyButton2" value="Change Content with AHK"> <input type="button" id="MyButton3" value="Greetings from AHK"> </p> </body></html>)Gui Add, ActiveX, x0 y0 w640 h480 vWB, Shell.Explorer ; The final parameter is the name of the ActiveX component.WB.silent := true ;Surpress JS Error boxesDisplay(WB,HTML_page);Wait for IE to load the page, before we connect the event handlerswhile WB.readystate != 4 or WB.busy sleep 10;Use DOM access just like javascript!MyButton1 := wb.document.getElementById("MyButton1")MyButton2 := wb.document.getElementById("MyButton2")MyButton3 := wb.document.getElementById("MyButton3")ComObjConnect(MyButton1, "MyButton1_") ;connect button eventsComObjConnect(MyButton2, "MyButton2_")ComObjConnect(MyButton3, "MyButton3_")Gui Show, w640 h480returnGuiClose:ExitAppOnExit: FileDelete,%A_Temp%\*.DELETEME.html ;clean tmp fileExitApp; Our Event HandlersMyButton1_OnClick() { global wb MsgBox % wb.Document.getElementById("MyTextBox").Value}MyButton2_OnClick() { global wb FormatTime, TimeString, %A_Now%, dddd MMMM d, yyyy HH:mm:ss data := "AHK Version " A_AhkVersion " - " (A_IsUnicode ? "Unicode" : "Ansi") " " (A_PtrSize == 4 ? "32" : "64") "bit`nCurrent time: " TimeString wb.Document.getElementById("MyTextBox").value := data}MyButton3_OnClick() { MsgBox Hello world!};------------------Display(WB,html_str) { Count:=0 while % FileExist(f:=A_Temp "\" A_TickCount A_NowUTC "-tmp" Count ".DELETEME.html") Count+=1 FileAppend,%html_str%,%f% WB.Navigate("file://" . f)}
0 0
- [AHK]用HTML做ahk界面
- AHK
- [AHK]用AHK搭建WEB
- [AHK]用AHK执行JavaScript
- [AHK]用ahk执行VBScript脚本
- html 与 ahk 伪通信
- 用AHK做个强大的在线英语词典
- [AHK]ahk脚本管理器
- [AHK]用ahk来响应双击pdf文件的行为
- AHK教程
- hotkey.ahk
- AHK-----基础
- AHK教程
- AHK常量
- [AHK]F4Menu
- [AHK]GetClassName
- ahk 常见问题
- ahk BlockInput
- ubuntu 修改用户名密码
- 多个AsyncTask执行顺序:并行or串行
- mysql linux c找不到头文件解决办法
- arpspoof 局域网断网攻击
- Java线程Dump分析工具--jstack
- [AHK]用HTML做ahk界面
- js解析json添加到表格并分页
- SQL语句的增删改查
- Android 百度云推送
- 常用SQL优化
- WKWebView添加cookie
- 动态规划 01背包问题(简单易懂)
- MyDocument.exe病毒查杀方法
- 自学iOS开发系列----OC(block)