eJan Posted July 14, 2005 Share Posted July 14, 2005 I'm using script to install new versions of exe and other files <> 2 Mb's with fake progress bar on clean machine without XP themes, but when used with themes it goes not as espected it would be. This is a working part of script: expandcollapse popup#include <GUIConstants.au3> Dim $chkboxID[2] Dim $chkbox[2] Func _InstallFiles(); TO HAVE PROGRESS BAR.. DirCreate(@ScriptDir & "\NEW") FileInstall(@ScriptDir & "\001.exe", @ScriptDir & "\NEW\001.exe", 1) FileInstall(@ScriptDir & "\002.exe", @ScriptDir & "\NEW\002.exe", 1) EndFunc; BASED ON FileInstall (see line > 44 GUICreate("GUI", 226, 88); GUI Window $grp = GuiCtrlCreateGraphic (2, 4, 221, 81, 0) GUICtrlSetGraphic ($grp, $GUI_GR_COLOR, 0x000000) GUICtrlSetGraphic ($grp, $GUI_GR_RECT, 0, 0, 221, 81) $text = GUICtrlCreateLabel("Location..", 8, 10, 209, 29, $SS_SUNKEN) GUICtrlSetBkColor($text, 0xF0EDE3) $progress = GUICtrlCreateProgress(8, 43, 209, 16, $PBS_SMOOTH) GUICtrlSetColor($progress, 0xFF7900) $chkboxID[0] = GUICtrlCreateLabel("Install", 83, 63, 60, 17, $SS_CENTER) $chkbox[0] = $GUI_UNCHECKED GUICtrlSetFont($chkboxID[0], 10, 0, 0, "Verdana Bold") $upd = GuiCtrlCreateGraphic (83, 63, 60, 17, 0) GUICtrlSetGraphic ($upd, $GUI_GR_COLOR, 0x000000) GUICtrlSetGraphic ($upd, $GUI_GR_RECT, 0, 0, 60, 17); GUI Window GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $chkboxID[0] SetCheckBox($chkboxID[0], $chkbox[0]) EndSelect WEnd Func SetCheckBox($id, ByRef $val) If $val = $GUI_UNCHECKED Then _InstallFiles(); START INSTALLING FILE(S) For $i = 1 To 100 Step 4; TO CREATE PROGRESS BASED ON... Sleep(1) GUICtrlSetData($progress, $i, $i) If $i > 95 Then GUICtrlSetData($id, "Close") EndIf Next; ... FUNCTION FileInstall $val = $GUI_CHECKED GUICtrlDelete($progress) $text2 = GUICtrlCreateLabel("INSTALLED", 8, 43, 209, 16, $SS_CENTER + $SS_SUNKEN) GUICtrlSetColor($text2, 0xF0EDE3) GUICtrlSetBkColor($text2, 0xFF7900) Else Exit EndIf EndFunc Please help me to have FileInstall based on DllCall real progress (line 7-11 and line 44-51). (Or at least real one progress bar). Link to comment Share on other sites More sharing options...
blindwig Posted July 15, 2005 Share Posted July 15, 2005 Why not have your _InstallFiles() function take a handle to a progress bar and update it from within there? Func _InstallFiles($hProgress) GUICtrlSetData($hProgress, 0) DirCreate(@ScriptDir & "\NEW") FileInstall(@ScriptDir & "\001.exe", @ScriptDir & "\NEW\001.exe", 1) GUICtrlSetData($hProgress, 50) FileInstall(@ScriptDir & "\002.exe", @ScriptDir & "\NEW\002.exe", 1) GUICtrlSetData($hProgress, 100) EndFunc; BASED ON FileInstall (see line > 44 My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
eJan Posted July 28, 2005 Author Share Posted July 28, 2005 Thanks blindwig for suggestion, now it is real progress bar except when installing single large file. 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