Grovkillen wrote:I'm hammering away on this subject:
If this is ever implemented it would be great if the Message>, MessageModal>, Ask> and Input> would be HTML enabled. Alot of time I use these to inform users about errors and or update information etc. etc. and today they are really gray... It would be awesome to have them pimped with HTML and clickable links, blinking text, pictures etc. without the need to make a CustomDialog. Thanks for reading!
You can use a HTML Application (HTA) as previously mentioned to display your content. This will give you full control of how to display your content. Your imagination is the limit.
Here are 2 examples. One opens a HTA window with your HTML/CSS code the other opens the same HTA window inside a dialog.
HTA window only
Code: Select all
Let>HTMLCode=
ConCat>HTMLCode,%CRLF%<head>
ConCat>HTMLCode,%CRLF%<title>HTA Dialog Example</title>
ConCat>HTMLCode,%CRLF%<script>
//Set size of hta window
ConCat>HTMLCode,%CRLF%window.resizeTo(500, 350);
ConCat>HTMLCode,%CRLF%</script>
//Set hta properties (Source: http://msdn.microsoft.com/en-us/library/ms536495%28v=VS.85%29.aspx)
ConCat>HTMLCode,%CRLF%<HTA:APPLICATION
ConCat>HTMLCode,%CRLF%ID=oHTA
ConCat>HTMLCode,%CRLF%CAPTION="yes"
ConCat>HTMLCode,%CRLF%ICON="http://www.mjtnet.com/favicon.ico"
ConCat>HTMLCode,%CRLF%CONTEXTMENU="no"
ConCat>HTMLCode,%CRLF%SHOWINTASKBAR="yes"
ConCat>HTMLCode,%CRLF%NAVIGABLE="no"
ConCat>HTMLCode,%CRLF%MINIMIZEBUTTON="no"
ConCat>HTMLCode,%CRLF%MAXIMIZEBUTTON="no"
ConCat>HTMLCode,%CRLF%SCROLL="no"
ConCat>HTMLCode,%CRLF%WINDOWSTATE="normal" />
ConCat>HTMLCode,%CRLF%</head>
//Your HTML/CSS/JavaScript codes here
ConCat>HTMLCode,%CRLF%<a href="http://www.mjtnet.com/usergroup/"><img border="0" src="http://www.mjtnet.com/images/logotype.png"></a>
ConCat>HTMLCode,%CRLF%<ul>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/index.htm">Home</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/automation-software.htm">Products</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/sales.htm">Buy Now</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/downloads.htm">Downloads</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/support.htm">Support</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/about.htm">About Us</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/blog/">Blog</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/usergroup/">Forums</a></li>
ConCat>HTMLCode,%CRLF%</ul>
//Load HTA window
DeleteFile>%TEMP_DIR%ExampleDialog.hta
WriteLn>%TEMP_DIR%ExampleDialog.hta,r,%HTMLCode%
Exe>%TEMP_DIR%ExampleDialog.hta
HTA window inside a dialog
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 511
Top = 162
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 368
ClientWidth = 502
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object MSButton1: tMSButton
Left = 8
Top = 328
Width = 97
Height = 25
Caption = 'Load Some Info'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,CreateHTA
AddDialogHandler>Dialog1,,OnClose,ExitScript
Show>Dialog1,
SRT>CreateHTA
IfWindowOpen>HTA Dialog Example
CloseWindow>HTA Dialog Example
ENDIF
Let>HTMLCode=
ConCat>HTMLCode,%CRLF%<head>
ConCat>HTMLCode,%CRLF%<title>HTA Dialog Example</title>
ConCat>HTMLCode,%CRLF%<script>
//Set size of hta window
ConCat>HTMLCode,%CRLF%window.resizeTo(500, 300);
//Load hta window off screen
ConCat>HTMLCode,%CRLF%window.moveTo(-5000, -5000);
ConCat>HTMLCode,%CRLF%</script>
//Set hta properties (Source: http://msdn.microsoft.com/en-us/library/ms536495%28v=VS.85%29.aspx)
ConCat>HTMLCode,%CRLF%<HTA:APPLICATION
ConCat>HTMLCode,%CRLF%ID=oHTA
ConCat>HTMLCode,%CRLF%CAPTION="no"
ConCat>HTMLCode,%CRLF%ICON="http://www.mjtnet.com/favicon.ico"
ConCat>HTMLCode,%CRLF%CONTEXTMENU="no"
ConCat>HTMLCode,%CRLF%SHOWINTASKBAR="yes"
ConCat>HTMLCode,%CRLF%NAVIGABLE="no"
ConCat>HTMLCode,%CRLF%MINIMIZEBUTTON="no"
ConCat>HTMLCode,%CRLF%MAXIMIZEBUTTON="no"
ConCat>HTMLCode,%CRLF%SCROLL="no"
ConCat>HTMLCode,%CRLF%WINDOWSTATE="normal" />
ConCat>HTMLCode,%CRLF%</head>
//Your HTML/CSS/JavaScript codes here
ConCat>HTMLCode,%CRLF%<a href="http://www.mjtnet.com/usergroup/"><img border="0" src="http://www.mjtnet.com/images/logotype.png"></a>
ConCat>HTMLCode,%CRLF%<ul>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/index.htm">Home</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/automation-software.htm">Products</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/sales.htm">Buy Now</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/downloads.htm">Downloads</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/support.htm">Support</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/about.htm">About Us</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/blog/">Blog</a></li>
ConCat>HTMLCode,%CRLF%<li><a href="http://www.mjtnet.com/usergroup/">Forums</a></li>
ConCat>HTMLCode,%CRLF%</ul>
//Load HTA window inside Dialog1
DeleteFile>%TEMP_DIR%ExampleDialog.hta
WriteLn>%TEMP_DIR%ExampleDialog.hta,r,%HTMLCode%
Exe>%TEMP_DIR%ExampleDialog.hta
WaitWindowOpen>HTA Dialog Example
GetWindowHandle>HTA Dialog Example,hIEWnd
LibFunc>user32,SetParent,r,hIEWnd,DIALOG1.HANDLE
LibFunc>user32,SetWindowLongA,sres,hIEWnd,-16,524288
SetFocus>HTA Dialog Example
MoveWindow>HTA Dialog Example,0,0
END>CreateHTA
SRT>ExitScript
IfWindowOpen>HTA Dialog Example
CloseWindow>HTA Dialog Example
Del>%TEMP_DIR%ExampleDialog.hta
ENDIF
Exit>1
END>ExitScript