|
楼主 |
发表于 2009-2-26 15:15:57
|
显示全部楼层
这是一个例子,界面直接用了论坛里一位哥们的代码。
[au3]
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_Icon=C:\Documents and Settings\Administrator\桌面\googleweather.ico
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <_GoogleWeatherSearch.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Google天气查询", 575, 570, 193, 125)
$Group1 = GUICtrlCreateGroup("", 8, 8, 551, 49)
$Label1 = GUICtrlCreateLabel("城 市:", 48, 24, 76, 24, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$Button1 = GUICtrlCreateButton("搜索", 376, 24, 75, 24, 0)
$Input1 = GUICtrlCreateInput("请输入城市中文名称或拼音", 136, 24, 225, 24)
GUICtrlCreateGroup("", -99, -99, 1, 1) ;封闭组框
$oShell = ObjCreate("Shell.Explorer.2")
$GUIActiveX = GUICtrlCreateObj($oShell, 8, 70, 558, 480)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUISetState() ;Show GUI
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$s_q = GUICtrlRead($Input1)
$text = _GoogleWeatherSearchCN($s_q)
If $text = "" Then
MsgBox(8208, "输入错误", "请输入城市中文名称或拼音,并确认网络链接正常")
EndIf
If FileExists(@TempDir & "\Weathertemp.htm") Then
FileDelete(@TempDir & "\Weathertemp.htm")
EndIf
FileWrite(@TempDir & "\Weathertemp.htm", $text)
$oShell.navigate(@TempDir & "\Weathertemp.htm")
EndSwitch
WEnd
GUIDelete()
[/au3]
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|