WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Display Hyperlinks in Dialog


keywords:
hypertext link links hyperlink hyperlinks dialog display

Option 1:

Create a WIL dialog with a button that has a flat appearance. Once the button is selected use Shellexecute to launch the URL.

Sample code:


MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`WIL Dialog 2`
MyDialogX=002
MyDialogY=050
MyDialogWidth=291
MyDialogHeight=084
MyDialogNumControls=003
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`084,055,033,011,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`138,055,034,011,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`062,028,153,011,PUSHBUTTON,DEFAULT,"http://www.winbatch.com",2,3,128,"Microsoft Sans Serif|5325|1040|34","0|0|128",DEFAULT`

ButtonPushed=Dialog("MyDialog")

Switch ButtonPushed
case 0
  exit 
  break
case 1
  Message("Notice", "User pressed Okay")
  break

case 2
  ShellExecute("http://www.winbatch.com","", "", @NORMAL, "")
  break

EndSwitch
exit
Option 2:
;  if you prefer the addressbar/menubars visible, change the
;  @false to @true...

#DefineSubRoutine startMSIE(url)
   Browser = ObjectOpen("InternetExplorer.Application")
   Browser.addressbar = @FALSE
   Browser.statusbar = @FALSE
   Browser.menubar = @FALSE
   Browser.toolbar = @FALSE
   browser.visible = @TRUE
   browser.navigate(url)
   ; wait until page loads...
   WaitForPageLoad()
   ; setup the document object...
   browserDoc = Browser.Document
   all = browserdoc.all
   Return(browser)
#EndSubRoutine

#DefineSubroutine WaitForPageLoad()  ; assume Browser
   While browser.busy || browser.readystate == 1
      TimeDelay(0.5)
   EndWhile
   While browser.Document.ReadyState != "complete"
      TimeDelay(0.5)
   EndWhile
   return
#EndSubroutine



LinkList = "http://www.google.com/|http://www.microsoft.com/|http://www.abebooks.com/|http://www.xml.com/|http://www.norton.com/"
LinkText = "Google|Microsoft Home Page|Abe Books|XML Dot Com|Norton/Symantec"

;message(itemcount(LinkList, "|"), itemcount(LinkText, "|"))

br = startMSIE("about:blank")

For x = 1 To ItemCount(LinkList, "|")
   ThisLink = ItemExtract(x, LinkList, "|")
   ThisText = ItemExtract(x, LinkText, "|")
   OutputLine = StrCat(`<a href="`, ThisLink, `">`, ThisText, `</a><br>`)
   browserdoc.writeln(OutputLine)
Next

Exit

Article ID:   W16421
File Created: 2006:08:09:11:45:42
Last Updated: 2006:08:09:11:45:42