hta項目文件結構
【項目文件夾】
├ 【source】
│ ├ 要執(zhí)行的hta文件.hta
│ └ 要給這個hta使用的icon圖標.ico
└ 【其他項目需要的目錄(與設置hta圖標無關)】
設置hta的標題欄和狀態(tài)欄圖標
在hta文件的
ICON="要給這個hta使用的icon圖標.ico"
設置hta的顯示圖標
給hta設置顯示圖標目前為止貌似都沒有直接的方式,網(wǎng)上搜索到一些方式:
exeScript
使用exeScript必須是ANSI格式才行,否則亂碼,而且轉換成exe后不能支持AJAX的后臺操作,會彈出IE窗口,失敗...
Netbox
沒有試過
WinRar
突破就是它了!
實現(xiàn)原理:利用WinRar的創(chuàng)建自解壓格式壓縮文件來打包hta項目包并且給創(chuàng)建后的文件添加一個ICON圖標
1.在【項目文件夾】上點右鍵,選擇WinRar選項中的“添加到壓縮文件”
2.在彈出的對話框【壓縮選項】中勾選“創(chuàng)建自解壓格式壓縮文件”
3.切換到【高級】選項卡,單擊“自解壓選項”
4.在【自解壓選項】對話框中進行如下操作:
4.1 在“解壓路徑”中填寫一個預計客戶端存在的路徑,如:c:\
4.2 在“解壓后運行”中填寫我們那個hta文件解壓后的路徑,如:c:\項目文件夾\要執(zhí)行的hta文件.hta
4.3 切換到【模式】選項卡,在“安靜模式”中選中“全部隱藏”,在“覆蓋方式”中選中“跳過已經(jīng)存在的文件”
4.4 切換到【文本和圖標】選項卡,在“從文件加載自解壓文件圖標”中點【瀏覽】按鈕,選擇我們要使用的hta圖標ICON文件,如:在彈出的圖標文件選擇框中打開【項目文件夾】->【source】,然后選中“要給這個hta使用的icon圖標.ico”這個圖標
4.5 確定
5. 確定
執(zhí)行完上述操作后,將會生成一個顯示著我們要使用的圖標的exe文件,雙擊執(zhí)行看看,馬上就彈出了我們要執(zhí)行的那個hta文件,看它的標題欄和狀態(tài)欄圖標,也OK了,最終,蒙混過關。
如果大家發(fā)現(xiàn)其他更好的給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).
設置是否顯示系統(tǒng)的幾個按鈕,最大化,最小化
值為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