View previous topic :: View next topic |
Author |
Message |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Aug 06, 2003 11:13 pm Post subject: |
|
|
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>
" <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>
" <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 |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Aug 07, 2003 4:17 am Post subject: |
|
|
Skit3000 Excellent job !  _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Aug 07, 2003 7:53 am Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Aug 07, 2003 9:46 am Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Aug 07, 2003 3:13 pm Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Aug 07, 2003 5:26 pm Post subject: |
|
|
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 . I think it is problem with HTML Application host. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Aug 07, 2003 5:44 pm Post subject: |
|
|
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...  |
Yes after windowstate='minimize' in header it positions itself wrongly  _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Aug 07, 2003 6:03 pm Post subject: |
|
|
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. |
Strange 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 |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1752 Location: Space and Time
|
Posted: Tue Aug 19, 2003 4:42 pm Post subject: |
|
|
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.  _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
 |
|
|
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
|
|