HtmDlg() [v0.51]

作者: SKAN 最近更新时间: 20100713


HtmDlg() works very much like MsgBox but with one difference and a couple of advantages. The difference is that: HtmDlg() needs a HTM file/URL unlike MsgBox which accepts plain text. The two advantages are:

1) HtmDlg() uses webcontrol to display message which offers vast text formatting capabilities.
2) HtmDlg() offers 9 user-definable, fully customizable buttons.

HtmDlg( _URL="", _Owner=0, _Options="", _ODL="," )

关于函数的参数和返回值, 请参阅其源码或 此文档.

备注

The library lacks an external documentation. The textfile is extracted from the header and bottom of source.

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?t=60215

许可

不存在

示例

; #Include HtmDlg.ahk
#NoEnv
SendMode Input
#SingleInstance, Force
SetWorkingDir %A_ScriptDir% 

bgcolor := GetSysColor(15)  ; Window Background color for the current desktop theme

FileDelete, demo.htm
FileAppend,
( Join

This area of this Dialogbox uses HTM which means you can format you r message using Italics, Bold, Colors and all other formatting HTML permits.

Please note that this webcontrol mimics a static control using these workarounds:
1) Your comput er system's window color is %bgcolor%, and is being used as the bgcolor of HTM so a s to simulate transparency.
2)
This control has been disabled and so you cannot select/copy text.
3)
The vertical scrollbar is just outside the client-area of this dialog.

Do you like this MessageBox?

) , demo.htm URL=file:///%A_ScriptDir%\demo.htm Options := "Buttons=Yes/No/50-50, HtmW=360, HtmH=260, BEsc=3" Sel := HtmDlg( URL, "", Options ) Return ; // end of auto-execute section // GetSysColor( DisplayElement=1 ) { VarSetCapacity( HexClr,7,0 ), SClr := DllCall( "GetSysColor", UInt,DisplayElement ) RGB := ( ( ( SClr & 0xFF) << 16 ) | ( SClr & 0xFF00 ) | ( ( SClr & 0xFF0000 ) >> 16 ) ) DllCall( "msvcrt\sprintf", Str,HexClr, Str,"%06X", UInt,RGB ) Return HexClr }