forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


HTA Support (HTML)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Aug 06, 2003 2:08 pm    Post subject: HTA Support (HTML) Reply with quote

Hello all,

I've made a script which adds HTA support to VDS. This way you can easily add some credits, sourcecode or helpfiles to your VDS program. You can use HTA just like you use HTML, the only difference is that you need to add some headers.

You can download the HTA script here.

You can get info about HTA and more here:
http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

Please note that people need to have Microsoft Internet Explorer 4 or higher installed. I believe all DLLs which add HTML support to VDS have these requirements as well.

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Aug 06, 2003 11:13 pm    Post subject: Reply with quote

Nice work Skit. This could be used as a browser element, though it wouldn't
have all of the features, but it looks very nice and doesn't need a DLL.

Here's the contents of the script in case anybody wants to see it without
having to download it:

Code:
# Script by Skit3000
# Important notes: Users need Internet Explorer 4 or later!
#                  HTA can be real powerful. Watch out with
#                  when using scripts from others you don't
#                  understand

# For more info, visit:
# http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

# -------------------------------------------------- #
# Use the #define command to add the command to VDS. #
# -------------------------------------------------- #

#define command,hta
#define function,hta

  # -------------------------------- #
  # Just create a normal VDS window. #
  # -------------------------------- #
 
  DIALOG CREATE,HTA Test Window,-1,0,306,233
  DIALOG ADD,BUTTON,GetTitle,205,3,300,25,Get the titlebar value...
  DIALOG SHOW

# Create a list which holds the HTA code. Basicly this
# is just HTML code, you only have to add some headers
# Normaly the headers below are the right ones. For
# others, go to the MSDN Library:
# http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

# You can edit everything between <BODY> and </BODY>

list create,1
list loadtext,1
"<HEAD>
"
"  <TITLE>The HTA Title</TITLE>
"
"  <HTA:APPLICATION
"
"    Don't change these headers!
"    ---------------------------
"
"    BORDER='none'
"    CAPTION='no'
"    SINGLEINSTANCE='yes'
"    WINDOWSTATE='normal'
"    SYSMENU='yes'
"
"    The headers below can be changed.
"    ---------------------------------
"
"    CONTEXTMENU='no'
"    INNERBORDER='yes'
"    NAVIGABLE='yes'
"    SELECTION='yes'
"    SHOWINTASKBAR='no'>
"
"</HEAD>
"
"<!-- Here the BODY parts start. You can modify whatever you want... :-) -->
"
"<BODY>
"
"<p><font face='Courier New' size='2'><font color='#FF0000'><b>#define</b></font>
"<font color='#0000FF'>function,reverse<br>
"</font><br>
"<b><font color='#000080'>:reverse</font></b><br>
"<b> repeat</b><br>
"&nbsp; <font color='#FF0000'>%x</font> = <b>@substr</b>(<font color='#FF0000'>%1</font>,<font color='#FF00FF'>1</font>,<font color='#FF00FF'>1</font>)<font color='#FF0000'>%x</font><br>
"&nbsp; <font color='#FF0000'>%1</font> = <b>@strdel</b>(<font color='#FF0000'>%1</font>,<font color='#FF00FF'>1</font>,<font color='#FF00FF'>1</font>)<br>
"<b> until</b> <b>@equal</b>(<b>@len</b>(<font color='#FF0000'>%1</font>)<b>,</b><font color='#FF00FF'>0</font>)<br>
"<b> exit</b> <font color='#FF0000'> %x</font></font></p>
"
"<p><font face='Verdana' size='1'><center><a href='http://www.vdsworld.com/'>Visit VDSWORLD</a></center></font>
"
"</BODY>

# Usage: hta create,top,left,width,hight,title,list
# Title: The title you gave the file between <TITLE> and </TITLE>. The best
# way is to use a random title, so the code can easily recognize it.
# List: The list number which holds the file.
hta create,3,3,300,200,"The HTA Title",1

# Use the following line to obtain the HTA's Window Handle, which the
# @hta(GetTitle) needs to retreive the current title.
%%handle1 = @hta(LastHandle)

# You can now close the list.
list close,1

:Evloop
wait event
goto @event()

:GetTitleBUTTON
info Current title: @hta(GetTitle,%%handle1)
goto evloop

:Close
# You don't need to send a special 'close' command, because the HTA
# window is a child window of this program. I only added the close command
# so you can see which command you need to close the HTA window when
# running your program.
hta close,%%handle1
info HTA window closed. Bye!
exit



# --------------------------------------------------------------- #
# Include this into all your programs which need HTA support. You #
# can also compile it into a DSU file.                            #
# --------------------------------------------------------------- #

:HTA
option decimalsep,"."

if @equal(%1,create)
  # -------------------------------------------------- #
  # Sytax: hta create,top,left,width,height,title,list #
  # -------------------------------------------------- #
  # Save the list to a file and open it.               
  list savefile,%7,@windir(T)\%6.HTA
  shell open,@windir(T)\%6.HTA
  # -------------------------------------------------- #
  # Wait until the file is opened.
  repeat
  wait 0.00000000000000000001
  until @winexists(%6)
  # -------------------------------------------------- #
  # Once the file is opened, change the position to   
  # the right onces.                                   
  window position,@winexists(%6),%2,%3,%4,%5
  # -------------------------------------------------- #
  # Then set the parent window to the opened VDS       
  # window with the use of the Windows API.           
  loadlib user32
  # This writes the handle to a variable, so you can use it
  # to obtain the titlebar value.
  %%htawindowhandle = @strdel(@winexists(%6),1,1)
  %%tempvariable = @lib(user32,SetParent,INT:,@strdel(@winexists(%6),1,1),@strdel(@win(@dlgtext()),1,1))
  freelib user32
  # -------------------------------------------------- #
  end

if @equal(%1,LastHandle)
  # This passes the handle of the last opened HTA window to
  # the programmer.
  exit "%"%%htawindowhandle
  end

if @equal(%1,GetTitle)
  # This gives the titlebar value of the HTA window.
  exit @wintext(%2)
  end
 
if @equal(%1,Close)
  window close,%2
  end
 
exit

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Aug 07, 2003 4:17 am    Post subject: Reply with quote

Skit3000 Excellent job ! Thumbs Up
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 07, 2003 7:39 am    Post subject: Reply with quote

Thank you both... Smile I'll upload another example soon.... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 07, 2003 7:53 am    Post subject: Reply with quote

Here it is. It shows how to let the HTA program and VDS work together to show info about your system.

Code:
#define command,hta
#define function,hta

  DIALOG CREATE,System Info,-1,0,276,186
  DIALOG SHOW

list create,1
list loadtext,1
"<HEAD>
"
"  <TITLE>The HTA Title</TITLE>
"
"  <HTA:APPLICATION
"
"    Don't change these headers!
"    ---------------------------
"
"    BORDER='none'
"    CAPTION='no'
"    SINGLEINSTANCE='yes'
"    WINDOWSTATE='normal'
"    SYSMENU='yes'
"
"    The headers below can be changed.
"    ---------------------------------
"
"    SCROLL='auto'
"    CONTEXTMENU='no'
"    INNERBORDER='yes'
"    NAVIGABLE='yes'
"    SELECTION='yes'
"    SHOWINTASKBAR='no'>
"
"</HEAD>
"
"<!-- Here the BODY parts start. You can modify whatever you want... :-) -->
"
"<BODY>
"
"<font face='Verdana'><b><small>System info:</b></font><hr size='1'>
"<table border='0' width='100%'>
list add,1,"<tr><td width='55%'><small><font face='Verdana'>Screenwidth:</td><td width='45%'><small><font color='red' face='Verdana'>"@sysinfo(SCREENWIDTH)</td></tr>
list add,1,"<tr><td width='55%'><small><font face='Verdana'>Screenheight:</td><td width='45%'><small><font color='red' face='Verdana'>"@sysinfo(SCREENHEIGHT)</td></tr>
list add,1,"<tr><td width='55%'><small><font face='Verdana'>Pixels per inch:</td><td width='45%'><small><font color='red' face='Verdana'>"@sysinfo(PIXPERIN)</td></tr>
list add,1,"<tr><td width='55%'><small><font face='Verdana'>Windows version:</td><td width='45%'><small><font color='red' face='Verdana'>"@sysinfo(WINVER)</td></tr>
list add,1,"<tr><td width='55%'><small><font face='Verdana'>Additional info:</td><td width='45%'><small><font color='red' face='Verdana'>"@sysinfo(WININFO)</td></tr>
list add,1,</table>
hta create,3,3,270,160,"The HTA Title",1
list close,1


list create,1
list loadtext,1
"<HEAD>
"
"  <TITLE>Madeby banner</TITLE>
"
"  <HTA:APPLICATION
"
"    Don't change these headers!
"    ---------------------------
"
"    BORDER='none'
"    CAPTION='no'
"    SINGLEINSTANCE='yes'
"    WINDOWSTATE='normal'
"    SYSMENU='yes'
"
"    The headers below can be changed.
"    ---------------------------------
"
"    SCROLL='no'
"    CONTEXTMENU='no'
"    INNERBORDER='yes'
"    NAVIGABLE='no'
"    SELECTION='no'>
"
"</HEAD>
"
"<!-- Here the BODY parts start. You can modify whatever you want... :-) -->
"
"<BODY topmargin='1'>
"
"<font face='Verdana' size='1'>
"<marquee scrolldelay='150'>Code made by: Skit 3000</marquee>
"</font>
"
"</BODY>

hta create,163,3,270,20,"Madeby banner",1
list close,1

:Evloop
wait event
goto @event()

:Close
exit



# --------------------------------------------------------------- #
# Include this into all your programs which need HTA support. You #
# can also compile it into a DSU file.                            #
# --------------------------------------------------------------- #

:HTA
option decimalsep,"."

if @equal(%1,create)
  # -------------------------------------------------- #
  # Sytax: hta create,top,left,width,height,title,list #
  # -------------------------------------------------- #
  # Save the list to a file and open it.               
  list savefile,%7,@windir(T)\%6.HTA
  shell open,@windir(T)\%6.HTA
  # -------------------------------------------------- #
  # Wait until the file is opened.
  repeat
  wait 0.00000000000000000001
  until @winexists(%6)
  # -------------------------------------------------- #
  # Once the file is opened, change the position to   
  # the right onces.                                   
  window position,@winexists(%6),%2,%3,%4,%5
  # -------------------------------------------------- #
  # Then set the parent window to the opened VDS       
  # window with the use of the Windows API.           
  loadlib user32
  # This writes the handle to a variable, so you can use it
  # to obtain the titlebar value.
  %%htawindowhandle = @strdel(@winexists(%6),1,1)
  %%tempvariable = @lib(user32,SetParent,INT:,@strdel(@winexists(%6),1,1),@strdel(@win(@dlgtext()),1,1))
  freelib user32
  # -------------------------------------------------- #
  end

if @equal(%1,LastHandle)
  # This passes the handle of the last opened HTA window to
  # the programmer.
  exit "%"%%htawindowhandle
  end

if @equal(%1,GetTitle)
  # This gives the titlebar value of the HTA window.
  exit @wintext(%2)
  end
 
if @equal(%1,Close)
  window close,%2
  end
 
exit

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!


Last edited by Skit3000 on Thu Aug 07, 2003 3:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 07, 2003 8:04 am    Post subject: Reply with quote

With the use of HTA you can also make richtext editors like this one:
http://msdn.microsoft.com/workshop/samples/author/editing/HTML_Editor/HTML_Editor.hta

You can find more info about it here:
http://msdn.microsoft.com/workshop/author/editing/tutorials/html_editor.asp?frame=true

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Aug 07, 2003 9:46 am    Post subject: Reply with quote

Looks cool!

Some people (with another default decimal separator than a point) may need to set
Code:
option decimalsep,"."

in your above code examples to avoid an error.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 07, 2003 1:11 pm    Post subject: Reply with quote

I used to do that, but I think VDS 5 has solved this 'problem'. Confused Normaly I had to put double quotes around the comma, or I had to set the decimalsep to a dot like you said. Did you had any problems with running that code?
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Aug 07, 2003 3:13 pm    Post subject: Reply with quote

Yup, I had problems. The program stopped responding. It was solved after I put in the option decimalsep...

BTW, I have noticed no differences in VDS5 as to this decimalsep thing. Did you?. Are you running Dutch
Win with comma as default separator?

If I try to run something like this:
Code:

rem option decimalsep,"."
wait 0.1
info Done waiting!
EXIT

then the program will give me something like "invalid parameter to command" at the WAIT line.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 07, 2003 3:33 pm    Post subject: Reply with quote

I don't have any problems with your code, while I'm on a Dutch Windows version which uses the comma as default separator. Confused Well, I'll add the option decimalsep to the above code(s). Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Aug 07, 2003 5:26 pm    Post subject: Reply with quote

I tried to supress those little explosions occuring by opening the hta file using ShellExecute API which gives you options for the initial opened window state (just like runh) but I don't know why the thing goes crazy after opening 1 or 2 times it opens as usual and SW_HIDE is ignored Crying or Very sad . I think it is problem with HTML Application host.
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 07, 2003 5:40 pm    Post subject: Reply with quote

I think it's a problem of the HTA file. I also tried the header "windowstate='minimize'", but after that I couldn't get it to work either... Sad
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Aug 07, 2003 5:44 pm    Post subject: Reply with quote

Skit3000 wrote:
I think it's a problem of the HTA file. I also tried the header "windowstate='minimize'", but after that I couldn't get it to work either... Sad


Yes after windowstate='minimize' in header it positions itself wrongly Sad

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Aug 07, 2003 6:03 pm    Post subject: Reply with quote

Skit3000 wrote:
I don't have any problems with your code, while I'm on a Dutch Windows version which uses the comma as default separator. Confused


Strange Insane I get this type of error every time, if I omit the OPTION Decimalsep setting and use
point in figures etc.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Tue Aug 19, 2003 4:42 pm    Post subject: Reply with quote

Ok, The way I have got it to work was to get the current process id, then right before the program closes, Kill the process and no more error. So far it has worked for me. I hope it continues to work as I am making a rather larg program that uses HTA. Confused
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group