Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/21/2015 in Posts

  1. Func closeGUI() $var = GUICtrlRead($inputer) GUIDelete("Command") $GUIstate = 0 MsgBox(0,"command given",$var);;Want to know what I put in the box EndFunc?
    1 point
  2. Melba23

    List Sub-Directories

    RaySS, You need to add the root path string to the folder name, otherwise you will not get the correct return from DirGetSize as it will be using an incomplete path - or you can set the $bReturnPath parameter to return the full path directly from the _FileListToArray function. On a side note, it always a good idea to check @error if you have a problem like this - in this case it would have been set giving you a good hint. M23
    1 point
  3. ... just a wild guess to try ControlClick("[CLASS:WindowsForms10.Window.8.app.0.33c0d9d]", "", "[ID:2228998]")or ControlClick("[CLASS:WindowsForms10.Window.8.app.0.33c0d9d]", "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d; INSTANCE:1]")good luck ...
    1 point
  4. mikell

    check if url is active?

    Because the ternary operator is lovely and I like it
    1 point
  5. A better solution - re-embed on receipt of WM_PAINT message #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <Timers.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> Opt("MustDeclareVars", 1) Global $iMemo, $hStatusBar, $progress, $percent = 0, $direction = 1 _Example_CallBack() Func _Example_CallBack() Local $hGUI, $iTimerProgress, $btn_change, $iWait = 10, $btn_state Local $aParts[3] = [75, 330, -1] $hGUI = GUICreate("Timers Using CallBack Function(s)", 400, 320) $iMemo = GUICtrlCreateEdit("", 2, 32, 396, 226, BitOR($WS_HSCROLL, $WS_VSCROLL)) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $btn_state = GUICtrlCreateButton("Start Progress Bar", 70, 270, 100, 25) $btn_change = GUICtrlCreateButton("Change", 215, 270, 90, 25) GUICtrlSetState($btn_change, $GUI_DISABLE) $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) _GUICtrlStatusBar_SetText($hStatusBar, "Timers") _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) GUICtrlSetColor($progress, 0xff0000) _GUICtrlStatusBar_EmbedControl($hStatusBar, 1, GUICtrlGetHandle($progress)) GUISetState() GUIRegisterMsg($WM_PAINT, "_WM_PAINT") _Timer_SetTimer($hGUI, 1000, "_UpdateStatusBarClock") ; create timer While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_state If GUICtrlRead($btn_state) = "Start Progress Bar" Then $iTimerProgress = _Timer_SetTimer($hGUI, $iWait, "_UpdateProgressBar") ; create timer If @error Or $iTimerProgress = 0 Then ContinueLoop GUICtrlSetData($btn_state, "Stop Progress Bar") GUICtrlSetState($btn_change, $GUI_ENABLE) Else GUICtrlSetState($btn_change, $GUI_DISABLE) _Timer_KillTimer($hGUI, $iTimerProgress) GUICtrlSetData($btn_state, "Start Progress Bar") EndIf Case $btn_change If $iWait = 10 Then $iWait = 250 Else $iWait = 10 EndIf MemoWrite("Timer for _UpdateProgressBar set at: " & $iWait & " milliseconds") $iTimerProgress = _Timer_SetTimer($hGUI, $iWait, "", $iTimerProgress) ; reuse timer with different interval EndSwitch WEnd ConsoleWrite("Killed All Timers? " & _Timer_KillAllTimers($hGUI) & @CRLF) GUIDelete() EndFunc ;==>_Example_CallBack ; call back function Func _UpdateStatusBarClock($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime _GUICtrlStatusBar_SetText($hStatusBar, @TAB & @TAB & StringFormat("%02d:%02d:%02d", @HOUR, @MIN, @SEC), 2) EndFunc ;==>_UpdateStatusBarClock ; call back function Func _UpdateProgressBar($hWnd, $Msg, $iIDTimer, $dwTime) #forceref $hWnd, $Msg, $iIDTimer, $dwTime $percent += 5 * $direction GUICtrlSetData($progress, $percent) If $percent = 100 Or $percent = 0 Then $direction *= -1 If $percent = 100 Then GUICtrlSetColor($progress, 0xff0000) ElseIf $percent = 0 Then GUICtrlSetColor($progress, 0x0000ff) EndIf EndFunc ;==>_UpdateProgressBar ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite Func _WM_PAINT($hWnd, $Msg) _GUICtrlStatusBar_EmbedControl($hStatusBar, 1, GUICtrlGetHandle($progress)) Return 'GUI_RUNDEFMSG' EndFunc ;==>WM_PAINT
    1 point
×
×
  • Create New...