Jex Posted October 24, 2007 Share Posted October 24, 2007 (edited) I have last AutoIt Beta version and i can't find "_GUICtrlStatusBar_CreateProgress" code. "_GUICtrlStatusBarCreateProgress" that working without beta but for my ListBox i need use beta and i need find StatusBarCreateProgress function? Edited October 24, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
BrettF Posted October 24, 2007 Share Posted October 24, 2007 In the BETA Example: expandcollapse popup#include <GuiConstants.au3> #include <GuiStatusBar.au3> Opt('MustDeclareVars', 1) $Debug_SB = False; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Global $hStatus _Main() Func _Main() Local $hGUI, $hProgress, $hInput, $input, $progress Local $aParts[4] = [80, 160, 300, -1] ; Create GUI $hGUI = GUICreate("StatusBar Embed Control", 400, 300) ;=============================================================================== ; defaults to 1 part, no text $hStatus = _GUICtrlStatusBar_Create ($hGUI) _GUICtrlStatusBar_SetMinHeight ($hStatus, 20) ;=============================================================================== GUISetState() GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Initialize parts _GUICtrlStatusBar_SetParts ($hStatus, $aParts) _GUICtrlStatusBar_SetText ($hStatus, "Part 1") _GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1) ; Embed a progress bar If @OSTYPE = "WIN32_WINDOWS" Then $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $hProgress) Else $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_MARQUEE); marquee works on Win XP and above $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $hProgress) _SendMessage($hProgress, $PBM_SETMARQUEE, True, 200); marquee works on Win XP and above EndIf $input = GUICtrlCreateInput("This is Embeded", 0, 0) $hInput = GUICtrlGetHandle($input) _GUICtrlStatusBar_EmbedControl ($hStatus, 3, $hInput, 3) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hStatus Switch $iCode Case $NM_CLICK ; The user has clicked the left mouse button within the control Local $tinfo = DllStructCreate($tagNMMOUSE, $ilParam) $hWndFrom = HWnd(DllStructGetData($tinfo, "hWndFrom")) $iIDFrom = DllStructGetData($tinfo, "IDFrom") $iCode = DllStructGetData($tinfo, "Code") _DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode & @LF & _ "-->ItemSpec:" & @TAB & DllStructGetData($tinfo, "ItemSpec") & @LF & _ "-->ItemData:" & @TAB & DllStructGetData($tinfo, "ItemData") & @LF & _ "-->X:" & @TAB & DllStructGetData($tinfo, "X") & @LF & _ "-->Y:" & @TAB & DllStructGetData($tinfo, "Y") & @LF & _ "-->HitInfo:" & @TAB & DllStructGetData($tinfo, "HitInfo")) Return TRUE; indicate that the mouse click was handled and suppress default processing by the system ;~ Return FALSE;to allow default processing of the click. Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control Local $tinfo = DllStructCreate($tagNMMOUSE, $ilParam) $hWndFrom = HWnd(DllStructGetData($tinfo, "hWndFrom")) $iIDFrom = DllStructGetData($tinfo, "IDFrom") $iCode = DllStructGetData($tinfo, "Code") _DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode & @LF & _ "-->ItemSpec:" & @TAB & DllStructGetData($tinfo, "ItemSpec") & @LF & _ "-->ItemData:" & @TAB & DllStructGetData($tinfo, "ItemData") & @LF & _ "-->X:" & @TAB & DllStructGetData($tinfo, "X") & @LF & _ "-->Y:" & @TAB & DllStructGetData($tinfo, "Y") & @LF & _ "-->HitInfo:" & @TAB & DllStructGetData($tinfo, "HitInfo")) Return TRUE; indicate that the mouse click was handled and suppress default processing by the system ;~ Return FALSE;to allow default processing of the click. Case $NM_RCLICK ; The user has clicked the right mouse button within the control Local $tinfo = DllStructCreate($tagNMMOUSE, $ilParam) $hWndFrom = HWnd(DllStructGetData($tinfo, "hWndFrom")) $iIDFrom = DllStructGetData($tinfo, "IDFrom") $iCode = DllStructGetData($tinfo, "Code") _DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode & @LF & _ "-->ItemSpec:" & @TAB & DllStructGetData($tinfo, "ItemSpec") & @LF & _ "-->ItemData:" & @TAB & DllStructGetData($tinfo, "ItemData") & @LF & _ "-->X:" & @TAB & DllStructGetData($tinfo, "X") & @LF & _ "-->Y:" & @TAB & DllStructGetData($tinfo, "Y") & @LF & _ "-->HitInfo:" & @TAB & DllStructGetData($tinfo, "HitInfo")) Return TRUE; indicate that the mouse click was handled and suppress default processing by the system ;~ Return FALSE;to allow default processing of the click. Case $NM_RDBLCLK ; The user has clicked the right mouse button within the control Local $tinfo = DllStructCreate($tagNMMOUSE, $ilParam) $hWndFrom = HWnd(DllStructGetData($tinfo, "hWndFrom")) $iIDFrom = DllStructGetData($tinfo, "IDFrom") $iCode = DllStructGetData($tinfo, "Code") _DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode & @LF & _ "-->ItemSpec:" & @TAB & DllStructGetData($tinfo, "ItemSpec") & @LF & _ "-->ItemData:" & @TAB & DllStructGetData($tinfo, "ItemData") & @LF & _ "-->X:" & @TAB & DllStructGetData($tinfo, "X") & @LF & _ "-->Y:" & @TAB & DllStructGetData($tinfo, "Y") & @LF & _ "-->HitInfo:" & @TAB & DllStructGetData($tinfo, "HitInfo")) Return TRUE; indicate that the mouse click was handled and suppress default processing by the system ;~ Return FALSE;to allow default processing of the click. Case $SBN_SIMPLEMODECHANGE ; Simple mode changes _DebugPrint("$SBN_SIMPLEMODECHANGE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode) ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_text, $line = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @LF & _ "+======================================================" & @LF & _ "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _ "+======================================================" & @LF) EndFunc ;==>_DebugPrint Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Jex Posted October 24, 2007 Author Share Posted October 24, 2007 Thanks Bert My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
BrettF Posted October 24, 2007 Share Posted October 24, 2007 (edited) Thats ok. I like your Avatar. Its awesome Edited October 24, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Jex Posted October 24, 2007 Author Share Posted October 24, 2007 (edited) expandcollapse popup#include <GUIConstants.au3> #include <GuiStatusBar.au3> #include <GuiListBox.au3> Global $Button[6][6], $List[3], $Game $Gui = GUICreate("FLEXY", 270, 320) Local $a_PartsRightEdge[2] = [135,300] Local $a_PartsText[2] = ["",""] $hStatus = _GUICtrlStatusBar_Create($Gui, $a_PartsRightEdge, $a_PartsText) If @OSTYPE = "WIN32_WINDOWS" Then $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $hProgress) Else $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_MARQUEE) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $hProgress) _SendMessage($hProgress, $PBM_SETMARQUEE, True, 200) EndIf For $x = 1 To 5 For $y = 1 To 5 $Left = ($x * 50) - 40 $Top = ($y * 50) - 10 $Button[$x][$y] = GUICtrlCreateButton("", $Left, $Top, 50, 50,$BS_MULTILINE ) Next Next $Button1 = GUICtrlCreateButton("Start first game", 10, 8, 102, 25, 0) $Button2 = GUICtrlCreateButton("Start second game", 112, 8, 104, 25, 0) $Button3 = GUICtrlCreateButton("Scores", 216, 8, 49, 25, 0) GUICtrlSetTip($Button1, "Try click 10 correct button fast as you can.") GUICtrlSetTip($Button2, "Try click more correct button as you can in 15 second.") GUICtrlSetTip($Button2, "Showing high scores.") $Gui2 = GUICreate("High Scores", 235, 167, 250, 311, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS)) $List[1] = GUICtrlCreateList("", 8, 24, 105, 136, $WS_BORDER) $List[2] = GUICtrlCreateList("", 120, 24, 105, 136, $WS_BORDER) $Label1 = GUICtrlCreateLabel("Game 1 High Scores", 8, 8, 102, 17) $Label2 = GUICtrlCreateLabel("Game 2 High Scores", 120, 8, 102, 17) GUISetState(@SW_SHOW, $Gui) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $Button1 $Var = 0 $Score = Start(1) Case $msg[0] = $Button2 $Var = 0 $Score = Start(2) Case $msg[0] = $Button3 GUISetState(@SW_SHOW, $Gui2) Case $msg[0] = $GUI_EVENT_CLOSE If $msg[1] = $Gui Then Exit If $msg[1] = $Gui2 Then GUISetState(@SW_HIDE, $Gui2) EndSelect WEnd Func Start($Game) GUISetState(@SW_HIDE, $Gui2) $Begin = TimerInit() While 1 $x = Random(1, 5, 1) $y = Random(1, 5, 1) GUICtrlSetData($Button[$x][$y], "XXXXX" & @CRLF & "XXXXX" & @CRLF & "XXXXX") While 1 If $Game = 1 Then $Timer = Round(TimerDiff($Begin),0) / 1000 _GUICtrlStatusBar_SetText($hStatus, "Current score : " & $Timer) EndIf $msg = GUIGetMsg() Switch $msg Case $Button[$x][$y] SoundPlay(@WindowsDir & "\media\ding.wav") $Var += 1 ExitLoop Case $GUI_EVENT_CLOSE Exit EndSwitch For $xx = 1 To 5 For $yy = 1 To 5 If $Button[$x][$y] <> $Button[$xx][$yy] Then If $msg = $Button[$xx][$yy] Then SoundPlay(@WindowsDir & "\media\chimes.wav") $Var -= 1 EndIf EndIf Next Next If $Game = 2 Then $Timer = Round(TimerDiff($Begin),0) / 1000 $Bar = ($Timer / 15) * 100 _GUICtrlStatusBar_SetText($hStatus, "Current score : " & $Var) GUICtrlSetData($Progress, $Bar) If $Timer >= 15 Then MsgBox("", "", "Game 2 score : " & $Var & " points in 15 second.") ExitLoop 2 EndIf EndIf WEnd If $Game = 1 Then $Bar = $Var * 10 GUICtrlSetData($Progress, $Bar) If $Var = 10 Then $Timer = TimerDiff($Begin) $Var = Round($Timer,0) / 1000 MsgBox("", "", "Game 1 score : " & $Var & " second.") ExitLoop EndIf EndIf GUICtrlSetData($Button[$x][$y], "") WEnd Reset() Highscore($Var) EndFunc ;==>Start Func Reset() GUICtrlSetData($Button[$x][$y], "") _GUICtrlStatusBar_SetText($hStatus, "") GUICtrlSetData($Progress, 0) EndFunc Func Highscore($Score) If $Game = 1 Then $z = 1 Else $z = 2 EndIf $Count = _GUICtrlListBox_GetCount($List[$z]) For $i = 1 To $Count If StringLeft(_GUICtrlListBox_GetText($List[$z], $i), 2) < $Score Then _GUICtrlListBox_InsertString($List[$z], $i & ". " & $Score, $i) ExitLoop EndIf Next GUISetState(@SW_SHOW, $Gui2) EndFunc I can't see my progress bar By the way DP mean avatar ? Edit: You edited before im post Edited October 24, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
BrettF Posted October 24, 2007 Share Posted October 24, 2007 expandcollapse popup#include <GUIConstants.au3> #include <GuiStatusBar.au3> #include <GuiListBox.au3> Global $Button[6][6], $List[3], $Game $Gui = GUICreate("FLEXY", 270, 320) Local $a_PartsRightEdge[2] = [135, 300] Local $a_PartsText[2] = ["", ""] $hStatus = _GUICtrlStatusBar_Create ($Gui) _GUICtrlStatusBar_SetMinHeight ($hStatus, 20) For $x = 1 To 5 For $y = 1 To 5 $Left = ($x * 50) - 40 $Top = ($y * 50) - 10 $Button[$x][$y] = GUICtrlCreateButton("", $Left, $Top, 50, 50, $BS_MULTILINE) Next Next $Button1 = GUICtrlCreateButton("Start first game", 10, 8, 102, 25, 0) $Button2 = GUICtrlCreateButton("Start second game", 112, 8, 104, 25, 0) $Button3 = GUICtrlCreateButton("Scores", 216, 8, 49, 25, 0) GUICtrlSetTip($Button1, "Try click 10 correct button fast as you can.") GUICtrlSetTip($Button2, "Try click more correct button as you can in 15 second.") GUICtrlSetTip($Button2, "Showing high scores.") $Gui2 = GUICreate("High Scores", 235, 167, 250, 311, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS)) $List[1] = GUICtrlCreateList("", 8, 24, 105, 136, $WS_BORDER) $List[2] = GUICtrlCreateList("", 120, 24, 105, 136, $WS_BORDER) $Label1 = GUICtrlCreateLabel("Game 1 High Scores", 8, 8, 102, 17) $Label2 = GUICtrlCreateLabel("Game 2 High Scores", 120, 8, 102, 17) GUISetState(@SW_SHOW, $Gui) _GUICtrlStatusBar_SetParts ($hStatus, $a_PartsRightEdge) For $i = 0 To UBound($a_PartsText) - 1 _GUICtrlStatusBar_SetText ($hStatus, $a_PartsText[$i], $i) Next If @OSTYPE = "WIN32_WINDOWS" Then $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 1, $hProgress) Else $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_MARQUEE) ; marquee works on Win XP and above $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 1, $hProgress) _SendMessage($hProgress, $PBM_SETMARQUEE, True, 200) ; marquee works on Win XP and above EndIf While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $Button1 $Var = 0 $Score = Start(1) Case $msg[0] = $Button2 $Var = 0 $Score = Start(2) Case $msg[0] = $Button3 GUISetState(@SW_SHOW, $Gui2) Case $msg[0] = $GUI_EVENT_CLOSE If $msg[1] = $Gui Then Exit If $msg[1] = $Gui2 Then GUISetState(@SW_HIDE, $Gui2) EndSelect WEnd Func Start($Game) GUISetState(@SW_HIDE, $Gui2) $Begin = TimerInit() While 1 $x = Random(1, 5, 1) $y = Random(1, 5, 1) GUICtrlSetData($Button[$x][$y], "XXXXX" & @CRLF & "XXXXX" & @CRLF & "XXXXX") While 1 If $Game = 1 Then $Timer = Round(TimerDiff($Begin), 0) / 1000 _GUICtrlStatusBar_SetText ($hStatus, "Current score : " & $Timer) EndIf $msg = GUIGetMsg() Switch $msg Case $Button[$x][$y] SoundPlay(@WindowsDir & "\media\ding.wav") $Var += 1 ExitLoop Case $GUI_EVENT_CLOSE Exit EndSwitch For $xx = 1 To 5 For $yy = 1 To 5 If $Button[$x][$y] <> $Button[$xx][$yy] Then If $msg = $Button[$xx][$yy] Then SoundPlay(@WindowsDir & "\media\chimes.wav") $Var -= 1 EndIf EndIf Next Next If $Game = 2 Then $Timer = Round(TimerDiff($Begin), 0) / 1000 $Bar = ($Timer / 15) * 100 _GUICtrlStatusBar_SetText ($hStatus, "Current score : " & $Var) GUICtrlSetData($progress, $Bar) If $Timer >= 15 Then MsgBox("", "", "Game 2 score : " & $Var & " points in 15 second.") ExitLoop 2 EndIf EndIf WEnd If $Game = 1 Then $Bar = $Var * 10 GUICtrlSetData($progress, $Bar) If $Var = 10 Then $Timer = TimerDiff($Begin) $Var = Round($Timer, 0) / 1000 MsgBox("", "", "Game 1 score : " & $Var & " second.") ExitLoop EndIf EndIf GUICtrlSetData($Button[$x][$y], "") WEnd Reset() Highscore($Var) EndFunc ;==>Start Func Reset() GUICtrlSetData($Button[$x][$y], "") _GUICtrlStatusBar_SetText ($hStatus, "") GUICtrlSetData($progress, 0) EndFunc ;==>Reset Func Highscore($Score) If $Game = 1 Then $z = 1 Else $z = 2 EndIf $Count = _GUICtrlListBox_GetCount ($List[$z]) For $i = 1 To $Count If StringLeft(_GUICtrlListBox_GetText ($List[$z], $i), 2) < $Score Then _GUICtrlListBox_InsertString ($List[$z], $i & ". " & $Score, $i) ExitLoop EndIf Next GUISetState(@SW_SHOW, $Gui2) EndFunc ;==>Highscore That seemed to work for me... Not sure what I did though. I think it was the parts where you declare where to put it. Basically, part 2 didn't exist, as it starts from 0. (1st part = part 0...) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
BrettF Posted October 24, 2007 Share Posted October 24, 2007 I'm looking my code and your code and i can't find you changed what and now progress bar working Old style progress bar more easy in my opinion Look closely at these lines: If @OSTYPE = "WIN32_WINDOWS" Then $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 1, $hProgress) Else $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_MARQUEE) ; marquee works on Win XP and above $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 1, $hProgress) _SendMessage($hProgress, $PBM_SETMARQUEE, True, 200) ; marquee works on Win XP and above EndIf Look at the second parameter of _GUICtrlStatusBar_EmbedControl ()... Notice it is one less. That's because it is a Zero Based Index which means the first part it 0, the second is 1 and so on. We have only defined 2 parts, so the max number we can safely have is 2-1 = 1. Starting to make sense now? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Jex Posted October 24, 2007 Author Share Posted October 24, 2007 I don't want ask like that basic questions but i can't find in AutoIt Help file or forum I can't change my statusprogressbar with that code : "GUICtrlSetData($progress, $Bar)" and _GUICtrlStatusBar_EmbedControl that function helpfile havent example for edit progress bar. My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
BrettF Posted October 24, 2007 Share Posted October 24, 2007 I don't want ask like that basic questions but i can't find in AutoIt Help file or forum I can't change my statusprogressbar with that code : "GUICtrlSetData($progress, $Bar)" and _GUICtrlStatusBar_EmbedControl that function helpfile havent example for edit progress bar. expandcollapse popup#include <GuiConstants.au3> #include <GuiStatusBar.au3> Opt('MustDeclareVars', 1) $Debug_SB = False; Check ClassName being passed to functions, set to True and use a handle to another control to see it work Global $hStatus Global $count = 0 Global $over = False _Main() Func _Main() Local $hGUI, $hProgress, $hInput, $input, $progress Local $aParts[4] = [80, 160, 300, -1] ; Create GUI $hGUI = GUICreate("StatusBar Embed Control", 400, 300) ;=============================================================================== ; defaults to 1 part, no text $hStatus = _GUICtrlStatusBar_Create ($hGUI) _GUICtrlStatusBar_SetMinHeight ($hStatus, 20) ;=============================================================================== GUISetState() ; Initialize parts _GUICtrlStatusBar_SetParts ($hStatus, $aParts) _GUICtrlStatusBar_SetText ($hStatus, "Part 1") _GUICtrlStatusBar_SetText ($hStatus, "Part 2", 1) ; Embed a progress bar If @OSTYPE = "WIN32_WINDOWS" Then $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $hProgress) Else $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH); marquee works on Win XP and above $hProgress = GUICtrlGetHandle($progress) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $hProgress) _SendMessage($hProgress, $PBM_SETMARQUEE, True, 200); marquee works on Win XP and above EndIf $input = GUICtrlCreateInput("This is Embeded", 0, 0) $hInput = GUICtrlGetHandle($input) _GUICtrlStatusBar_EmbedControl ($hStatus, 3, $hInput, 3) ; Loop until user exits Do If $count = 100 then $over = True If $count = 0 Then $over = False If $over = True Then GUICtrlSetData ($progress, $count) $count -= 1 Else GUICtrlSetData ($progress, $count) $count += 1 EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now