Jump to content
Sign in to follow this  
Klexen

Button as a gif or png?

Recommended Posts

Klexen

Okay, I have a few buttons as images on my site using...

GUICtrlCreateButton ("", 176, 190, 75, 25, $BS_BITMAP)
GUICtrlSetImage (-1, "stop2.bmp",0,1)

How can I get an button that functions the same was as the above button, but can use a gif?

Edited by Klexen

Share this post


Link to post
Share on other sites
Valuater

How can I get an button that functions the same was as the above button, but can use a gif?

$Picture_Button = GUICtrlCreatePic()

This can use a gif file

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Klexen

SEE BELOW... REMOVED OLD CODE, AND ATTACHMENT.

Edited by Klexen

Share this post


Link to post
Share on other sites
Klexen

Ok, I pretty much got everything the way I want it, except for that damn Reset button. I want it to use my png file and not the bmp. If someone can help me with this I would really appreciate it.

I attached the new files... Anyone?

Here is the code...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\supcrap\SupermanReturns.ico
#AutoIt3Wrapper_outfile=..\NewTimer.exe
#AutoIt3Wrapper_Allow_Decompile=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstants.au3>
#include <A3LGDIPlus.au3>
#include <date.au3>

Dim $XS_n
Global Const $AC_SRC_ALPHA = 1
Global Const $ULW_ALPHA = 2

Global $File_Location = @ScriptDir & "\timer.ini"
Global $CheckBreak = IniRead($File_Location, "Timers", "BreakTime", "")
Global $CheckLunch = IniRead($File_Location, "Timers", "LunchTime", "")
Global $timer2 = ""
Global $activeTimer, $BreakUsed, $LunchUsed
Global $Secs, $Mins, $Hour, $Time, $CurrentTime


_GDIP_Startup ()
$pngSrc = "superlogo.png"
$hImage = _GDIP_ImageLoadFromFile ($pngSrc)

$width = _GDIP_ImageGetWidth ($hImage)
$height = _GDIP_ImageGetHeight ($hImage)


HotKeySet("{ESC}", "Terminate")

XPStyle(1)

$Gui_Main = GUICreate("Super Timer & Stop Timeout", $width, $height, @DesktopWidth-500,@DesktopHeight-450, $WS_POPUP, $WS_EX_LAYERED)
SetBitmap($Gui_Main, $hImage, 0)


GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
WinSetOnTop($Gui_Main, "", 1)


For $i = 0 To 255 Step 10
    SetBitmap($Gui_Main, $hImage, $i)
Next

$controlGui = GUICreate("ControlGUI", $width, $height, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Gui_Main)

AdlibEnable("stoptimeout", 50)

$font = "Berlin Sans FB"

GUICtrlCreatePic(@ScriptDir & "\grey.gif", 0, 0, $width, $height)
GUICtrlSetState(-1, $GUI_DISABLE)

$chkBreak = GUICtrlCreateCheckbox("", 48, 15, 13, 13)
$breaklabel = GUICtrlCreateLabel("BREAK", 65, 12, 86, 45)
GUICtrlSetFont($breaklabel, 14, 500, -1, $font)
GUICtrlSetColor($breaklabel, 0xdcdcdc)
GUICtrlSetBkColor($breaklabel, $Gui_BKCOLOR_TRANSPARENT)

$chkStopWatch = GUICtrlCreateCheckbox("", 151, 15, 13, 13)
$StopWatchLabel = GUICtrlCreateLabel("STOPWATCH", 171, 12, 115, 45)
GUICtrlSetFont($StopWatchLabel, 14, 400, -1, $font)
GUICtrlSetColor($StopWatchLabel, 0xdcdcdc)
GUICtrlSetBkColor($StopWatchLabel, $Gui_BKCOLOR_TRANSPARENT)

$chkLunch = GUICtrlCreateCheckbox("", 295, 15, 13, 13)
$LunchLabel = GUICtrlCreateLabel("LUNCH", 315, 12, 100, 65)
GUICtrlSetFont($LunchLabel, 14, 400, -1, $font)
GUICtrlSetColor($LunchLabel, 0xdcdcdc)
GUICtrlSetBkColor($LunchLabel, $Gui_BKCOLOR_TRANSPARENT)

$chkCountdown = GUICtrlCreateCheckbox("", 80, 58, 13, 13)
$CountDownLabel = GUICtrlCreateLabel("COUNTDOWN", 103, 54, 110, 25)
GUICtrlSetFont($CountDownLabel, 14, 500, -1, $font)
GUICtrlSetColor($CountDownLabel, 0xdcdcdc)
GUICtrlSetBkColor($CountDownLabel, $Gui_BKCOLOR_TRANSPARENT)

$txtboxHH = GUICtrlCreateInput("00", 225, 50, 28, 24, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
GUICtrlSetFont($txtboxHH, 10, 400, -1, $font)
GUICtrlSetColor($txtboxHH, 0xFF0000)
GUICtrlSetBkColor($txtboxHH, 0x000000)
GUICtrlSetLimit($txtboxHH, 2)

$HHSemi = GUICtrlCreateLabel(":", 254, 38, 6, 30)
GUICtrlSetFont($HHSemi, 25, 400, -1, $font)
GUICtrlSetColor($HHSemi, 0xdcdcdc)
GUICtrlSetBkColor($HHSemi, $Gui_BKCOLOR_TRANSPARENT)

$txtboxMM = GUICtrlCreateInput("00", 262, 50, 28, 24, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
GUICtrlSetFont($txtboxMM, 9, 400, -1, $font)
GUICtrlSetColor($txtboxMM, 0xFF0000)
GUICtrlSetBkColor($txtboxMM, 0x000000)
GUICtrlSetLimit($txtboxMM, 2)

$MMSemi = GUICtrlCreateLabel(":", 291, 38, 6, 30)
GUICtrlSetFont($MMSemi, 25, 400, -1, $font)
GUICtrlSetColor($MMSemi, 0xdcdcdc)
GUICtrlSetBkColor($MMSemi, $Gui_BKCOLOR_TRANSPARENT)

$txtboxSS = GUICtrlCreateInput("00", 299, 50, 28, 24, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
GUICtrlSetFont($txtboxSS, 9, 400, -1, $font)
GUICtrlSetColor($txtboxSS, 0xFF0000)
GUICtrlSetBkColor($txtboxSS, 0x000000)
GUICtrlSetLimit($txtboxSS, 2)

$CurrentDate = _DateTimeFormat(_NowCalc(), 1)
$CurrentDateLabel = GUICtrlCreateLabel($CurrentDate, 105, 89, 220)
GUICtrlSetFont($CurrentDateLabel, 12, 400, -1, $font)
GUICtrlSetColor($CurrentDateLabel, 0xdcdcdc)
GUICtrlSetBkColor($CurrentDateLabel, $Gui_BKCOLOR_TRANSPARENT)

$ticker = GUICtrlCreateInput("00:00:00", 115, 112, 200, 40, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
GUICtrlSetFont($ticker, 24, 800, 0)
GUICtrlSetColor($ticker, 0xFF0000)
GUICtrlSetBkColor($ticker, 0x000000)
$ticker = GUICtrlCreateInput("00:00:00", 115, 112, 200, 40, BitOR($ES_CENTER, $ES_AUTOHSCROLL))
GUICtrlSetFont($ticker, 24, 800, 0)
GUICtrlSetColor($ticker, 0xFF0000)
GUICtrlSetBkColor($ticker, 0x000000)


$StartButton = GUICtrlCreateButton("", 176, 160, 75, 25, $BS_BITMAP)
GUICtrlSetImage(-1, "start.bmp", 0, 1)

$StopButton = GUICtrlCreateButton("", 176, 190, 75, 25, $BS_BITMAP)
GUICtrlSetImage(-1, "stop.bmp", 0, 1)

$ResetButton = GUICtrlCreateButton("", 176, 220, 75, 25, $BS_BITMAP)
GUICtrlSetImage(-1, "reset.bmp", 0, 1)

;$Picture_Button = GUICtrlCreatePic("reset.gif",176, 250, 75, 25)

XPStyle(0)

GUISetState()

GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")


While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $StartButton
            $BreakChecked = GUICtrlRead($chkBreak)
            $CountdownChecked = GUICtrlRead($chkCountdown)
            $LunchChecked = GUICtrlRead($chkLunch)
            $StopWatchChcked = GUICtrlRead($chkStopWatch)
            Select
                Case $BreakChecked = $GUI_CHECKED
                    If $activeTimer <> "" Then ContinueLoop;will skip the next bit cos there is a timer running
                    If $CheckBreak = "" Then $CheckBreak = CreateBreakTime()
                    $BreakUsed = IniRead($File_Location, "Timers", "BreakTimeRemain", 0)
                    $BTstart = TimerInit()
                    AdlibEnable("BreakTimer", 50)
                    $activeTimer = "Break Timer"
                Case $CountdownChecked = $GUI_CHECKED
                    $HHboxTime = GUICtrlRead($txtboxHH)
                    $MMboxTime = GUICtrlRead($txtboxMM)
                    $SSboxTime = GUICtrlRead($txtboxSS)
                    
                    $HoursinMS = $HHboxTime * 3600000
                    $MinsinMS = $MMboxTime * 60000
                    $SecsinMS = $SSboxTime * 1000
                    $TotalCountTime = $HoursinMS + $MinsinMS + $SecsinMS
                    IniWrite($File_Location, "Timers", "CountDownTimer", $TotalCountTime)
                    If $activeTimer <> "" Then ContinueLoop;will skip the next bit cos there is a timer running
                    $CountTime = IniRead($File_Location, "Timers", "CountDownTimer", 0)
                    $Count = TimerInit()
                    AdlibEnable("CountDownTimer", 50)
                    $activeTimer = "Count Down"
                Case $LunchChecked = $GUI_CHECKED
                    If $activeTimer <> "" Then ContinueLoop;will skip the next bit cos there is a timer running
                    If $CheckLunch = "" Then $CheckLunch = CreateLunchBreakTime()
                    $LunchUsed = IniRead($File_Location, "Timers", "LunchTimeRemain", 0)
                    $LTstart = TimerInit()
                    AdlibEnable("LunchTimer", 50)
                    $activeTimer = "Lunch Timer"
                Case $StopWatchChcked = $GUI_CHECKED
                    If $activeTimer <> "" Then ContinueLoop;will skip the next bit cos there is a timer running
                    $timer2 = TimerInit()
                    AdlibEnable("Timer", 50)
                    $activeTimer = "Timer"
                Case Else
                    MsgBox(0, "Error:", "You need to check something to start.")
            EndSelect
        Case $StopButton
            If $activeTimer = "" Then ContinueLoop;no timer running so skip the next bit
            StopTimer()
            $activeTimer = ""
        Case $ResetButton
            $BreakChecked = GUICtrlRead($chkBreak)
            $LunchChecked = GUICtrlRead($chkLunch)
            $CountdownChecked = GUICtrlRead($chkCountdown)
            $StopWatchChecked = GUICtrlRead($chkStopWatch)
            Select
                Case $BreakChecked = $GUI_CHECKED
                    ResetBreakTimer()
                Case $LunchChecked = $GUI_CHECKED
                    ResetLunchTimer()
                Case $CountdownChecked = $GUI_CHECKED
                    MsgBox(0, "Error:", "No reset exists for this function.")
                Case $StopWatchChecked = $GUI_CHECKED
                    MsgBox(0, "Error:", "No reset exists for this function.")
                Case Else
                    MsgBox(0, "Error:", "You need to check something to reset.")
            EndSelect
    EndSwitch

WEnd

Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $Gui_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc   ;==>_WinMove


; Release resources
_API_DeleteObject ($hImage)
_GDIP_Shutdown ()


Func XPStyle($OnOff = 1)
    If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then
        $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties")
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
        Return 1
    ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then
        DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0])
        $XS_n = ""
        Return 1
    EndIf
    Return 0
EndFunc   ;==>XPStyle

Func Terminate()
    GUIDelete($Gui_Main)
    Exit
EndFunc   ;==>Terminate

Func SetBitmap($hGUI, $hImage, $iOpacity)
    Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend

    $hScrDC = _API_GetDC (0)
    $hMemDC = _API_CreateCompatibleDC ($hScrDC)
    $hBitmap = _GDIP_BitmapCreateHBITMAPFromBitmap ($hImage)
    $hOld = _API_SelectObject ($hMemDC, $hBitmap)
    $tSize = DllStructCreate($tagSIZE)
    $pSize = DllStructGetPtr($tSize)
    DllStructSetData($tSize, "X", _GDIP_ImageGetWidth ($hImage))
    DllStructSetData($tSize, "Y", _GDIP_ImageGetHeight ($hImage))
    $tSource = DllStructCreate($tagPOINT)
    $pSource = DllStructGetPtr($tSource)
    $tBlend = DllStructCreate($tagBLENDFUNCTION)
    $pBlend = DllStructGetPtr($tBlend)
    DllStructSetData($tBlend, "Alpha", $iOpacity)
    DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
    _API_UpdateLayeredWindow ($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
    _API_ReleaseDC (0, $hScrDC)
    _API_SelectObject ($hMemDC, $hOld)
    _API_DeleteObject ($hBitmap)
    _API_DeleteDC ($hMemDC)
EndFunc   ;==>SetBitmap

Func WM_NCHITTEST($HWnd, $iMsg, $iwParam, $ilParam)
    If ($HWnd = $Gui_Main) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST

;-----Create Lunch Break Time-----
Func CreateLunchBreakTime()
    $SetLunchTime = InputBox("Break Time", "How Long is your Lunch in minutes?", "60", "", 100, 135, 550, 575)
    IniWrite($File_Location, "Timers", "LunchTime", $SetLunchTime)
    Return $SetLunchTime
EndFunc   ;==>CreateLunchBreakTime

;-----Create Break Time-----
Func CreateBreakTime()
    $SetBreakTime = InputBox("Break Time", "How Long is your Break in minutes?", "15", "", 100, 135, 550, 575)
    IniWrite($File_Location, "Timers", "BreakTime", $SetBreakTime)
    Return $SetBreakTime
EndFunc   ;==>CreateBreakTime

;----Timer------
Func Timer()
    stoptimeout()
    _TicksToTime(Int(TimerDiff($timer2)), $Hour, $Mins, $Secs)
    Local $sTime = $Time ; save current time to be able to test and avoid flicker..
    $TimeLabel = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
    $mPos = MouseGetPos()
    $Time = ToolTip($TimeLabel, $mPos[0] + 13, $mPos[1] + 17, "Time Elapsed", 0, 1)
    If BitAND(GUICtrlGetState($ticker), $Gui_hide) Then GUICtrlSetState($ticker, $Gui_Show)
    If GUICtrlRead($ticker) <> $TimeLabel Then GUICtrlSetData($ticker, $TimeLabel)
    If $sTime <> $Time Then GUICtrlSetData($ticker, $TimeLabel)
EndFunc   ;==>Timer

;----Stop active timer and display time----
Func StopTimer()
    AdlibDisable()
    If $activeTimer = "Break Timer" Then
        If $BreakUsed > 0 Then
            $Remaining = $BreakUsed - Int(TimerDiff($BTstart))
        Else
            $Remaining = ($CheckBreak * 60 * 1000) - Int(TimerDiff($BTstart))
        EndIf
        IniWrite($File_Location, "Timers", "BreakTimeRemain", $Remaining)
    ElseIf $activeTimer = "Lunch Timer" Then;Lunch timer
        If $LunchUsed > 0 Then
            $Remaining = $LunchUsed - Int(TimerDiff($LTstart))
        Else
            $Remaining = ($CheckLunch * 60 * 1000) - Int(TimerDiff($LTstart))
        EndIf
        IniWrite($File_Location, "Timers", "LunchTimeRemain", $Remaining)
    EndIf
    GUICtrlSetData($ticker, "00:00:00")
    GUICtrlSetState($ticker, $Gui_hide)
    ToolTip("")
    AdlibEnable("stoptimeout")
EndFunc   ;==>StopTimer

Func CountDownTimer()
    If $CountTime > 0 Then;some of lunch time is already used up
        _TicksToTime(Int(($CountTime) - TimerDiff($Count)), $Hour, $Mins, $Secs);change $CheckBreak to MIlliseconds
    Else
        _TicksToTime(Int($CountTime * 60 * 1000 - TimerDiff($Count)), $Hour, $Mins, $Secs)
    EndIf
    Local $sTime = $Time
    $mPos = MouseGetPos()
    $TimeLabel = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
    $Time = ToolTip($TimeLabel, $mPos[0] + 13, $mPos[1] + 17, "Count Down", 0, 1)
    If BitAND(GUICtrlGetState($ticker), $Gui_hide) Then GUICtrlSetState($ticker, $Gui_Show)
    If GUICtrlRead($ticker) <> $TimeLabel Then GUICtrlSetData($ticker, $TimeLabel)
    If $TimeLabel = "00:05:00" Then MsgBox(262208, "", "5 minutes remaining", 5)
    If $TimeLabel = "00:00:00" Then
        IniWrite($File_Location, "Timers", "CountDownTimer", "0")
        $activeTimer = ""
        GUICtrlSetState($ticker, $Gui_hide)
        AdlibDisable()
        ToolTip("")
        AdlibEnable("stoptimeout")
        StartTimerCountDown()
    EndIf
EndFunc   ;==>CountDownTimer


;----Timer------
Func LunchTimer()
    stoptimeout()
    If $LunchUsed > 0 Then;some of lunch time is already used up
        _TicksToTime(Int(($LunchUsed) - TimerDiff($LTstart)), $Hour, $Mins, $Secs);change $CheckBreak to MIlliseconds
    Else
        _TicksToTime(Int($CheckLunch * 60 * 1000 - TimerDiff($LTstart)), $Hour, $Mins, $Secs)
    EndIf
    Local $sTime = $Time
    $mPos = MouseGetPos()
    $TimeLabel = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
    $Time = ToolTip($TimeLabel, $mPos[0] + 13, $mPos[1] + 17, "Lunch Timer", 0, 1)
    If BitAND(GUICtrlGetState($ticker), $Gui_hide) Then GUICtrlSetState($ticker, $Gui_Show)
    If GUICtrlRead($ticker) <> $TimeLabel Then GUICtrlSetData($ticker, $TimeLabel)
    If $TimeLabel = "00:05:00" Then MsgBox(262208, "", "5 minutes remaining", 5)
    If $TimeLabel = "00:00:00" Then
        IniWrite($File_Location, "Timers", "LunchTimeRemain", "0")
        $activeTimer = ""
        GUICtrlSetState($ticker, $Gui_hide)
        AdlibDisable()
        ToolTip("")
        AdlibEnable("stoptimeout")
        StartTimerHotkeyAfterLunch()
    EndIf
EndFunc   ;==>LunchTimer

;----Break Timer------
Func BreakTimer()
    stoptimeout()
    If $BreakUsed > 0 Then ;some of Break time is already used up
        _TicksToTime(Int(($BreakUsed) - TimerDiff($BTstart)), $Hour, $Mins, $Secs);change $CheckBreak to MIlliseconds
    Else
        _TicksToTime(Int(($CheckBreak * 60 * 1000) - TimerDiff($BTstart)), $Hour, $Mins, $Secs);change $CheckBreak to MIlliseconds
    EndIf

    Local $sTime = $Time
    $mPos = MouseGetPos()
    $TimeLabel = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs)
    $Time = ToolTip($TimeLabel, $mPos[0] + 13, $mPos[1] + 17, "Break Timer", 0, 1)
    If BitAND(GUICtrlGetState($ticker), $Gui_hide) Then GUICtrlSetState($ticker, $Gui_Show)
    If GUICtrlRead($ticker) <> $TimeLabel Then GUICtrlSetData($ticker, $TimeLabel)
    If $TimeLabel = "00:00:00" Then
        IniWrite($File_Location, "Timers", "BreakTimeRemain", "0")
        $activeTimer = ""
        GUICtrlSetState($ticker, $Gui_hide)
        AdlibDisable()
        ToolTip("")
        AdlibEnable("stoptimeout")
        StartTimerHotkeyAfterBreak()
    EndIf
EndFunc   ;==>BreakTimer

Func stoptimeout()
    Opt("WinTitleMatchMode", 1)
    If WinExists("Microsoft Internet Explorer", "Application timeout will occur in 10 minutes") Then
        ControlClick("Microsoft Internet Explorer", "", 1, "left", 1)
        _WinPrevious()
    EndIf
    If WinExists("Session time-out alert", "Your DSN session is about to time out.") Then
        ControlClick("Session time-out alert", "", 6, "left", 1)
        _WinPrevious()
    EndIf
    If WinExists("VBScript", "") Then
        ControlClick("VBScript", "", 6, "left", 1)
        _WinPrevious()
    EndIf
    
;~  Local $CurrTime = $CurrentTime
;~  $CurrentTime = _NowTime(1)
;~  If $CurrTime <> $CurrentTime Then GUICtrlCreateLabel($CurrentTime,95,145)
    
    Sleep(10)
    
EndFunc   ;==>stoptimeout

Func StartTimerHotkey()
    $timer2 = TimerInit()
    AdlibEnable("Timer", 50)
    $activeTimer = "Timer"
EndFunc   ;==>StartTimerHotkey

Func StopTimerHotkey()
    StopTimer()
    $activeTimer = ""
EndFunc   ;==>StopTimerHotkey

Func ResetBreakTimer()
    $BreakUsed = $CheckBreak * 60000
    IniWrite($File_Location, "Timers", "BreakTimeRemain", $BreakUsed)
EndFunc   ;==>ResetBreakTimer

Func ResetLunchTimer()
    $LunchBreakUsed = $CheckLunch * 60000
    IniWrite($File_Location, "Timers", "LunchTimeRemain", $LunchBreakUsed)
EndFunc   ;==>ResetLunchTimer

Func ResetCountDownTimer()
    IniWrite($File_Location, "Timers", "CountDownTimer", "")
EndFunc   ;==>ResetCountDownTimer

Func StartTimerHotkeyAfterBreak()
    $timer2 = TimerInit()
    AdlibEnable("Timer", 50)
    $activeTimer = "Timer"
    MsgBox(0, "Break has ended", "Your break has ended, now counting time elapsed passed break..." & @CRLF & "Click OK to see how much time has elapsed!")
EndFunc   ;==>StartTimerHotkeyAfterBreak

Func StartTimerHotkeyAfterLunch()
    $timer2 = TimerInit()
    AdlibEnable("Timer", 50)
    $activeTimer = "Timer"
    MsgBox(0, "Lunch has ended", "Your Lunch has ended, now counting time elapsed passed lunch break..." & @CRLF & "Click OK to see how much time has elapsed!")
EndFunc   ;==>StartTimerHotkeyAfterLunch

Func StartTimerCountDown()
    $timer2 = TimerInit()
    AdlibEnable("Timer", 50)
    $activeTimer = "Timer"
    MsgBox(0, "Lunch has ended", "Your Countdown has ended, now counting time elapsed passed Countdown..." & @CRLF & "Click OK to see how much time has elapsed!")
EndFunc   ;==>StartTimerCountDown



;----Stop timeout returns previous window----
Func _WinPrevious($z = 1)
    If $z < 1 Then Return SetError(1, 0, 0) ; Bad parameter
    Local $avList = WinList()
    For $n = 1 To $avList[0][0]
        ; Test for non-blank title, and is visible
        If $avList[$n][0] <> "" And BitAND(WinGetState($avList[$n][1]), 2) Then
            If $z Then
                $z -= 1
            Else
                WinActivate($avList[$n][1])
                Return 1
            EndIf
        EndIf
    Next
    Return SetError(2, 0, 0) ; z-depth exceeded
EndFunc   ;==>_WinPrevious

SuperTimerWork.zip

Edited by Klexen

Share this post


Link to post
Share on other sites
Klexen

Anyone?

Share this post


Link to post
Share on other sites
DirtDBaK

i was told how to do this, but i forget, as a button you're probabbly out of luck but as just a picture you can use an IE object


[center][/center]

Share this post


Link to post
Share on other sites
Klexen

i was told how to do this, but i forget, as a button you're probabbly out of luck but as just a picture you can use an IE object

Use IE oject to create a button on my GUI that is a png?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×