(已解决)这个进度條的代码如何改正,
本帖最后由 faceyao 于 2012-6-28 22:51 编辑这个进度条运行后会自动从100退回来,要求不要他退回来,到了100就exit,且最好在到34%和94%的位置简短的停1400毫秒,
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("MustDeclareVars", 1)
Global $Form, $Graphic, $Label
Global $nMsg, $i, $time = 50
GraphicProgress()
Func GraphicProgress()
$Form = GUICreate("Form1", 302, 15, -1, -1, _
BitOR($WS_MINIMIZEBOX,$WS_SYSMENU,$WS_DLGFRAME,$WS_POPUP,$WS_GROUP,$WS_CLIPSIBLINGS), _
BitOR($WS_EX_OVERLAPPEDWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Graphic = GUICtrlCreateGraphic(0, 0, 1, 15)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label = GUICtrlCreateLabel("0%", 137, 2, 26, 13)
GUICtrlSetFont(-1, 6, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case 0
For $i = 1 To 302 Step 1
GUICtrlSetPos($Graphic, 0, 0, $i, 15)
GUICtrlSetData($Label, Round($i/3.02) & "%")
If GUICtrlRead($Label) = 48 Then GUICtrlSetColor($Label, 0xFFFFFF)
Sleep($time)
Next
For $i = 302 To 1 Step -1
GUICtrlSetPos($Graphic, 0, 0, $i, 15)
GUICtrlSetData($Label, Round($i/3.02) & "%")
If GUICtrlRead($Label) = 52 Then GUICtrlSetColor($Label, 0x000000)
Sleep($time)
Next
Exit
EndSwitch
WEnd
EndFunc
本帖最后由 afan 于 2012-6-28 18:49 编辑
这不叫怪异,仅为演示……
要学会看懂代码,像这种东西看懂了修改就很简单了。照搬不会有进步的。多独立思考,少提问。#NoTrayIcon
#include <WindowsConstants.au3>
GraphicProgress(1400, 34, 94)
Func GraphicProgress($time1, $vPro1, $vPro2)
Local $Graphic, $Label, $vPro, $time = 50
GUICreate("", 302, 15, -1, -1, _
BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_DLGFRAME, $WS_POPUP, $WS_GROUP, $WS_CLIPSIBLINGS), _
BitOR($WS_EX_OVERLAPPEDWINDOW, $WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
$Graphic = GUICtrlCreateGraphic(0, 0, 1, 15)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label = GUICtrlCreateLabel("0%", 137, 2, 26, 13)
GUICtrlSetFont(-1, 6, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, -2)
GUISetState()
For $i = 1 To 302
GUICtrlSetPos($Graphic, 0, 0, $i, 15)
$vPro = Round($i / 3.02)
GUICtrlSetData($Label, $vPro & "%")
If $vPro = 48 Then GUICtrlSetColor($Label, 0xFFFFFF)
If $vPro = $vPro1 Or $vPro = $vPro2 Then ContinueLoop Sleep($time1)
Sleep($time)
Next
EndFunc ;==>GraphicProgress 啥叫怪异?标题党啊!
修改这个应该还算简单吧{:face (427):} 请问如何让这个不在任务栏显示
第10行改成这个 BitOR($WS_EX_OVERLAPPEDWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE),WinGetHandle("Program Manager")) 本帖最后由 komaau3 于 2012-6-28 20:15 编辑
回复 4# faceyao
http://www.autoitscript.com/forum/topic/111018-itaskbarlist-udf-rewrite-for-beta-all-methods-included/page__hl__%20itaskbarlist 回复 6# komaau3
谢谢兄弟分享,但是ITaskBarList.au3下载不了啊!能不能共享一下啊? 回复 7# xms77
我也是让蛋蛋帮我下的,以前下的找不到了
回复 8# komaau3
旧版的貌似有问题哦 找了个在线代理给down下来了 效果很酷{:face (427):}
回复 8# komaau3
谢谢分享,但是怎么解压缩出错啊!{:face (229):} 回复 10# xms77
呵呵 用我的吧 win7下不是一般的帅 忍不住拿出来分享
{:face (239):}
回复 11# ashfinal
呵呵,是被我逼出来的吧?{:face (303):} 谢谢了,兄弟!笑纳了~~{:face (427):} 回复 11# ashfinal
咦,东西呢?{:face (382):} 回复 13# xms77
{:face (258):}
9楼。。。 回复 14# ashfinal
骚瑞啊!我还以为是原先的那个呢!:face (27):
页:
[1]