z0mgItsJohn Posted April 23, 2008 Posted April 23, 2008 Hello AutoIt Peoples.. I Just Made A Clock.. That Appears Where U Click.. No It Dose Not Follow.. The Mouse.. Enjoy I Got To Go To Bed x3 Feel Free To Post Comments.. Bugs.. Etc.. Source : Click Clock v1.0.Au3 expandcollapse popup#Include <GUIConstants.Au3> #Include <Misc.Au3> #Include <Date.Au3> #NoTrayIcon Opt ('GUIOnEventMode','1') Global $Click = False, $Space = (' ') While ('1') Sleep ('150') Do If _IsPressed ('01') Then _Create_Clock () $Click = True ExitLoop EndIf Until $Click = True ExitLoop WEnd Func _Create_Clock () WinMinimizeAll () Global $Pos = MouseGetPos () GUICreate ($Space & '.: Click Clock v1.0 :.','150','50', $Pos['0'] - '75', $Pos['1'] - '25','-1', $WS_EX_TOOLWINDOW) GUISetBkColor ('0x000000') GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') $Label = GUICtrlCreateLabel ('','21','15','150','100') GUICtrlSetFont ('-1','14','','','Arial') GUICtrlSetColor('-1','0xFF0000') GUISetState (@SW_SHOW) While ('1') Sleep ('250') $Current_Time = _NowTime () GUICtrlSetData ($Label, $Current_Time) Sleep ('250') WEnd EndFunc Func _Exit () Exit EndFunc ~ Enjoy ~ Latest Projects :- New & Improved TCP Chat
do3z Posted January 28, 2009 Posted January 28, 2009 Hello AutoIt Peoples.. I Just Made A Clock.. That Appears Where U Click.. No It Dose Not Follow.. The Mouse.. Enjoy I Got To Go To Bed x3 Feel Free To Post Comments.. Bugs.. Etc.. Source : Click Clock v1.0.Au3 expandcollapse popup#Include <GUIConstants.Au3> #Include <Misc.Au3> #Include <Date.Au3> #NoTrayIcon Opt ('GUIOnEventMode','1') Global $Click = False, $Space = (' ') While ('1') Sleep ('150') Do If _IsPressed ('01') Then _Create_Clock () $Click = True ExitLoop EndIf Until $Click = True ExitLoop WEnd Func _Create_Clock () WinMinimizeAll () Global $Pos = MouseGetPos () GUICreate ($Space & '.: Click Clock v1.0 :.','150','50', $Pos['0'] - '75', $Pos['1'] - '25','-1', $WS_EX_TOOLWINDOW) GUISetBkColor ('0x000000') GUISetOnEvent ($GUI_EVENT_CLOSE, '_Exit') $Label = GUICtrlCreateLabel ('','21','15','150','100') GUICtrlSetFont ('-1','14','','','Arial') GUICtrlSetColor('-1','0xFF0000') GUISetState (@SW_SHOW) While ('1') Sleep ('250') $Current_Time = _NowTime () GUICtrlSetData ($Label, $Current_Time) Sleep ('250') WEnd EndFunc Func _Exit () Exit EndFunc ~ Enjoy ~ Yeah i like the idea im running vista i open click somewhere this comes up any help? line 24 (Words Id rather not say) quicreat ($space& '.: click clock v1.0:.','150','50',$pos['0] - '75', $pos['1'] - '25','-1', $WS_EX_TOOLWINDOW) quicreat ($space& '.: click clock v1.0:.','150','50',$pos['0] - '75', $pos['1'] - '25','-1', ^ ERROR Errow: variable used without being declard. something like that anyways Google Is For Real Men. Yahoo Is For Wimps!
LIMITER Posted January 28, 2009 Posted January 28, 2009 (edited) Replace #include <GUIConstants.au3> with #Include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Cheers, L|M|TER Edited January 28, 2009 by LIMITER
FireFox Posted January 28, 2009 Posted January 28, 2009 (edited) @LIMITER Radical solution for includes : script is better too... expandcollapse popupOpt('GUIOnEventMode', 1) #NoTrayIcon Global $Click = False, $Space = (' ') While 1 Sleep(150) While $Click = False If _IsPressed('01') Then _Create_Clock() $Click = True ExitLoop EndIf WEnd ExitLoop WEnd Func _Create_Clock() WinMinimizeAll() Global $Pos = MouseGetPos() GUICreate($Space & '.: Click Clock v1.0 :.', 150, 50, $Pos[0] - 75, $Pos[1] - 25, -1, 0x00000080) GUISetBkColor(0x000000) GUISetOnEvent(-3, '_Exit') $Label = GUICtrlCreateLabel('', 21, 15, 150, 100) GUICtrlSetFont(-1, 14, 400, 1, 'Arial') GUICtrlSetColor(-1, 0xFF0000) GUISetState(@SW_SHOW) While 1 Sleep(250) $Current_Time = @HOUR & ':' & @MIN & ':' & @SEC GUICtrlSetData($Label, $Current_Time) Sleep(250) WEnd EndFunc ;==>_Create_Clock Func _Exit() Exit EndFunc ;==>_Exit #Region Include Func ; #FUNCTION# ==================================================================================================================== ; Name...........: _IsPressed ; Description ...: Check if key has been pressed ; Author ........: ezzetabi and Jon ; =============================================================================================================================== Func _IsPressed($sHexKey, $vDLL = 'user32.dll') ; $hexKey must be the value of one of the keys. ; _Is_Key_Pressed will return 0 if the key is not pressed, 1 if it is. Local $a_R = DllCall($vDLL, 'int', 'GetAsyncKeyState', 'int', '0x' & $sHexKey) If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1 Return 0 EndFunc ;==>_IsPressed #EndRegion Include Func Cheers, FireFox. Edited January 28, 2009 by FireFox
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