#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Stock000 = GUICreate("Stock000", 1024, 450, 100, 100)
GUISetState(@SW_SHOW)
AdlibRegister("nowtime", 500)
create_gg()
While 1
Sleep(1)
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Func create_gg()
GUISetFont(11)
create_t()
create_f()
AdlibRegister("create_t", 5000)
AdlibRegister("create_f", 1000 * 10)
EndFunc ;==>create_gg
Func create_t()
If WinActive($Stock000) Then
$a = StringReplace(StringRegExpReplace(BinaryToString(InetRead("http://hq.sinajs.cn/list=sh600115", 1)), 'var hq_str_.+="', ''), '"', '')
;指数------------------------------------------------------------
$zs1 = StringReplace(StringRegExpReplace(BinaryToString(InetRead("http://hq.sinajs.cn/list=sh000001,sz399001", 1)), 'var hq_str_.+="', ''), '"', '')
$all = StringSplit($zs1, ';,', 0)
$stock_n = ($all[0] - 1) / 32
Dim $zs[$stock_n][33]
For $i = 0 To $stock_n - 1
For $j = 0 To 31
$zs[$i][$j] = $all[$j + 1 + $i * 32]
$zs[$i][32] = ($zs[$i][3] - $zs[$i][2]) / $zs[$i][2]
Next
Next
;指数------------------------------------------------------------
$b = StringSplit($a, ';,', 0)
$l1 = GUICtrlCreateLabel('时间:' & $b[31] & ' ' & $b[32], 10, 15, 200)
$l2 = GUICtrlCreateLabel('上证指数:' & $zs[0][3] & ' 涨跌:' & Round(($zs[0][3] - $zs[0][2]), 2) & ' / ' & Round((($zs[0][3] - $zs[0][2]) / $zs[0][2]) * 100, 1) & '% ' & Round($zs[0][9] / 100000000, 2) & ' 亿', 10, 40, 380)
$l3 = GUICtrlCreateLabel('深证指数:' & $zs[1][3] & ' 涨跌:' & Round(($zs[1][3] - $zs[1][2]), 2) & ' / ' & Round((($zs[1][3] - $zs[1][2]) / $zs[1][2]) * 100, 1) & '% ' & Round($zs[1][9] / 100000000, 2) & ' 亿', 10, 60, 380)
$l4 = GUICtrlCreateLabel($b[1] & ' ' & $b[4] & ' / ' & Round((($b[4] - $b[3]) / $b[3]) * 100, 1) & '% (' & $b[6] & ' ~ ' & $b[5] & ')成交:' & Round($b[9] / 100000000, 2) & ' 亿', 10, 100, 390)
GUICtrlSetFont($l4, 11, 800, 4)
$l5 = GUICtrlCreateLabel('卖 5(元/手) ' & $b[30] & ' ' & Round($b[29] / 100, 0), 60, 120 + 20, 350)
$l6 = GUICtrlCreateLabel('卖 4(元/手) ' & $b[28] & ' ' & Round($b[27] / 100, 0), 60, 140 + 20, 350)
$l7 = GUICtrlCreateLabel('卖 3(元/手) ' & $b[26] & ' ' & Round($b[25] / 100, 0), 60, 160 + 20, 350)
$l8 = GUICtrlCreateLabel('卖 2(元/手) ' & $b[24] & ' ' & Round($b[23] / 100, 0), 60, 180 + 20, 350)
$l9 = GUICtrlCreateLabel('卖 1(元/手) ' & $b[22] & ' ' & Round($b[21] / 100, 0), 60, 200 + 20, 350)
$l10 = GUICtrlCreateLabel('买 1(元/手) ' & $b[12] & ' ' & Round($b[11] / 100, 0), 60, 240 + 20, 350)
$l11 = GUICtrlCreateLabel('买 2(元/手) ' & $b[14] & ' ' & Round($b[13] / 100, 0), 60, 260 + 20, 350)
$l12 = GUICtrlCreateLabel('买 3(元/手) ' & $b[16] & ' ' & Round($b[15] / 100, 0), 60, 280 + 20, 350)
$l13 = GUICtrlCreateLabel('买 4(元/手) ' & $b[18] & ' ' & Round($b[17] / 100, 0), 60, 300 + 20, 350)
$l14 = GUICtrlCreateLabel('买 5(元/手) ' & $b[20] & ' ' & Round($b[19] / 100, 0), 60, 320 + 20, 350)
EndIf
EndFunc ;==>create_t
Func create_f()
$IE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($IE, 420, 90, 570, 350)
_IENavigate($IE, "http://image.sinajs.cn/newchart/min/n/sh600115.gif")
EndFunc ;==>create_f
Func nowtime()
$TL = @HOUR & ":" & @MIN & ":" & @SEC
WinSetTitle($Stock000, "", $TL)
EndFunc ;==>nowtime