分享

如何有效修改Hta显示的Icon图标和Hta标题栏状态栏图标_网页设计_中国站长站 CHI...

 张青 2010-02-08

如何有效修改Hta显示的Icon图标和Hta标题栏状态栏图标

因项目需求,需要制作一个客户端工具,由于开发时间的原因,我们选择使用hta的方式来开发,一切进展顺利,美中不足就是hta的icon显示图标不太美观,更惨的是它没有更换图标的选项,经过一番搜索实践,终于改变了hta的icon显示图标,当然,hta的标题栏和状态栏图标设置就很简单了!

hta项目文件结构

【项目文件夹】

├ 【source】

│ ├ 要执行的hta文件.hta

│ └ 要给这个hta使用的icon图标.ico

└ 【其他项目需要的目录(与设置hta图标无关)】

设置hta的标题栏和状态栏图标

在hta文件的中添加如下属性:

ICON="要给这个hta使用的icon图标.ico"

设置hta的显示图标

给hta设置显示图标目前为止貌似都没有直接的方式,网上搜索到一些方式:

exeScript

使用exeScript必须是ANSI格式才行,否则乱码,而且转换成exe后不能支持AJAX的后台操作,会弹出IE窗口,失败...

Netbox

没有试过

WinRar

突破就是它了!

实现原理:利用WinRar的创建自解压格式压缩文件来打包hta项目包并且给创建后的文件添加一个ICON图标

1.在【项目文件夹】上点右键,选择WinRar选项中的“添加到压缩文件”

2.在弹出的对话框【压缩选项】中勾选“创建自解压格式压缩文件”

3.切换到【高级】选项卡,单击“自解压选项”

4.在【自解压选项】对话框中进行如下操作:

4.1 在“解压路径”中填写一个预计客户端存在的路径,如:c:\

4.2 在“解压后运行”中填写我们那个hta文件解压后的路径,如:c:\项目文件夹\要执行的hta文件.hta

4.3 切换到【模式】选项卡,在“安静模式”中选中“全部隐藏”,在“覆盖方式”中选中“跳过已经存在的文件”

4.4 切换到【文本和图标】选项卡,在“从文件加载自解压文件图标”中点【浏览】按钮,选择我们要使用的hta图标ICON文件,如:在弹出的图标文件选择框中打开【项目文件夹】->【source】,然后选中“要给这个hta使用的icon图标.ico”这个图标

4.5 确定

5. 确定

执行完上述操作后,将会生成一个显示着我们要使用的图标的exe文件,双击执行看看,马上就弹出了我们要执行的那个hta文件,看它的标题栏和状态栏图标,也OK了,最终,蒙混过关。

如果大家发现其他更好的给hta文件更改显示图标的方式,还望共享学习一下!

参考:属性介绍

该标签需写入到内,写法形如:

 

ID="W3CGROUP"

属性="属性值"

>

applicationName

Sets or retrieves the name of the HTML Application (HTA).

设置或者获取HTA的名称

值:自定义

border

Sets or retrieves the type of window border for the HTML Application (HTA).

设置边框模式

值为:thick/thin/dialog/none

borderStyle

Sets or retrieves the style set for the content border within the HTML Application (HTA) window.

设置边框样式

值为:normal/complex/raised/static/sunken

caption

Sets or retrieves a Boolean value that indicates whether the window is set to display a title bar or caption, for the HTML Application (HTA).

是否显示标题栏

值为yes/no

commandLine

Retrieves the argument used to launch the HTML Application (HTA).

用于获取当前HTA应用程序的路径

contextMenu

Sets or retrieves whether the context menu is displayed when the right mouse button is clicked.

设置或者获取反键菜单是否可用

值为yes/no

icon

Sets or retrieves the name and location of the icon specified in the HTML Application (HTA).

设置HTA的图标路径

值为一个图标路径

innerBorder

Sets or retrieves whether the inside 3-D border is displayed.

是否显示内边框

值为yes/no

maximizeButton

Sets or retrieves a Boolean value that indicates whether a Maximize button is displayed in the title bar of the HTML Application (HTA) window.

是否显示最大化按钮

值为yes/no

minimizeButton

Sets or retrieves a Boolean value that indicates whether a Minimize button is displayed in the title bar of the HTML Application (HTA) window.

是否显示最小化按钮

值为yes/no

navigable

Sets or retrieves whether linked documents will be loaded in the main HTA window or in a new browser window.

设置HTA程序中的链接是在浏览器中打开,还是

在当前窗口打开.

值为yes/no

scroll

Sets or retrieves whether the scroll bars are displayed.

是否显示滚动条

值为yes/no/auto

scrollFlat

Sets or retrieves whether the scroll bar is 3-D or flat.

设置滚动条是3D样式的,还是2D平板样式

值为yes/no

selection

Sets or retrieves whether the content can be selected with the mouse or keyboard.

设置HTA中的文字是否可选

值为yes/no

showInTaskBar

Sets or retrieves a value that indicates whether the HTML Application (HTA) is displayed in the Windows taskbar.

设置HTA是否显示在任务栏上

值为yes/no

singleInstance

Sets or retrieves a value that indicates whether only one instance of the specified HTML Application (HTA) can run at a time.

设置同一个HTA能否以多窗口模式打开

值为yes/no

sysMenu

Sets or retrieves a Boolean value that indicates whether a system menu is displayed in the HTML Application (HTA).

设置是否显示系统的几个按钮,最大化,最小化

值为yes/no

version

Sets or retrieves the version number of the HTML Application (HTA).

设置HTA版本信息

windowState

Sets or retrieves the initial size of the HTA window.

设置HTA打开时的模式

值为normal/maximize/minimize

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多