找回密码
 加入
搜索
查看: 3872|回复: 5

[GUI管理] 请高手帮忙整合两段代码【已解决】

[复制链接]
发表于 2014-6-13 20:34:04 | 显示全部楼层 |阅读模式
本帖最后由 autoee 于 2014-6-14 14:04 编辑
#NoTrayIcon
#AutoIt3Wrapper_icon=D:\Program Files\实用程序\autoit3\Aut2Exe\Icons\home2.ico
#AutoIt3Wrapper_outfile=搜索工具条.exe
#AutoIt3Wrapper_Res_Comment=搜索工具条--很好用的哦。
#AutoIt3Wrapper_Res_Description=王彬拙作,多多指教。
#AutoIt3Wrapper_Res_Fileversion=1.0.0.2
#AutoIt3Wrapper_Res_LegalCopyright=王彬拙作,多多指教。
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
 
#include "Misc.au3"
If _Singleton("搜索工具条.exe", 1) = 0 Then Exit
If WinExists("搜索","透") Then Exit
Global $MARk_1 = 0
Global $DEFAULTINPUTDATA_1   = "输入关键词"
Global $NONEAACTIVECOLOR    = 0x989898
 
$sIni = @ScriptDir & "\sousuo.ini"
 
$var = IniReadSection($sIni, "moren")
If @error Then 
IniWrite($sIni, "moren", "moren", "1")
EndIf
$var = IniRead($sIni, "moren","moren","1")
if IsNumber ( $var ) Then
sleep(1)
Else
IniWrite($sIni, "moren", "moren", "1")
EndIf
$var = IniRead($sIni, "moren","moren","1")
 
$vabc = IniReadSection($sIni, "sousuo")
If @error Then 
Dim $abc[4][2] = [ [ "百 度", "http://www.baidu.com/s?wd=" ], [ "谷 歌","http://www.google.cn/search?hl=zh-CN&q=" ], [ "百度mp3","http://mp3.baidu.com/m?ct=134217728&word=" ],["迅 雷","http://search.gougou.com/search?search="]]
IniWriteSection($sIni, "sousuo", $abc, 0)
$vabc = IniReadSection($sIni, "sousuo")
EndIf
 
$vabcd = IniReadSection($sIni, "weizhi")
If @error Then 
Dim $abcd[2][2] = [ [ "w", "200" ], [ "h","0" ]]
IniWriteSection($sIni, "weizhi", $abcd, 0)
$vabcd = IniReadSection($sIni, "weizhi")
EndIf
 
 
$vdd = IniReadSection($sIni, "shezhi")
If @error Then 
Dim $ddc[2][2] = [ [ "touming", "0" ], [ "shousuo","0" ]]
IniWriteSection($sIni, "shezhi", $ddc, 0)
$vdd = IniReadSection($sIni, "shezhi")
EndIf
 
$Form1 = GUICreate("搜索", @DesktopWidth/4, 20, $vabcd[1][1], $vabcd[2][1], $WS_POPUP, $WS_EX_LAYERED+$WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0xABCDEF)
_API_SetLayeredWindowAttributes($Form1, 0x010101)
 
$Label1 = GUICtrlCreateLabel(" ", 0, 0, 20, 20, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetTip(-1, "点击此处可拖动窗口。")
$Checkbox1 = GUICtrlCreateCheckbox("透", 20, 0, 30, 20)
if $vdd[1][1] = 1 Then
GUICtrlSetState ($Checkbox1, $GUI_CHECKED )
_API_SetLayeredWindowAttributes($Form1, 0xABCDEF)
EndIf
 
$Checkbox2 = GUICtrlCreateCheckbox("缩", 50, 0, 30, 20)
if $vdd[2][1] = 1 Then
GUICtrlSetState ($Checkbox2, $GUI_CHECKED )
EndIf
$Button1 = GUICtrlCreateButton("退", 80, 0, 25, 20, 0)
 
$Input_1 = GUICtrlCreateInput($DEFAULTINPUTDATA_1, 110,0,@DesktopWidth/4-200,20)
GUICtrlSetColor(-1, $NONEAACTIVECOLOR)
$Button2 = GUICtrlCreateButton($vabc[$var][0], @DesktopWidth/4-85,0,70, 20)
GUICtrlSetState($Button2, $GUI_DEFBUTTON)
$Button3 = GUICtrlCreateButton("v", @DesktopWidth/4-15,0,15, 20)
 
 
GUISetState(@SW_SHOW)
 
#EndRegion ### START Koda GUI section ### Form=
While 1
GUICtrlSetState($Button2, $GUI_DEFBUTTON)
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Checkbox1
SoundPlay(@WindowsDir & "\media\Windows XP 开始.wav",0)
                        If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then
IniWrite($sIni, "shezhi", "touming", "1")
                                _API_SetLayeredWindowAttributes($Form1, 0xABCDEF)
 
                        Else
IniWrite($sIni, "shezhi", "touming", "0")
                                _API_SetLayeredWindowAttributes($Form1, 0x010101)
                        EndIf
                Case $Button1
SoundPlay(@WindowsDir & "\media\Windows XP 开始.wav",0)
                        Exit
                Case $Button2
SoundPlay(@WindowsDir & "\media\Windows XP 开始.wav",0)
if GUICtrlRead ( $Input_1, 0) = $DEFAULTINPUTDATA_1 Then
ShellExecute($vabc[$var][1])
Else
ShellExecute($vabc[$var][1] & GUICtrlRead ( $Input_1, 0))
EndIf
Case $Button3
if $var = $vabc[0][0] then 
$var = 1 
Else
$var = $var + 1
EndIf
IniWrite($sIni, "moren", "moren", $var)
$vabc = IniReadSection($sIni, "sousuo")
GUICtrlSetData ( $Button2, $vabc[$var][0])
        EndSwitch
IniWrite($sIni, "moren", "moren", $var)
$size = WinGetPos($Form1)
$pos = MouseGetPos()
if $size[0] < 15 And $size[0] <> 0 then 
                WinMove ( $Form1, "", 0, $size[1], @DesktopWidth/4, 20,1 )
        ElseIf $size[1] < 15 And $size[1] <> 0 then 
                WinMove ( $Form1, "", $size[0], 0,@DesktopWidth/4, 20, 1 )
        Elseif @DesktopHeight-$size[1]-$size[3] < 15 And @DesktopHeight-$size[1]-$size[3] <> 0 then 
                WinMove ( $Form1, "", $size[0], @DesktopHeight-20,@DesktopWidth/4, 20, 1 )
EndIf
 
 
If BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) = $GUI_CHECKED Then
IniWrite($sIni, "shezhi", "shousuo", "1")
        if  Abs ( $pos[0] - $size[0] - $size[2]/2 ) < $size[2]/2 + 15 And Abs ( $pos[1] - $size[1] - $size[3]/2) < $size[3]/2 + 15 Then
                If $size[0]=0 or $size[1]=0 Then
                WinMove ( $Form1, "", $size[0], $size[1], @DesktopWidth/4, 20,1 )
                ElseIf $size[0]+15 = @DesktopWidth and $size[2]=15 Then
                WinMove ( $Form1, "", $size[0]-$var[0][0]*50-115+15, $size[1], @DesktopWidth/4, 20,1 )
                ElseIf $size[1]+3=@DesktopHeight and $size[3]=3 Then
                WinMove ( $Form1, "", $size[0], $size[1]-17, @DesktopWidth/4, 20,1 )
                EndIf
        Elseif $size[0] < 15 then 
                WinMove ( $Form1, "", 0, $size[1], 15, 20,1 )
        ElseIf $size[1] < 15 then 
                WinMove ( $Form1, "", $size[0], 0,@DesktopWidth/4, 3, 1 )
        Elseif @DesktopWidth-$size[0]-$size[2] < 15 then 
                WinMove ( $Form1, "", @DesktopWidth-15, $size[1], 15, 20,1 )
        Elseif @DesktopHeight-$size[1]-$size[3] < 15 then 
                WinMove ( $Form1, "", $size[0], @DesktopHeight-3,@DesktopWidth/4, 3, 1 )
        EndIf
Else
IniWrite($sIni, "shezhi", "shousuo", "0")
EndIf
 
 
Dim $abcd[2][2] = [ [ "w", $size[0]], [ "h",$size[1]]]
IniWriteSection($sIni, "weizhi", $abcd, 0)
_CheckInput($Form1, $Input_1, "输入关键词", $DEFAULTINPUTDATA_1, $MARK_1)
WEnd
 
Func _API_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $isColorRef = False)
 
        Local Const $AC_SRC_ALPHA = 1
        Local Const $ULW_ALPHA = 2
        Local Const $LWA_ALPHA = 0x2
        Local Const $LWA_COLORKEY = 0x1
        If Not $isColorRef Then
                $i_transcolor = Hex(String($i_transcolor), 6)
                $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
        EndIf
        Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
        Select
                Case @error
                        Return SetError(@error, 0, 0)
                Case $Ret[0] = 0
                        Return SetError(4, 0, 0)
                Case Else
                        Return 1
        EndSelect
EndFunc   ;==>_API_SetLayeredWindowAttributes
 
Func _CheckInput($hWnd, $ID, $InputDefText, ByRef $DefaultInputData, ByRef $Mark)
    If $Mark = 0 And _IsFocused($hWnd, $ID) And $DefaultInputData = $InputDefText Then
        $Mark = 1
        GUICtrlSetData($ID, "")
        GUICtrlSetColor($ID, 0x000000)
        $DefaultInputData = ""
    ElseIf $Mark = 1 And Not _IsFocused($hWnd, $ID) And $DefaultInputData = "" And GUICtrlRead($ID) = "" Then
        $Mark = 0
        $DefaultInputData = $InputDefText
        GUICtrlSetData($ID, $DefaultInputData)
        GUICtrlSetColor($ID, $NONEAACTIVECOLOR)
    EndIf
EndFunc
 
Func _IsFocused($hWnd, $nCID)
    Return ControlGetHandle($hWnd, '', $nCID) = ControlGetHandle($hWnd, '', ControlGetFocus($hWnd))
EndFunc
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Outfile=tt.exe
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <TabConstants.au3>
#include <waterctrl.dll.au3>
#Region ### START Koda GUI section ### Form=

FileInstall("Icon\1.ico", @TempDir & "", 1)
FileInstall("Icon\2.ico", @TempDir & "", 1)
FileInstall("Icon\3.ico", @TempDir & "", 1)
FileInstall("Icon\4.ico", @TempDir & "", 1)
FileInstall("Icon\5.ico", @TempDir & "", 1)
FileInstall("Icon\6.ico", @TempDir & "", 1)
FileInstall("Icon\7.ico", @TempDir & "", 1)
FileInstall("Icon\8.ico", @TempDir & "", 1)
FileInstall("Icon\9.ico", @TempDir & "", 1)
FileInstall("Icon\10.ico", @TempDir & "", 1)

$Form = GUICreate("按钮图标测试", 435, 445)

GUICtrlCreateLabel("请选择班次:", 30, 90, 75, 20, $SS_CENTERIMAGE)
$item1 = "一班"
$item2 = "二班"
$item3 = "三班"
$item4 = "四班"
$item5 = "五班"
$Combo1 = GUICtrlCreateCombo("", 110, 90, 95)
GUICtrlSetData(-1, $item1 & "|" & $item2 & "|" & $item3 & "|" & $item4 & "|" & $item5, $item1)
GUICtrlCreateLabel("请选择班组:", 225, 90, 75, 20, $SS_CENTERIMAGE)
$item1 = "A"
$item2 = "B"
$item3 = "C"
$item4 = "D"
$item5 = "E"
$item6 = "F"
$Combo2 = GUICtrlCreateCombo("", 305, 90, 95)
GUICtrlSetData(-1, $item1 & "|" & $item2 & "|" & $item3 & "|" & $item4 & "|" & $item5 & "|" & $item6, $item1)
$Group1 = GUICtrlCreateGroup("班组部分", 14, 75, 405, 130)
$btn1 = GUICtrlCreateButton("", 25, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\1.ico")
GUICtrlSetCursor(-1, 0)
$Lab_1 = GUICtrlCreateLabel("定时汇报", 25, 185, 60, 15, $SS_CENTER)
$btn2 = GUICtrlCreateButton("", 105, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\2.ico")
GUICtrlSetCursor(-1, 0)
$lab_2 = GUICtrlCreateLabel("装置算量", 110, 185, 50, 15, $SS_CENTER)
$Btn3 = GUICtrlCreateButton("", 185, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\3.ico")
GUICtrlSetCursor(-1, 0)
$lab_3 = GUICtrlCreateLabel("节能计算", 190, 185, 50, 15, $SS_CENTER)
$Btn4 = GUICtrlCreateButton("", 265, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\4.ico")
GUICtrlSetCursor(-1, 0)
$lab_4 = GUICtrlCreateLabel("操 作 卡", 270, 185, 50, 15, $SS_CENTER)
$Btn5 = GUICtrlCreateButton("", 345, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\5.ico")
GUICtrlSetCursor(-1, 0)
$lab_5 = GUICtrlCreateLabel("交班日记", 350, 185, 50, 15, $SS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group2 = GUICtrlCreateGroup("公用部分", 14, 210, 405, 175)
$Btn6 = GUICtrlCreateButton("", 30, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\6.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("日计划", 30, 290, 50, 15, $SS_CENTER)
$Btn7 = GUICtrlCreateButton("", 110, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\7.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("CDU质量查询", 95, 290, 75, 15, $SS_CENTER)
$Btn8 = GUICtrlCreateButton("", 190, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\7.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("NMW质量查询", 178, 290, 75, 15, $SS_CENTER)
$Btn9 = GUICtrlCreateButton("", 270, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\7.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("环保数据查询", 258, 290, 75, 15, $SS_CENTER)
$Btn10 = GUICtrlCreateButton("", 350, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("生产电话", 350, 290, 50, 15, $SS_CENTER)
$Btn11 = GUICtrlCreateButton("", 30, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("装置通讯录", 25, 365, 60, 15, $SS_CENTER)
$Btn12 = GUICtrlCreateButton("", 110, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("新区通讯录", 105, 365, 60, 15, $SS_CENTER)
$Btn13 = GUICtrlCreateButton("", 190, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("公司电话", 190, 365, 50, 15, $SS_CENTER)
$Btn14 = GUICtrlCreateButton("", 270, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\9.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("薪酬查询", 270, 365, 50, 15, $SS_CENTER)
$Btn15 = GUICtrlCreateButton("", 350, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\10.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("使用说明", 350, 365, 50, 15, $SS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Btn16 = GUICtrlCreateButton("退出(ESC)", 328, 390, 100, 25, -1, $WS_EX_STATICEDGE)
GUICtrlCreateLabel("版权所有(C)2005-2011   JTW", 5, 415, 425, 25, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_STATICEDGE)

For $i = 0 To 10
        FileDelete(@TempDir & "" & $i & ".ico")
Next
FileInstall("back.bmp", @TempDir & "", 1)
_WaterCtrl_Startup(@TempDir & "\back.bmp", $Form, '70,27')
FileDelete(@TempDir & "\back.bmp")
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case -3
                        _WaterCtrl_Shutdown()
                        GUIDelete()
                        Exit
                Case $btn1
                        _GUICtrlButton_SetStyle($btn1, $BS_PUSHBOX)
                Case $btn2
                        _GUICtrlButton_SetStyle($btn2, $BS_PUSHBOX)
                Case $Btn3
                        _GUICtrlButton_SetStyle($Btn3, $BS_PUSHBOX)
                Case $Btn4
                        _GUICtrlButton_SetStyle($Btn4, $BS_PUSHBOX)
                Case $Btn5
                        _GUICtrlButton_SetStyle($Btn5, $BS_PUSHBOX)
                Case $Btn16
                        Exit
        EndSwitch
WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2014-6-13 22:12:44 | 显示全部楼层
本人新手,有会的帮忙一下,帮写一段代码上去也可以,主要是放个框框可以用百度搜索就行了
发表于 2014-6-14 08:45:22 | 显示全部楼层
e  小白路过,帮顶。我也想知道!
发表于 2014-6-14 13:15:24 | 显示全部楼层
我问一下!你只要添加搜功能到你自已代码中是吗?
 楼主| 发表于 2014-6-14 13:25:51 | 显示全部楼层
我问一下!你只要添加搜功能到你自已代码中是吗?
f4李文杨 发表于 2014-6-14 13:15



    是的,想要给那个代码加一个用百度搜索关键字,上网浏览用,只需要搜索就可以了,最好是输入关键字后回车就能搜索内容,谢谢拉
发表于 2014-6-14 13:45:59 | 显示全部楼层
本帖最后由 f4李文杨 于 2014-6-14 13:55 编辑
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <TabConstants.au3>
#include <waterctrl.dll.au3>
#include <IE.au3>
#include <Misc.au3>
#region ### START Koda GUI section ### Form=
FileInstall("Icon\1.ico", @TempDir & "", 1)
FileInstall("Icon\2.ico", @TempDir & "", 1)
FileInstall("Icon\3.ico", @TempDir & "", 1)
FileInstall("Icon\4.ico", @TempDir & "", 1)
FileInstall("Icon\5.ico", @TempDir & "", 1)
FileInstall("Icon\6.ico", @TempDir & "", 1)
FileInstall("Icon\7.ico", @TempDir & "", 1)
FileInstall("Icon\8.ico", @TempDir & "", 1)
FileInstall("Icon\9.ico", @TempDir & "", 1)
FileInstall("Icon\10.ico", @TempDir & "", 1)
$Form = GUICreate("按钮图标测试", 435, 445)
GUICtrlCreateLabel("请输入搜索内容:", 16, 47, 100, 17)
$I1 = GUICtrlCreateInput("Input1", 120, 44, 137, 21)
$C1 = GUICtrlCreateCombo("百度", 264, 44, 97, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "谷歌|百度MP3|迅雷")
$Button1 = GUICtrlCreateButton("搜索", 369, 41, 59, 25, $GUI_FOCUS)
GUICtrlCreateLabel("请选择班次:", 30, 90, 75, 20, $SS_CENTERIMAGE)
$item1 = "一班"
$item2 = "二班"
$item3 = "三班"
$item4 = "四班"
$item5 = "五班"
$Combo1 = GUICtrlCreateCombo("", 110, 90, 95)
GUICtrlSetData(-1, $item1 & "|" & $item2 & "|" & $item3 & "|" & $item4 & "|" & $item5, $item1)
GUICtrlCreateLabel("请选择班组:", 225, 90, 75, 20, $SS_CENTERIMAGE)
$item1 = "A"
$item2 = "B"
$item3 = "C"
$item4 = "D"
$item5 = "E"
$item6 = "F"
$Combo2 = GUICtrlCreateCombo("", 305, 90, 95)
GUICtrlSetData(-1, $item1 & "|" & $item2 & "|" & $item3 & "|" & $item4 & "|" & $item5 & "|" & $item6, $item1)
$Group1 = GUICtrlCreateGroup("班组部分", 14, 75, 405, 130)
$btn1 = GUICtrlCreateButton("", 25, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\1.ico")
GUICtrlSetCursor(-1, 0)
$Lab_1 = GUICtrlCreateLabel("定时汇报", 25, 185, 60, 15, $SS_CENTER)
$btn2 = GUICtrlCreateButton("", 105, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\2.ico")
GUICtrlSetCursor(-1, 0)
$lab_2 = GUICtrlCreateLabel("装置算量", 110, 185, 50, 15, $SS_CENTER)
$Btn3 = GUICtrlCreateButton("", 185, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\3.ico")
GUICtrlSetCursor(-1, 0)
$lab_3 = GUICtrlCreateLabel("节能计算", 190, 185, 50, 15, $SS_CENTER)
$Btn4 = GUICtrlCreateButton("", 265, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\4.ico")
GUICtrlSetCursor(-1, 0)
$lab_4 = GUICtrlCreateLabel("操 作 卡", 270, 185, 50, 15, $SS_CENTER)
$Btn5 = GUICtrlCreateButton("", 345, 120, 60, 60, BitOR($BS_PUSHBOX, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\5.ico")
GUICtrlSetCursor(-1, 0)
$lab_5 = GUICtrlCreateLabel("交班日记", 350, 185, 50, 15, $SS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)

$Group2 = GUICtrlCreateGroup("公用部分", 14, 210, 405, 175)
$Btn6 = GUICtrlCreateButton("", 30, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\6.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("日计划", 30, 290, 50, 15, $SS_CENTER)
$Btn7 = GUICtrlCreateButton("", 110, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\7.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("CDU质量查询", 95, 290, 75, 15, $SS_CENTER)
$Btn8 = GUICtrlCreateButton("", 190, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\7.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("NMW质量查询", 178, 290, 75, 15, $SS_CENTER)
$Btn9 = GUICtrlCreateButton("", 270, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\7.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("环保数据查询", 258, 290, 75, 15, $SS_CENTER)
$Btn10 = GUICtrlCreateButton("", 350, 235, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("生产电话", 350, 290, 50, 15, $SS_CENTER)
$Btn11 = GUICtrlCreateButton("", 30, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("装置通讯录", 25, 365, 60, 15, $SS_CENTER)
$Btn12 = GUICtrlCreateButton("", 110, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("新区通讯录", 105, 365, 60, 15, $SS_CENTER)
$Btn13 = GUICtrlCreateButton("", 190, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\8.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("公司电话", 190, 365, 50, 15, $SS_CENTER)
$Btn14 = GUICtrlCreateButton("", 270, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\9.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("薪酬查询", 270, 365, 50, 15, $SS_CENTER)
$Btn15 = GUICtrlCreateButton("", 350, 310, 50, 50, BitOR($BS_DEFPUSHBUTTON, $WS_BORDER, $BS_CENTER, $BS_ICON))
GUICtrlSetImage(-1, @TempDir & "\10.ico")
GUICtrlSetCursor(-1, 0)
GUICtrlCreateLabel("使用说明", 350, 365, 50, 15, $SS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Btn16 = GUICtrlCreateButton("退出(ESC)", 328, 390, 100, 25, -1, $WS_EX_STATICEDGE)
GUICtrlCreateLabel("版权所有(C)2005-2011   JTW", 5, 415, 425, 25, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_STATICEDGE)

For $i = 0 To 10
        FileDelete(@TempDir & "" & $i & ".ico")
Next
FileInstall("back.bmp", @TempDir & "", 1)
;_WaterCtrl_Startup(@TempDir & "\back.bmp", $Form, '70,10')
;FileDelete(@TempDir & "\back.bmp")
GUISetState()
#endregion ### END Koda GUI section ###
$HC = 0
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                        ;Case -3
                        ;_WaterCtrl_Shutdown()
                        ;GUIDelete()
                        Exit
                Case $btn1
                        _GUICtrlButton_SetStyle($btn1, $BS_PUSHBOX)
                Case $btn2
                        _GUICtrlButton_SetStyle($btn2, $BS_PUSHBOX)
                Case $Btn3
                        _GUICtrlButton_SetStyle($Btn3, $BS_PUSHBOX)
                Case $Btn4
                        _GUICtrlButton_SetStyle($Btn4, $BS_PUSHBOX)
                Case $Btn5
                        _GUICtrlButton_SetStyle($Btn5, $BS_PUSHBOX)
                Case $Btn16
                        Exit
                        
                Case $Button1
                        F4_KT()
                        
        EndSwitch
        If _IsPressed("0D") Then
                If Not $HC Then
                        F4_KT()
                EndIf
        Else
                If $HC Then
                        $HC = 0
                EndIf
        EndIf
WEnd

Func F4_KT()
        If GUICtrlRead($C1) = "百度" Then
                _IECreate("http://www.baidu.com/s?wd=" & GUICtrlRead($I1), 0, 1, 0, 1)
        EndIf
        If GUICtrlRead($C1) = "谷歌" Then
                _IECreate("http://www.google.cn/search?hl=zh-CN&q=" & GUICtrlRead($I1), 0, 1, 0, 1)
        EndIf
        If GUICtrlRead($C1) = "百度mp3" Then
                _IECreate("http://mp3.baidu.com/m?ct=134217728&word=" & GUICtrlRead($I1), 0, 1, 0, 1)
        EndIf
        If GUICtrlRead($C1) = "迅雷" Then
                _IECreate("http://search.gougou.com/search?search=" & GUICtrlRead($I1), 0, 1, 0, 1)
        EndIf
EndFunc   ;==>F4_KT
是不是你要的效果就不知道了!给我加了按键回车循环测!如果不好用的话你自已改了!!
这么感觉你是重那里搞来的代码呢...............

评分

参与人数 1金钱 +10 收起 理由
autoee + 10 谢谢了,已经不很好了,输入框不知道怎么弄 ...

查看全部评分

您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-30 03:48 , Processed in 0.080901 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表