Jump to content

Recommended Posts

Posted

OK, it seems it may not be an easy task to do. Another question then:

When running an Autoit script, is it possible to have a text box, instead of the icon, in the notification area? I am thinking of updating the text in that text box.

Posted

You could create a GUI that covers the taskbar area over the clock and overlay your own clock.  Here is a start just need to update the label with Time and Date to your liking format and tweak in position, color, ect.

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Misc.au3>
#include <StaticConstants.au3>

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

GuiCreate("NewClock", 100, 40, @DesktopWidth-120, @DesktopHeight-40, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0x070C0F)
GUICtrlCreateLabel("1:50 PM" & @CRLF & "Sun 12 Jan 2014", 1, 5, 100, 40, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x070C0F)
GUICtrlSetColor(-1, 0xFFFFFF)

GUISetState(@SW_SHOW)

While 1
    Sleep(50)
WEnd

Func _Exit()
    Exit
EndFunc
Posted (edited)

Great, thanks Universalist! One question though: The created GUI may cover some of the rightmost icons in the notification area. Is there a way to set the position of the rightmost icon in the notification area?

Edited by power1power1
Posted (edited)

Just change the GUI size to fit within the clock area and adjust the position as well. When I created the GUI it didn't cover up any of my icons but my time/date in the corner maybe a little bigger cause I already have the date and time in mine.

Also change the Font of the label (text) to get what you want.

You can increase the size of the time/date by following changing the format above to increase default size of the area then overlapping the GUI to be able to fit what you want in that area.

Edited by Rogue5099
Posted (edited)

This fits perfectly in my taskbar covering up the time.  You might also need to change the date format on your computer to make _NowDate display how you want it to.

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Date.au3>

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

Global $Lastsec, $Lastmin
GuiCreate("NewClock", 100, 40, @DesktopWidth-120, @DesktopHeight-36, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0x070C0F)
$Timedate = GUICtrlCreateLabel("", 1, 3, 100, 40, $SS_CENTER)
GUICtrlSetFont(-1, 9, 400)
GUICtrlSetBkColor(-1, 0x070C0F)
GUICtrlSetColor(-1, 0xFFFFFF)
$Date = _NowDate()
GUICtrlSetData(-1, _NowTime() & @CRLF & $Date)
AdlibRegister("UpdateTime", 200)

GUISetState(@SW_SHOW)

While 1
    Sleep(10)
WEnd

Func UpdateTime()
    Local $CurrentSec = @SEC    ;Prevents flickering
    Local $Currentmin   = @MIN  ;Prevents flickering
    If $CurrentSec <> $Lastsec Then
        $Lastsec = $CurrentSec
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
    EndIf
    If $Currentmin <> $Lastmin Then
        $Lastmin = $Currentmin
        $Date = _NowDate()
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
    EndIf
EndFunc   ;==>UpdateTime

Func _Exit()
    Exit
EndFunc

Edit:
Added ToolTip like windows has. I was also trying to allow double click label to run ShellExecute("timedate.cpl") but was not successful.
 

#NoTrayIcon
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Date.au3>

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

Global $Lastsec, $Lastmin
GuiCreate("NewClock", 100, 40, @DesktopWidth-120, @DesktopHeight-36, $WS_POPUP, $WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(0x070C0F)
$Timedate = GUICtrlCreateLabel("", 1, 3, 100, 40, $SS_CENTER)
GUICtrlSetTip(-1, _DateTimeFormat(_NowCalc(), 1), "", 0, 1)
GUICtrlSetFont(-1, 9, 400)
GUICtrlSetBkColor(-1, 0x070C0F)
GUICtrlSetColor(-1, 0xFFFFFF)
$Date = _NowDate()
GUICtrlSetData(-1, _NowTime() & @CRLF & $Date)
AdlibRegister("UpdateTime", 200)

GUISetState(@SW_SHOW)

While 1
    Sleep(10)
WEnd

Func UpdateTime()
    Local $CurrentSec = @SEC    ;Prevents flickering
    Local $Currentmin   = @MIN  ;Prevents flickering
    If $CurrentSec <> $Lastsec Then
        $Lastsec = $CurrentSec
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
        $FullTime = _NowCalc()
    EndIf
    If $Currentmin <> $Lastmin Then
        $Lastmin = $Currentmin
        $Date = _NowDate()
        GUICtrlSetTip($Timedate, _DateTimeFormat(_NowCalc(), 1), "", 0, 1)
        GUICtrlSetData($Timedate, _NowTime() & @CRLF & $Date)
    EndIf
EndFunc   ;==>UpdateTime

Func _Exit()
    Exit
EndFunc
Edited by Rogue5099

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...