#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #include WS_DEControl2.ahk If (!WS_Initialize("VBScript")) { Msgbox % "Error initializing EasyScript" ExitApp } InitComControls() Gui, +Resize +LastFound +theme Gui, Add, Button, x0 y0 gSetBold, Bold Gui, Add, Button, xp+40 gSetItalic,italic Gui, Add, Button, xp+50 gSetUnderLine, underline gui, Add, Button, xp+75 gSetBlue, Blue Gui, Add, Button, xp+40 gSetImageLink, Image Gui, Add, Button, xp+50 gSetHyperLink, Link Gui, Add, Button, xp+50 gLoadUrl, LoadURL Gui, Add, Button, xp+70 gGetDocument, GetHtml gui, add, button, xp+70 gSetDocument, SetHtml Gui, Add, button, xp+70 gSaveDocument, SaveHtml Gui, Add, button, xp+80 gBrowseMode, BrowseMode Toggle Gui, add, button, x0 yp+25 gSetFontName, SetFontName Gui, add, button, xp+90 gSetFontSize, SetFontSize Gui, add, button, xp+90 gSetFont, SetFont Gui, add, button, xp+50 gList1, List1 Gui, add, button, xp+50 gList2, List2 gui, Add, Button, xp+50 gInsertTable, InsertTable Gui, add, button, xp+140 gNewDocument, New Gui, add, button, xp+40 gFindText, FindText Gui, add, button, xp+70 gSetBackColor, SetBackColor Gui, Show, w800 h600 Center, DhtmlEdit_Test hWnd := WinExist() ; Create the COM control ppvDEdit := DE_Add(hWnd, 0, 50, 800, 550) Gosub, SetDocument Return ; end of auto-run 1:: msgbox, % GetSelection() return SetBold: DE_SetBold() Return SetItalic: DE_SetItalic() Return SetBlue: ;DE_SetForeColor(DEdit, "0000FF") DE_SetForeColor("Blue") ; possible way ;DE_SetForeColor(pDHtmlEdit, "#0000FF") ; also possible Return SetUnderline: DE_SetUnderline() Return SetImageLink: DE_SetImage() Return SetHyperLink: DE_SetHyperLink() Return LoadUrl: url := "http://www.autohotkey.com" DE_LoadUrl(url) Return NewDocument: DE_NewDocument() Return SaveDocument: Filedir = %A_ScriptDir%\DhtmlEdit_%A_Now%.htm DE_SaveDocument(FileDir) Return GetDocument: msgbox, % DE_GetDocumentHtml() Return SetDocument: htmlcode = (
Forgive my poor coding style! Yes?
This File is Edited with
DhtmlEdit_Demo
.
| This is a table and the right image is directly from AutoHotKey Forum. |
![]() |