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.

Animated GIF in Dialog

 Keywords:  comcontrol mshtml dynamic dialog gif animated display

How to display an animated GIF in a WinBatch Dialog.
;Winbatch - animated GIF in dialog
;
;Stan Littlefield, September 6, 2006
;////////////////////////////////////////////////////////////////////////////////////
#DefineSubRoutine dlgproc(handle,msg,id,p4,p5)

Switch msg
Case 0
DialogProcOptions(handle,2,@TRUE)
; Get the control's object
oGif = DialogObject(handle, 002,3)
oGif.writeln(cHTM)
Return(-1)
Case 2
   Switch id
      Case 001
      Return(0)
   EndSwitch

EndSwitch       ; Exam_Message
Return(-1)      ; Do default processing
#EndSubRoutine   ; End of Dialog Callback ExamProc

cGIF = StrCat(DirScript(),"trex.gif")
If ! FileExist(cGIF) Then Exit
cHTM = StrCat('<html><head>',@CRLF)
cHTM = StrCat(cHTM,'<style type="text/css">',@CRLF)
cHTM = StrCat(cHTM,'<!--',@CRLF)
cHTM = StrCat(cHTM,'body { overflow:hidden; }',@CRLF)
cHTM = StrCat(cHTM,'-->',@CRLF)
cHTM = StrCat(cHTM,'</style>',@CRLF)
cHTM = StrCat(cHTM,'</head><body bgcolor="#FF8000">',@CRLF)
cHTM = StrCat(cHTM,'<img border="0" src="%cGIF%" width="110" height="70" >',@CRLF)
cHTM = StrCat(cHTM,"</body>",@CRLF)
cHTM = StrCat(cHTM,"</html>",@CRLF)

GifFormat=`WWWDLGED,6.1`

GifCaption=`Test GIF`
GifX=002
GifY=061
GifWidth=152
GifHeight=095
GifNumControls=002
GifProcedure=`dlgproc`
GifFont=`Microsoft Sans Serif|6144|70|34`
GifTextColor=`0|0|0`
GifBackground=`DEFAULT,255|128|0`
GifConfig=0

Gif001=`095,033,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,"255|128|0"`
Gif002=`005,007,080,068,COMCONTROL,DEFAULT,"mshtml:",DEFAULT,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("Gif")
Exit

Article ID:   W16938
File Created: 2007:07:03:14:27:06
Last Updated: 2007:07:03:14:27:06