Jump to content
Sign in to follow this  
UEZ

Autoit SysInfo Clock v0.9.9.7 build 2014-08-27 beta

Recommended Posts

Hi UEZ,

really cool stuff :thumbsup:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-07-21 - Version 1.5.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-06-27 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (NEW 2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

very very nice :thumbsup: :thumbsup: :thumbsup:

SysInfo Clock.ini okey but can you use the registry

Do you think use regread ,regwrite

startup problem SysInfo Clock.ini

Edited by mesale0077

Share this post


Link to post
Share on other sites

very very nice :thumbsup: :thumbsup: :thumbsup:

SysInfo Clock.ini okey but can you use the registry

Do you think use regread ,regwrite

startup problem SysInfo Clock.ini

 

Sure I can use the registry to store values but I prefer the ini variant more. It's more portable this way!

@all: if something is not working properly don't hesitate to report it!!!

 

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

 

PdhExpandWildCardPathW 1st call unsuccessful, return:C0000BB8

PdhCollectQueryData error, return:800007D5

C:UsersStudioLaptopDesktopSysInfo Clock v0.9.5.0 build 2013-06-14 betaSysInfo Clock.au3 (402) : ==> Subscript used with non-Array variable.:

$iCounterValue = _PDH_UpdateCounter($hPDHQuery, $aCPUCounters[$iTotalCPUs - 1][1], 0, True)

$iCounterValue = _PDH_UpdateCounter($hPDHQuery, $aCPUCounters^ ERROR

I got this on my system.  What information do you need?


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Hi guiness,

i´ve had this error too (XP32).

Enabling the performance counters in the registry solved the problem...

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesPerfProcPerformance

Disable Performance Counters = 0

Edited by AndyG

Share this post


Link to post
Share on other sites

OK, I will have a look.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Now it displays the counter.

Though I still got this message in the console.

 

Error getting CPU counters!
PdhExpandWildCardPathW 1st call unsuccessful, return:C0000BB8

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

Hmm, this is Ascend4nt's baby. Maybe he can jump in and troubleshoot his _PDH_PerformanceCounters UDF or tell us what's wrong with the perf. counters.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

I didn't enable the registry entry, perhaps I should have mentioned that.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

If the performance counters are disabled or an error occured when reading it then current CPU usage will not be updated.

 

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Really nice script UEZ. Just one thing: maybe it's better to set the color of text based on color schema. I used white color and the text color was the same and isn't really easy to read.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

All seems to work fine here on AMD II x 4, win 7 32 bit, although I do get this in console.

"Error Calling PdhGetFormattedCounterValue for Handle:0x03EC5FE8, Path [if passed]:0, Return:C0000BC6"

Also, once the credits are rolling, there seems to be no way to exit the script, and I had to end it from TM.

Nice work all.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

There is a trayicon you can right click on JohnOne.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites

All seems to work fine here on AMD II x 4, win 7 32 bit, although I do get this in console.

 

"Error Calling PdhGetFormattedCounterValue for Handle:0x03EC5FE8, Path [if passed]:0, Return:C0000BC6"

 

Also, once the credits are rolling, there seems to be no way to exit the script, and I had to end it from TM.

 

Nice work all.

The errors in the console coming from _PDH_PerformanceCounters.au3. I'm searching for another way to get the current CPU usage.

To exit the scroller just press ESC.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

czardas,

use latest 7-Zip version because archive was created using LZMA2 compression method.
 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By CarlD
      TalkTock is a talking clock. It's configurable via the opening screen, an .ini file, or the command line. The .ini offers the widest range of options, including language preferences.
      Links:
      ReadMe TalkTock.zip: contains .exe, .ini files, ReadMe and ListVoices.exe (TTS utility) Source:
      #cs -------------------------------------- TalkTock.au3 -- Talking Clock CLD rev.2020-08-09 (freeware -- no warranties expressed or implied) Usages (1) TalkTock [/I #] [/C 12|24] [/V #] [/R #] [/S ["]voice name["]|hint] [/U S|M|H|D|W|T|Y=#] [/Q|/QQ] /I = Interval between time announcements (in minutes) /C = Clock style (12- or 24-hour) /V = Volume (range 1 to 100) /R = speaking Rate (range -10 to 10) /S "voice name"|hint (hint = unique substring of voice name) /T = Say time only (no prefix or postfix) /U S|M|H|D|W|T|Y=# = clock stops after # Secs|Mins|Hrs|Days|Wks|monThs|Yrs /Q = Quiet (time displayed on screen, not spoken) /QQ = NOT Quiet (overrides Quiet=1 setting in TalkTock.ini) User-selected values are saved in TalkTock.ini. Language preferences and other settings can be changed by editing TalkTock.ini in any text editor. (2) TalkTock /?|?H|/SayHelp|/Kill /?|/H = Display on-screen help /SayHelp = Speak the help screen /Kill = Kill ALL running TalkTock.exe processes (3) TalkTock /L List available voices (4) TalkTock /UseFile [d:\path\]INI_filename Take settings from a specified settings file (must have TalkTock.ini format) (5) TalkTock /RESET Create new TalkTock.ini with default settings (existing TalkTock.ini is backed up to TalkTock.IN_) (6) TalkTock /SOURCE View AutoIt source code -------------------------------------- #ce #include <AutoItConstants.au3> #include <ButtonConstants.au3> #include <Date.au3> #include <FileConstants.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> #include <TrayConstants.au3> #include <WindowsConstants.au3> #pragma compile(AutoItExecuteAllowed, True) Opt("TrayAutoPause", 0) Opt("TrayMenuMode", 1) Opt("TrayOnEventMode", 1) ; Icon by Ampeross (free for non-commercial use) ; http://www.iconarchive.com/show/qetto-2-icons-by-ampeross/timer-icon.html FileInstall("X:\Ampeross-Qetto-2-Timer.ico", @TempDir, 1) FileInstall("X:\ausource.txt", @TempDir, 1) $sCMline = $CmdLineRaw $sCurWin = WinGetTitle("[active]") ; Warning on multiple TalkTock processes If _Single() = 0 Then If $CmdLine[0] = 0 Or ( StringInStr($sCMline, "kill") + StringInStr($sCMline, "reset") + StringInStr($sCMline, "source") + StringInStr($sCMline, "/?") + StringInStr($sCMline, "-?") + StringInStr($sCMline, "/h") + StringInStr($sCMline, "-h") + StringInStr($sCMline, "/L") + StringInStr($sCMline, "-L") = 0 ) Then ReStartTT() EndIf ; Default interval, 12|24, volume, talk rate settings, etc. Local $idFreq = 15 ; Default interval every 15 minutes Local $vdT12or24 = 12 ; 12- or 24-hour time (Clock style) Local $sdVoice = "" ; TTS voice (""=use default voice) Local $idVol = 80 ; Volume (range 0 to 100) Local $idRate = 0 ; Speaking rate (range -10 to 10) Local $idStop = 0 ; Clock stops = 0 (Never) Local $sdUnits = "H" ; Stop clock units (default = H = hours) Local $bdQuiet = 0 ; Quiet operation (time shown on screen) Local $idDisplay = 2 ; Duration of on-screen time display in secs. ; ; (has effect only if $bQuiet = 1) ; --------------------------------------------------------------- Local $bCanned = 1 ; "Canned" or custom interval Local $bdTimeOnly = 0 ; ; ; Default phrases Local $sdHi = "Welcome to TalkTock, the Talking Clock" Local $sdPause = "TalkTock paused" Local $sdResume = "TalkTock resumed" Local $sdStopSay = "Goodbye" Local $sdIntro = "The time will be announced every" Local $sdPrefix = "It's" Local $sdPrefix1 = "" Local $bdSayAMPM = 1 Local $sdHowFreq1 = "minnit" ; spelling altered to aid pronunciation Local $sdHowFreq5 = "5 minutes at the 5-minute mark" Local $sdHowFreq10 = "10 minutes at the 10-minute mark" Local $sdHowFreq15 = "15 minutes on the quarter hour" Local $sdHowFreq30 = "30 minutes on the half hour" Local $sdHowFreq60 = "'our on the hour"; pronunciation Local $sdHowFreqCustom = "minutes" Local $sdBye = "Goodbye" #cs ; Default phrases Local $sdHi = "" Local $sdPause = "" Local $sdResume = "" Local $sdStopSay = "" Local $sdIntro = "" Local $sdPrefix = "" Local $sdPrefix1 = "" Local $bdSayAMPM = 1 Local $sdHowFreq1 = "" Local $sdHowFreq5 = "" Local $sdHowFreq10 = "" Local $sdHowFreq15 = "" Local $sdHowFreq30 = "" Local $sdHowFreq60 = "" Local $sdHowFreqCustom = "" Local $sdBye = "" #ce ; Default GUI labels Local $sgdTitle = "TalkTock - Talking Clock" Local $sgdTop = "Say the time every" Local $sgdMinute = "minute" Local $sgdMinutes = "minutes" Local $sgdQuarterHour = "quarter hour" Local $sgdHalfHour = "half hour" Local $sgdHour = "hour" Local $sgdHours = "hours" Local $sgdCustom = "Custom" Local $sgdClock = "Clock style" Local $sgd12hr_Label = "12-hour" Local $sgd24hr_label = "24-hour" Local $sgdQuiet_label = "Time is: " Local $sgdSpeak_label = "spoken" Local $sgdDisplay_label = "displayed" Local $sgdExpires = "Clock stops " Local $sgdExpNever = " Never" Local $sgdExpAfter = " After " Local $sgdExpSecs = "secs" Local $sgdExpMins = "mins" Local $sgdExpHours = "hours" Local $sgdExpDays = "days" Local $sgdExpWeeks = "weeks" Local $sgdExpMons = "months" Local $sgdExpYears = "years" Local $sgdVolume_label = "Volume" Local $sgdStart_button = "Start" Local $sgdCancel_button = "Cancel" Local $sgdPause = "Pause" Local $sgdResume = "Resume" Local $sgdExit = "Stop" ; Failsafe assignments Local $sVoice = $sdVoice Local $iFreq = $idFreq Local $vT12or24 = $vdT12or24 If $vT12or24 <> 24 Then $vT12or24 = 12 Local $iVol = $idVol Local $iRate = $idRate Local $bQuiet = $bdQuiet Local $iDisplay = $idDisplay Local $iStop = $idStop Local $sUnits = $sdUnits Local $sStopFn = "" Local $sHi = $sdHi Local $sPause = $sdPause Local $sResume = $sdResume Local $sStopSay = $sdStopSay Local $sIntro = $sdIntro Local $sPrefix = $sdPrefix Local $sPrefix1 = $sdPrefix1 Local $bSayAMPM = $bdSayAMPM If $vT12or24 = 24 Then $bSayAMPM = 0 Local $sHowFreq1 = $sdHowFreq1 Local $sHowFreq5 = $sdHowFreq5 Local $sHowFreq10 = $sdHowFreq10 Local $sHowFreq15 = $sdHowFreq15 Local $sHowFreq30 = $sdHowFreq30 Local $sHowFreq60 = $sdHowFreq60 Local $sHowFreqCustom = $sdHowFreqCustom Local $sBye = $sdBye ; GUI Labels Local $sgPause = $sgdPause Local $sgResume = $sgdResume Local $sgExit = $sgdExit Local $sgTitle = $sgdTitle Local $sgTop = $sgdTop Local $sgMinute = $sgdMinute Local $sgMinutes = $sgdMinutes Local $sgQuarterHour = $sgdQuarterHour Local $sgHalfHour = $sgdHalfHour Local $sgHour = $sgdHour Local $sgHours = $sgdHours Local $sgCustom = $sgdCustom Local $sgClock = $sgdClock Local $sg12hr_label = $sgd12hr_Label Local $sg24hr_label = $sgd24hr_label Local $sgQuiet_label = $sgdQuiet_label Local $sgSpeak_label = $sgdSpeak_label Local $sgDisplay_label = $sgdDisplay_label Local $sgExpires = $sgdExpires Local $sgExpNever = $sgdExpNever Local $sgExpAfter = $sgdExpAfter Local $sgExpSecs = $sgdExpSecs Local $sgExpMins = $sgdExpMins Local $sgExpHours = $sgdExpHours Local $sgExpDays = $sgdExpDays Local $sgExpWeeks = $sgdExpWeeks Local $sgExpMons = $sgdExpMons Local $sgExpYears = $sgdExpYears Local $sgVolume_label = $sgdVolume_label Local $sgStart_button = $sgdStart_button Local $sgCancel_button = $sgdCancel_button Local $sPad = " "; | & $sPad | Local $sHelp = "TalkTock -- The Talking Clock" & @CRLF & "CLD rev.2020-07-31 (freeware -- no warranties expressed or implied)" & @CRLF & @CRLF & "Usage:" & @CRLF & "(1) START /MIN TalkTock.exe" & @CRLF & $sPad & "Choose options, then click ""Start""" & @CRLF & @CRLF & "(2) START /MIN TalkTock.exe [/I #] [/C 12|24] [/V #]] [/R #] [/S [""]voice name[""]|hint] [/U S|M|H|D|W|T|Y=#] [/Q|/QQ]" & @CRLF & $sPad & "/I = Interval between time announcements (in minutes)" & @CRLF & $sPad & "/C = Clock style (12- or 24-hour)" & @CRLF & $sPad & "/V = Volume (range 1 to 100)" & @CRLF & $sPad & "/R = speaking Rate (range -10 to 10)" & @CRLF & $sPad & "/S ""voice name""|hint (hint = unique substring of voice name)" & @CRLF & $sPad & "/T = Say time only, no prefix or postfix (instant compatibility with any language)" & @CRLF & $sPad & "/U S|M|H|D|W|T|Y=# = clock stops after # Secs|Mins|Hrs|Days|Wks|monThs|Yrs" & @CRLF & $sPad & "/Q = Quiet (time displayed on screen, not spoken)" & @CRLF & $sPad & "/QQ = NOT Quiet (overrides Quiet=1 setting in TalkTock.ini)" & @CRLF & @CRLF & "User-selected values are saved in TalkTock.ini." & @CRLF & "Language preferences and other settings can be changed by editing" & @CRLF & " TalkTock.ini in any text editor." & @CRLF & "" & @CRLF & "(3) TalkTock /?|/H|/SayHelp|/Kill" & @CRLF & $sPad & "/?|/H = Display on-screen help" & @CRLF & $sPad & "/SayHelp = Spoken command-line usage" & @CRLF & $sPad & "/Kill = Kill ALL running TalkTock.exe processes" & @CRLF & @CRLF & "(4) TalkTock /L" & @CRLF & $sPad & "List available voices" & @CRLF & @CRLF & "(5) START /MIN TalkTock /UseFile [d:\path\]INI_filename" & @CRLF & $sPad & "Take settings from a specified settings file" & @CRLF & $sPad & "(must have TalkTock.ini format)" & @CRLF & @CRLF & "(6) TalkTock /RESET" & @CRLF & $sPad & "Create new TalkTock.ini with default settings" & @CRLF & $sPad & "(existing TalkTock.ini is backed up to TalkTock.IN_)" & @CRLF & @CRLF & "(6) TalkTock /SOURCE" & @CRLF & $sPad & "View AutoIt source code" & @CRLF ; Create TalkTock.ini (if not already present) Local $sFini = @ScriptName Local $sFini2 = ""; alternate .INI file If StringInStr($sFini, ".") Then $sFini = StringTrimRight($sFini, StringLen($sFini) - StringInStr($sFini, ".", 0, -1) + 1) $sFini = @ScriptDir & "\" & $sFini & ".ini" ;Create new (default) TalkTock.ini If $CmdLine[0] = 1 Then If StringInStr(StringUpper($CmdLine[1]), "RESET") Then If FileExists($sFini) Then FileCopy($sFini, @ScriptDir & "\TalkTock.IN_", $FC_OVERWRITE) FileDelete($sFini) EndIf EndIf EndIf ; Take settings from file not TalkTock.ini If $CmdLine[0] = 2 Then If StringUpper($CmdLine[1]) = "/USEFILE" Or StringUpper($CmdLine[1]) = "-USEFILE" Then $sFini2 = $CmdLine[2] If FileExists($sFini2) Then $sFini = $sFini2 EndIf EndIf If Not FileExists($sFini) Then $hIni = FileOpen($sFini, $FO_OVERWRITE + $FO_UTF8) If $hIni > -1 Then Local $sIniC = "Settings file for TalkTock.exe, Talking Clock" & @CRLF & ";" & @CRLF & "[TalkTock]" & @CRLF & ";; Interval between time announcements, in minutes" & @CRLF & "Interval=" & $idFreq & @CRLF & ";; 12- or 24-hour clock" & @CRLF & "ClockStyle=" & $vdT12or24 & @CRLF& ";; Say AM/PM? 1=Yes 0=No; applies to 12-hour clock only" & @CRLF & "SayAMPM=" & $bdSayAMPM & @CRLF& ";; TTS voice" & @CRLF & "Voice=default" & @CRLF & ";Voice=Microsoft George" & @CRLF& ";; Volume, range 1 to 100" & @CRLF & "Volume=" & $idVol & @CRLF& ";; Speaking rate, range -10 to 10" & @CRLF & "TalkRate=" & $idRate & @CRLF & ";; Clock stop timer units" & @CRLF & ";; S=secs M=mins H=hours D=days W=weeks T=months Y=years" & @CRLF & "ClockTimerUnits=" & $sdUnits & @CRLF& ";; Clock stops after how many timer units? (0 = clock never stops)" & @CRLF & "ClockStops=0" & @CRLF & ";; Quiet operation, time shown on screen (1=yes 0=no)" & @CRLF & "Quiet=0" & @CRLF & ";; Duration, in seconds, of on-screen time display" & @CRLF & ";; Fractional (decimal) values are allowed (e.g., Display=3.5)" & @CRLF & "Display=2.5" & @CRLF & @CRLF $sIniC &= "[Language]" & @CRLF & ";; Translate the phrases and labels below into your chosen language." & @CRLF & ";; Any language with a TTS function (a ""Voice"") in its language pack" & @CRLF & ";; should work. To use other languages, edit TalkTock.ini using the" & @CRLF & ";; UTF-8 character set" & @CRLF & ";" & @CRLF & ";; TimeOnly: 1=Yes (phrases set below will NOT be spoken); 0=No" & @CRLF & "TimeOnly=0" & @CRLF & ";" & @CRLF & "onStart=" & $sdHi & @CRLF& "Intro=" & $sdIntro & @CRLF & "Freq1=" & $sdHowFreq1 & @CRLF & "Freq5=" & $sdHowFreq5 & @CRLF & "Freq10=" & $sdHowFreq10 & @CRLF & "Freq15=" & $sdHowFreq15 & @CRLF & "Freq30=" & $sdHowFreq30 & @CRLF & "Freq60=" & $sdHowFreq60 & @CRLF & "FreqCustom=" & $sdHowFreqCustom & @CRLF & ";; Spoken prefix" & @CRLF & "Prefix=" & $sdPrefix & @CRLF & ";; No prefix (just announce the time):" & @CRLF & ";Prefix=" & @CRLF & ";Prefix=It's" & @CRLF & ";Prefix=It's now" & @CRLF & ";Prefix=The time is" & @CRLF & ";; Singular prefix: Prefix1 defines the singular inflection" & @CRLF & ";; for ""one o'clock"" in applicable languages, e.g., Italian" & @CRLF & ";Prefix1=" & @CRLF & ";" & @CRLF $sIniC &= ";; Postfix pairs (optional)" & @CRLF & ";; ------------------------" & @CRLF & ";; Alternatives to saying ""AM/PM"" (or equivalent) after the time" & @CRLF & ";; If time falls within Range, TalkTock says" & @CRLF & ";; Phrase after saying the time" & @CRLF & ";; You can set as many, or as few, of these pairs as you like" & @CRLF & ";; Note: Range# settings must have content (a time range hhmm-hhmm)" & @CRLF & ";; Phrase# settings can be a phrase or empty (say nothing)" & @CRLF & ";Range1=0000-0000" & @CRLF & ";Phrase1=Midnight" & @CRLF& ";Range2=0001-0329" & @CRLF & ";Phrase2=A.M." & @CRLF& ";Range3=0330-1159" & @CRLF & ";Phrase3=in the morning" & @CRLF& ";Range4=1200-1200" & @CRLF & ";Phrase4=Noon" & @CRLF& ";Range5=1201-1659" & @CRLF & ";Phrase5=in the afternoon" & @CRLF& ";Range6=1700-1959" & @CRLF & ";Phrase6=in the evening" & @CRLF & ";Range7=2000-2359" & @CRLF & ";Phrase7=at night" & @CRLF & ";; ------------------------" & @CRLF & ";" & @CRLF & ";; Pause/Resume/Stop" & @CRLF & "onPause=" & $sdPause & @CRLF & "onResume=" & $sdResume & @CRLF & "onStop=" & $sdBye & @CRLF & @CRLF $sIniC &= "[GUI_Labels]" & @CRLF & "Title=" & $sgdTitle & @CRLF & "Top=" & $sgdTop & @CRLF & "Minute=" & $sgdMinute & @CRLF & "Minutes=" & $sgdMinutes & @CRLF & "QuarterHour=" & $sgdQuarterHour & @CRLF & "HalfHour=" & $sgdHalfHour & @CRLF & "Hour=" & $sgdHour & @CRLF & "Hours=" & $sgdHours & @CRLF & "CustomLabel=" & $sgdCustom & @CRLF & "ClockStyle=" & $sgdClock & @CRLF & "12-hour_Label=" & $sgd12hr_Label & @CRLF & "24-hour_Label=" & $sgd24hr_label & @CRLF & "Quiet_label=" & $sgdQuiet_label & @CRLF & "Speak_label=" & $sgdSpeak_label & @CRLF & "Display_label=" & $sgdDisplay_label & @CRLF & "ClockStop_Label=" & $sgdExpires & @CRLF & "ClockStopsNever_Label=" & $sgdExpNever & @CRLF & "ClockStopsAfter_Label=" & $sgdExpAfter & @CRLF & "ClockStopsAfterSecs_Label=" & $sgExpSecs & @CRLF & "ClockStopsAfterMins_Label=" & $sgExpMins & @CRLF & "ClockStopsAfterHours_Label=" & $sgExpHours & @CRLF & "ClockStopsAfterDays_Label=" & $sgdExpDays & @CRLF & "ClockStopsAfterWeeks_Label=" & $sgdExpWeeks & @CRLF & "ClockStopsAfterMons_Label=" & $sgdExpMons & @CRLF & "ClockStopsAfterYears_Label=" & $sgdExpYears & @CRLF & "Volume_Label=" & $sgdVolume_label & @CRLF & "ClockStop_Label=Clock stops" & @CRLF & "ClockStopsAfter_Label=After" & @CRLF & "ClockStopsHours_Label=hours" & @CRLF & "ClockStopsNever_Label=Never" & @CRLF & "Start_button=Start" & @CRLF & "Cancel_button=Cancel" & @CRLF & "Tray_pause=Pause" & @CRLF & "Tray_resume=Resume" & @CRLF & "Tray_exit=Stop" & @CRLF If Not FileWrite($hIni, $sIniC) Then MsgBox($MB_ICONWARNING, @ScriptName, "Error writing " & $sFini, 3) FileClose($hIni) EndIf EndIf Global $sFiniV = _IniFileReadFile($sFini) If Not $sFiniV Then _ExitErr("Error reading " & $sFini) ; Read values from TalkTock.ini/alternate .ini $iFreq = _IniFileRead("sFiniV", "TalkTock", "Interval", $idFreq) $vT12or24 = _IniFileRead("sFiniV", "TalkTock", "ClockStyle", $vdT12or24) $bSayAMPM = _IniFileRead("sFiniV", "TalkTock", "SayAMPM", $bdSayAMPM) $sVoice = _IniFileRead("sFiniV", "TalkTock", "Voice", $sdVoice) If StringUpper($sVoice) = "DEFAULT" Then $sVoice = "" $iVol = _IniFileRead("sFiniV", "TalkTock", "Volume", $idVol) $iRate = _IniFileRead("sFiniV", "TalkTock", "TalkRate", $idRate) $iStop = _IniFileRead("sFiniV", "TalkTock", "ClockStops", $idStop) $sUnits = _IniFileRead("sFiniV", "TalkTock", "ClockTimerUnits", $sdUnits) $bQuiet = _IniFileRead("sFiniV", "TalkTock", "Quiet", $bdQuiet) $iDisplay = _IniFileRead("sFiniV", "TalkTock", "Display", $idDisplay) $bTimeOnly = _IniFileRead("sFiniV", "Language", "onStart", $bdTimeOnly) $sHi = _IniFileRead("sFiniV", "Language", "onStart", $sdHi) $sIntro = _IniFileRead("sFiniV", "Language", "Intro", $sdIntro) $sHowFreq1 = _IniFileRead("sFiniV", "Language", "Freq1", $sdHowFreq1) $sHowFreq5 = _IniFileRead("sFiniV", "Language", "Freq5", $sdHowFreq5) $sHowFreq10 = _IniFileRead("sFiniV", "Language", "Freq10", $sdHowFreq10) $sHowFreq15 = _IniFileRead("sFiniV", "Language", "Freq15", $sdHowFreq15) $sHowFreq30 = _IniFileRead("sFiniV", "Language", "Freq30", $sdHowFreq30) $sHowFreq60 = _IniFileRead("sFiniV", "Language", "Freq60", $sdHowFreq60) $sHowFreqCustom = _IniFileRead("sFiniV", "Language", "FreqCustom", $sdHowFreqCustom) $sPrefix = _IniFileRead("sFiniV", "Language", "Prefix", "") $sPrefix1 = _IniFileRead("sFiniV", "Language", "Prefix1", $sdPrefix1) $sPause = _IniFileRead("sFiniV", "Language", "onPause", $sdPause) $sResume = _IniFileRead("sFiniV", "Language", "onResume", $sdResume) $sStopSay = _IniFileRead("sFiniV", "Language", "onStop", $sdStopSay) $sBye = _IniFileRead("sFiniV", "Language", "onStop", $sdBye) ; GUI_Labels $sgTitle = _IniFileRead("sFiniV", "GUI_Labels", "Title", $sgdTitle) $sgTop = _IniFileRead("sFiniV", "GUI_Labels", "Top", $sgdTop) $sgMinute = _IniFileRead("sFiniV", "GUI_Labels", "Minute", $sgdMinute) $sgMinutes = _IniFileRead("sFiniV", "GUI_Labels", "Minutes", $sgdMinutes) $sgQuarterHour = _IniFileRead("sFiniV", "GUI_Labels", "QuarterHour", $sgdHour) $sgHalfHour = _IniFileRead("sFiniV", "GUI_Labels", "HalfHour", $sgdHours) $sgHour = _IniFileRead("sFiniV", "GUI_Labels", "Hour", $sgdHour) $sgHours = _IniFileRead("sFiniV", "GUI_Labels", "Hours", $sgdHours) $sgCustom = _IniFileRead("sFiniV", "GUI_Labels", "CustomLabel", $sgdCustom) $sgClock = _IniFileRead("sFiniV", "GUI_Labels", "ClockStyle", $sgdClock) $sg12hr_label = _IniFileRead("sFiniV", "GUI_Labels", "12-hour_Label", $sgd12hr_Label) $sg24hr_label = _IniFileRead("sFiniV", "GUI_Labels", "24-hour_Label", $sgd24hr_label) $sgQuiet_label = _IniFileRead("sFiniV", "GUI_Labels", "Quiet_label", $sgdQuiet_label) $sgSpeak_label = _IniFileRead("sFiniV", "GUI_Labels", "Speak_label", $sgdSpeak_label) $sgDisplay_label = _IniFileRead("sFiniV", "GUI_Labels", "Display_label", $sgdDisplay_label) ; $sgExpires = _IniFileRead("sFiniV", "GUI_Labels", "ClockStop_Label", $sgdExpires) $sgExpNever = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsNever_Label", $sgdExpNever) $sgExpAfter = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfter_Label", $sgdExpAfter) $sgExpSecs = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterSecs_Label", $sgdExpSecs) $sgExpMins = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterMins_Label", $sgdExpMins) $sgExpHours = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterHours_Label", $sgdExpHours) $sgExpDays = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterDays_Label", $sgdExpDays) $sgExpWeeks = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterWeeks_Label", $sgdExpWeeks) $sgExpMons = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterMons_Label", $sgdExpMons) $sgExpYears = _IniFileRead("sFiniV", "GUI_Labels", "ClockStopsAfterYears_Label", $sgdExpYears) ; $sgVolume = _IniFileRead("sFiniV", "GUI_Labels", "Volume_Label", $sgdVolume_label) $sgStart_button = _IniFileRead("sFiniV", "GUI_Labels", "Start_button", $sgdStart_button) $sgCancel_button = _IniFileRead("sFiniV", "GUI_Labels", "Cancel_button", $sgdCancel_button) $sgPause = _IniFileRead("sFiniV", "GUI_Labels", "Tray_pause", $sgdPause) $sgResume = _IniFileRead("sFiniV", "GUI_Labels", "Tray_resume", $sgdResume) $sgExit = _IniFileRead("sFiniV", "GUI_Labels", "Tray_exit", $sgdExit) ; $hTrayPA = TrayCreateItem($sgPause, -1, 0) $hTrayEX = TrayCreateItem($sgExit, -1, 1) TraySetClick(1) TraySetState($TRAY_ICONSTATE_SHOW) TrayItemSetOnEvent($hTrayPA, "_TrayPause") TrayItemSetOnEvent($hTrayEX, "_TrayExit") ; Postfix pairs: get values Local $aParts[1000][2] $aParts[0][0] = 0 If $bTimeOnly = 0 Then $aParts = PostfixPairsRead() $sFiniV = "" Local $iS = 0 ; seconds counter Local $sDate1, $sDate2, $sTimerFn = "", $iBabyPID = -1 Local $oVox = ObjCreate("SAPI.spVoice") If @error Then _ExitErr("SAPI error") $oVox.Volume = $iVol $oVox.Rate = $iRate ; Args so skip the GUI (except if arg = RESET) If $CmdLine[0] > 0 Then If StringInStr($sCMline, "/s") Then $sVoice = _GetArgValue("/s") If StringInStr($sCMline, "-s") Then $sVoice = _GetArgValue("-s") If $sVoice Then $oVoices = $oVox.GetVoices() For $vName in $oVoices If StringInStr($vName.GetDescription(), $sVoice) Then $oVox.Voice = $vName ExitLoop EndIf Next EndIf If StringInStr(StringUpper($CmdLine[1]), "RESET") Then Exit MsgBox($MB_OK, @ScriptName, "Default settings restored in " & $sFini) Else Exit MAIN() EndIf EndIf ; GUI interface ; ------------- $hgTT = GUICreate($sgTitle, 638, 400, 213, 385, $WS_EX_APPWINDOW) GUISetState(@SW_SHOW, $hgTT) ;#Region ### START Koda GUI section ### Form=TT1.kxf ;$GroupBox1 = GUICtrlCreateGroup("", -8, -32, 526, 822) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, 0xFFFFFF) $Label1 = GUICtrlCreateLabel($sgTop & ":", 8, 16, 137, 24) $hgA = GUICtrlCreateCheckbox($sgMinute, 16, 48, 113, 17) If $iFreq = 1 Then GUICtrlSetState($hgA, $GUI_CHECKED) Else GUICtrlSetState($hgA, $GUI_UNCHECKED) EndIf $hgB = GUICtrlCreateCheckbox("5 " & $sgMinutes, 16, 72, 113, 17) If $iFreq = 5 Then GUICtrlSetState($hgB, $GUI_CHECKED) Else GUICtrlSetState($hgB, $GUI_UNCHECKED) EndIf $hgC = GUICtrlCreateCheckbox("10 " & $sgMinutes, 16, 96, 113, 17) If $iFreq = 10 Then GUICtrlSetState($hgC, $GUI_CHECKED) Else GUICtrlSetState($hgC, $GUI_UNCHECKED) EndIf $hgD = GUICtrlCreateCheckbox($sgQuarterHour, 16, 120, 113, 17) If $iFreq = 15 Then GUICtrlSetState($hgD, $GUI_CHECKED) Else GUICtrlSetState($hgD, $GUI_UNCHECKED) EndIf $hgE = GUICtrlCreateCheckbox($sgHalfHour, 16, 144, 113, 17) If $iFreq = 30 Then GUICtrlSetState($hgE, $GUI_CHECKED) Else GUICtrlSetState($hgE, $GUI_UNCHECKED) EndIf $hgF = GUICtrlCreateCheckbox($sgHour, 16, 168, 113, 17) If $iFreq = 60 Then GUICtrlSetState($hgF, $GUI_CHECKED) Else GUICtrlSetState($hgF, $GUI_UNCHECKED) EndIf $hgX = GUICtrlCreateCheckbox($sgCustom & ":", 16, 192, 89, 17) $hgXt = GUICtrlCreateInput("", 96, 192, 41, 28) $Label2 = GUICtrlCreateLabel(" " & $sgMinutes, 144, 192, 60, 24) If Not StringInStr("|1|5|10|15|30|60|", "|" & $iFreq & "|") Then GUICtrlSetState($hgX, $GUI_CHECKED) GUICtrlSetState($hgX, $GUI_ENABLE) GUICtrlSetState($hgXt, $GUI_ENABLE) GUICtrlSetData($hgXt, $iFreq) Else GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) EndIf $Label3 = GUICtrlCreateLabel($sgClock & ":", 180, 16, 79, 24) $hgK = GUICtrlCreateCheckbox($sg12hr_label, 182, 48, 97, 17) If $vT12or24 = 12 Then GUICtrlSetState($hgK, $GUI_CHECKED) Else GUICtrlSetState($hgK, $GUI_UNCHECKED) $bSayAMPM = 0 EndIf $hgL = GUICtrlCreateCheckbox($sg24hr_label, 182, 72, 97, 17) If $vT12or24 = 24 Then GUICtrlSetState($hgL, $GUI_CHECKED) $bSayAMPM = 0 Else GUICtrlSetState($hgL, $GUI_UNCHECKED) EndIf $Label4 = GUICtrlCreateLabel($sgQuiet_label, 182, 130) $hgSpeak = GUICtrlCreateCheckbox($sgSpeak_label, 265, 130, 205, 17) GUICtrlSetState($hgSpeak, $GUI_ENABLE) $hgDisplay = GUICtrlCreateCheckbox($sgDisplay_label, 265, 155, 205, 17) GUICtrlSetState($hgDisplay, $GUI_ENABLE) If $bQuiet = 0 Then GUICtrlSetState($hgSpeak, $GUI_CHECKED) GUICtrlSetState($hgDisplay, $GUI_UNCHECKED) Else GUICtrlSetState($hgSpeak, $GUI_UNCHECKED) GUICtrlSetState($hgDisplay, $GUI_CHECKED) EndIf ; Clock stops $Label5 = GUICtrlCreateLabel($sgExpires & ":", 390, 16, 90, 24) $hgExpNever = GUICtrlCreateCheckbox($sgExpNever, 392, 48, 97, 17) If $iStop = 0 Then GUICtrlSetState($hgExpNever, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpNever, $GUI_UNCHECKED + $GUI_ENABLE) EndIf $hgExp = GUICtrlCreateCheckbox($sgExpAfter, 398, 72, 65, 17) If $iStop > 0 Then GUICtrlSetState($hgExp, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExp, $GUI_UNCHECKED + $GUI_ENABLE) EndIf $hgExpAft = GUICtrlCreateInput("", 456, 64, 41, 28) If $iStop > 0 Then GUICtrlSetState($hgExpAft, $GUI_ENABLE) GUICtrlSetData($hgExpAft, $iStop) Else GUICtrlSetState($hgExpAft, $GUI_DISABLE) EndIf $hgExpUsecs = GUICtrlCreateRadio($sgExpSecs, 414, 96, 113, 17) If $iStop > 0 And $sUnits = "S" Then GUICtrlSetState($hgExpUsecs, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUsecs, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $hgExpUmins = GUICtrlCreateRadio($sgExpMins, 414, 120, 113, 17) If $iStop > 0 And $sUnits = "M" Then GUICtrlSetState($hgExpUmins, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUmins, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $hgExpUhours = GUICtrlCreateRadio($sgExpHours, 414, 144, 113, 17) If $iStop > 0 And $sUnits = "H" Then GUICtrlSetState($hgExpUhours, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUhours, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $hgExpUdays = GUICtrlCreateRadio($sgExpDays, 414, 168, 113, 17) If $iStop > 0 And $sUnits = "D" Then GUICtrlSetState($hgExpUdays, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUdays, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $hgExpUweeks = GUICtrlCreateRadio($sgExpWeeks, 414, 192, 113, 17) If $iStop > 0 And $sUnits = "W" Then GUICtrlSetState($hgExpUweeks, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUweeks, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $hgExpUmons = GUICtrlCreateRadio($sgExpMons, 414, 216, 113, 17) If $iStop > 0 And $sUnits = "T" Then GUICtrlSetState($hgExpUmons, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUmons, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $hgExpUyears = GUICtrlCreateRadio($sgExpYears, 414, 240, 113, 17) If $iStop > 0 And $sUnits = "Y" Then GUICtrlSetState($hgExpUyears, $GUI_CHECKED + $GUI_ENABLE) Else GUICtrlSetState($hgExpUyears, $GUI_UNCHECKED + $GUI_DISABLE) EndIf $iX = 8 GUICtrlCreateLabel($sgVolume_label, 8, 230+12) Local $hgV = GUICtrlCreateSlider(8, 255+12, 360) GUICtrlSetLimit($hgV, 100, 1) GUICtrlSetData($hgV, $iVol) GUICtrlSetState($hgV, $GUI_SHOW) GUICtrlCreateLabel("0", $iX, 280, 360) GUICtrlCreateLabel("20", $iX + 1*71, 280, 360) GUICtrlCreateLabel("40", $iX + 2*70, 280, 360) GUICtrlCreateLabel("60", $iX + 1 + 3*70, 280, 360) GUICtrlCreateLabel("80", $iX - 2 + 4*69, 280, 360) GUICtrlCreateLabel("100", $iX - 2 + 5*69, 280, 360) GUICtrlCreateGroup("", -99, -99, 1, 1) $hgStart = GUICtrlCreateButton($sgStart_button, 534, 22, 92, 30, $BS_DEFPUSHBUTTON) GUICtrlSetState($hgStart, $GUI_FOCUS) $hgCancel = GUICtrlCreateButton($sgCancel_button, 534, 62, 92, 31) GUISetState(@SW_SHOW) ; #EndRegion ### END Koda GUI section ### If $bQuiet = 0 Then _SayTxt($sHi) WHILE 1 Switch GUIGetMsg() Case $hgA $iFreq = 1 GUICtrlSetState($hgA, $GUI_CHECKED) GUICtrlSetState($hgB, $GUI_UNCHECKED) GUICtrlSetState($hgC, $GUI_UNCHECKED) GUICtrlSetState($hgD, $GUI_UNCHECKED) GUICtrlSetState($hgE, $GUI_UNCHECKED) GUICtrlSetState($hgF, $GUI_UNCHECKED) GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) Case $hgB $iFreq = 5 GUICtrlSetState($hgA, $GUI_UNCHECKED) GUICtrlSetState($hgB, $GUI_CHECKED) GUICtrlSetState($hgC, $GUI_UNCHECKED) GUICtrlSetState($hgD, $GUI_UNCHECKED) GUICtrlSetState($hgE, $GUI_UNCHECKED) GUICtrlSetState($hgF, $GUI_UNCHECKED) GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) Case $hgC $iFreq = 10 GUICtrlSetState($hgA, $GUI_UNCHECKED) GUICtrlSetState($hgB, $GUI_UNCHECKED) GUICtrlSetState($hgC, $GUI_CHECKED) GUICtrlSetState($hgD, $GUI_UNCHECKED) GUICtrlSetState($hgE, $GUI_UNCHECKED) GUICtrlSetState($hgF, $GUI_UNCHECKED) GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) Case $hgD $iFreq = 15 GUICtrlSetState($hgA, $GUI_UNCHECKED) GUICtrlSetState($hgB, $GUI_UNCHECKED) GUICtrlSetState($hgC, $GUI_UNCHECKED) GUICtrlSetState($hgD, $GUI_CHECKED) GUICtrlSetState($hgE, $GUI_UNCHECKED) GUICtrlSetState($hgF, $GUI_UNCHECKED) GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) Case $hgE $iFreq = 30 GUICtrlSetState($hgA, $GUI_UNCHECKED) GUICtrlSetState($hgB, $GUI_UNCHECKED) GUICtrlSetState($hgC, $GUI_UNCHECKED) GUICtrlSetState($hgD, $GUI_UNCHECKED) GUICtrlSetState($hgE, $GUI_CHECKED) GUICtrlSetState($hgF, $GUI_UNCHECKED) GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) Case $hgF $iFreq = 60 GUICtrlSetState($hgA, $GUI_UNCHECKED) GUICtrlSetState($hgB, $GUI_UNCHECKED) GUICtrlSetState($hgC, $GUI_UNCHECKED) GUICtrlSetState($hgD, $GUI_UNCHECKED) GUICtrlSetState($hgE, $GUI_UNCHECKED) GUICtrlSetState($hgF, $GUI_CHECKED) GUICtrlSetState($hgX, $GUI_UNCHECKED) GUICtrlSetState($hgXt, $GUI_DISABLE) Case $hgX $bCanned = 0 GUICtrlSetState($hgA, $GUI_UNCHECKED) GUICtrlSetState($hgB, $GUI_UNCHECKED) GUICtrlSetState($hgC, $GUI_UNCHECKED) GUICtrlSetState($hgD, $GUI_UNCHECKED) GUICtrlSetState($hgE, $GUI_UNCHECKED) GUICtrlSetState($hgF, $GUI_UNCHECKED) GUICtrlSetState($hgX, $GUI_CHECKED) GUICtrlSetState($hgXt, $GUI_ENABLE) Case $hgXt $bCanned = 0 $iFreq = GUICtrlRead($hgXt) Case $hgK $vT12or24 = 12 $bSayAMPM = 0 GUICtrlSetState($hgK, $GUI_CHECKED) GUICtrlSetState($hgL, $GUI_UNCHECKED) Case $hgL $vT12or24 = 24 $bSayAMPM = 0 GUICtrlSetState($hgK, $GUI_UNCHECKED) GUICtrlSetState($hgL, $GUI_CHECKED) Case $hgDisplay $bQuiet = 1 GUICtrlSetState($hgSpeak, $GUI_UNCHECKED) GUICtrlSetState($hgDisplay, $GUI_CHECKED) Case $hgSpeak $bQuiet = 0 GUICtrlSetState($hgSpeak, $GUI_CHECKED) GUICtrlSetState($hgDisplay, $GUI_UNCHECKED) Case $hgV $iVol = GUICtrlRead($hgV) GUICtrlSetState($hgV, $GUI_ENABLE) $aCartesian = MouseGetPos() ToolTip($iVol, $aCartesian[0], $aCartesian[1], "", 0, 2) Sleep(500) ToolTip("") GUICtrlSetState($hgV, $GUI_CHECKED) Case $hgExp GUICtrlSetState($hgExp, $GUI_CHECKED) GUICtrlSetState($hgExpNever, $GUI_UNCHECKED) GUICtrlSetState($hgExpAft, $GUI_ENABLE) GUICtrlSetState($hgExpUsecs, $GUI_UNCHECKED + $GUI_ENABLE) GUICtrlSetState($hgExpUmins, $GUI_UNCHECKED + $GUI_ENABLE) GUICtrlSetState($hgExpUhours, $GUI_CHECKED + $GUI_ENABLE) GUICtrlSetState($hgExpUdays, $GUI_UNCHECKED + $GUI_ENABLE) GUICtrlSetState($hgExpUweeks, $GUI_UNCHECKED + $GUI_ENABLE) GUICtrlSetState($hgExpUmons, $GUI_UNCHECKED + $GUI_ENABLE) GUICtrlSetState($hgExpUyears, $GUI_UNCHECKED + $GUI_ENABLE) Case $hgExpAft $iStop = GUICtrlRead($hgExpAft) If Not StringIsDigit($iStop) Then $iStop = 0 Case $hgExpUsecs $sUnits = "S" Case $hgExpUmins $sUnits = "M" Case $hgExpUhours $sUnits = "H" Case $hgExpUdays $sUnits = "D" Case $hgExpUweeks $sUnits = "W" Case $hgExpUmons $sUnits = "T" Case $hgExpUyears $sUnits = "Y" Case $hgExpNever $iStop = 0 GUICtrlSetState($hgExpNever, $GUI_CHECKED) GUICtrlSetState($hgExp, $GUI_UNCHECKED) GUICtrlSetState($hgExpAft, $GUI_DISABLE) GUICtrlSetState($hgExpUsecs, $GUI_UNCHECKED + $GUI_DISABLE) GUICtrlSetState($hgExpUmins, $GUI_UNCHECKED + $GUI_DISABLE) GUICtrlSetState($hgExpUhours, $GUI_CHECKED + $GUI_DISABLE) GUICtrlSetState($hgExpUdays, $GUI_UNCHECKED + $GUI_DISABLE) GUICtrlSetState($hgExpUweeks, $GUI_UNCHECKED + $GUI_DISABLE) GUICtrlSetState($hgExpUmons, $GUI_UNCHECKED + $GUI_DISABLE) GUICtrlSetState($hgExpUyears, $GUI_UNCHECKED + $GUI_DISABLE) Case $hgStart GUISetState(@SW_HIDE, $hgTT) MAIN() Case $hgCancel ContinueCase Case $GUI_EVENT_CLOSE ; _SayTxt($sBye) If Not $sFini2 Then WriteTTini() Exit EndSwitch WEND ; Function definitions Func _Single() ; Returns 0 if Not Single(ton) Else 1 $iPID = @AutoItPID $bSolo = 1 $aTPIDs = ProcessList(@ScriptName) For $a = 1 To $aTPIDs[0][0] If $aTPIDs[$a][1] = $iPID Then ContinueLoop Else $bSolo = 0 ExitLoop EndIf Next Return $bSolo EndFunc ;==>_Single ; -------------------- Func MAIN() ; TalkTock If $sFini2 = "" And $CmdLine[0] > 0 Then ; ---------------------------------------- If StringInStr($CmdLine[1], "/L") Then Exit MsgBox($MB_OK, @ScriptName, _ListVoices()) If StringInStr($CmdLine[1], "/source") Then Exit _ShowSource("txt") If StringInStr($CmdLine[1], "/?") = 1 Or StringInStr($CmdLine[1], "-?") = 1 Or StringInStr($CmdLine[1], "/h") = 1 Or StringInStr($CmdLine[1], "-h") = 1 Then Exit _ShowHelp() If StringInStr($CmdLine[1], "sayhelp") Then Exit _SayHelp() If StringInStr($CmdLine[1], "kill") Then $aP = ProcessList(@ScriptName) $iP = $aP[0][0] - 1 If Not @error Or $iP > 1 Then $sT = "Killing " & $iP & @ScriptName _Splash($sT & " process(es)") Sleep(1000) SplashOff() While ProcessClose(@ScriptName) Sleep(100) WEnd Exit Else _ExitErr("No running " & @ScriptName & " processes") EndIf EndIf If StringInStr($sCMline, "/i") Then $iFreq = _GetArgValue("/i") If StringInStr($sCMline, "-i") Then $iFreq = _GetArgValue("-i") If StringInStr($sCMline, "/c") Then $vT12or24 = _GetArgValue("/c") If StringInStr($sCMline, "-c") Then $vT12or24 = _GetArgValue("-c") If StringInStr($sCMline, "/v") Then $iVol = _GetArgValue("/v") If StringInStr($sCMline, "-v") Then $iVol = _GetArgValue("-v") If StringInStr($sCMline, "/q") Or StringInStr($sCMline, "-q") Then $bQuiet = 1 If StringInStr($sCMline, "/qq") Or StringInStr($sCMline, "-qq") Then $bQuiet = 0 If StringInStr($sCMline, "/t") Or StringInStr($sCMline, "-t") Then $bTimeOnly = 1 $bSayAMPM = 0 EndIf If StringInStr($sCMline, "/r") Then $iRate = _GetArgValue("/r") If StringInStr($sCMline, "-r") Then $iRate = _GetArgValue("-r") Local $sU = "H" If StringInStr($sCMline, "/u ") Then $sU = _GetArgValue("/u") If StringInStr($sCMline, "-u ") Then $sU = _GetArgValue("-u") If StringInStr($sU, "=") Then $aU = StringSplit($sU, "=") $sUnits = $aU[1] If $aU[0] > 1 Then $iStop = $aU[2] If Not $iStop Then $iStop = 0 Switch $sU Case "S" $sUnits = "seconds" Case "M" $sUnits = "minutes" Case "H" $sUnits = "hours" Case "D" $sUnits = "days" Case "W" $sUnits = "weeks" Case "T" $sUnits = "months" Case "Y" $sUnits = "years" EndSwitch EndIf If StringInStr($sCMline, "/usefile") Then $sFini = _GetArgValue("/usefile") If StringInStr($sCMline, "-usefile") Then $isFini = _GetArgValue("-usefile") EndIf ; -------------------- If $bTimeOnly = 1 Then $sHi = "" $sIntro = "" $sHowFreq1 = "" $sHowFreq5 = "" $sHowFreq10 = "" $sHowFreq15 = "" $sHowFreq30 = "" $sHowFreq60 = "" $sHowFreqCustom = "" $sPrefix = "" $sPrefix1 = "" $sPause = "" $sResume = "" $sStopSay = "" $sBye = "" EndIf #cs; debug Exit MsgBox(0,"", _ "$bTimeOnly = " & $bTimeOnly & @CRLF & _ "$iFreq = " & $iFreq & @CRLF & _ "$vT12or24 = " & $vT12or24 & @CRLF & _ "$sVoice = " & $sVoice & @CRLF & _ "$iVol = " & $iVol & @CRLF & _ "$iRate = " & $iRate & @CRLF & _ "$iStop = " & $iStop & @CRLF & _ "$sUnits = " & $sUnits & @CRLF & _ "$bQuiet = " & $bQuiet & @CRLF & _ "$iDisplay = " & $iDisplay & @CRLF) #ce; debug ; Failsafe defaults If Not StringIsDigit(String($iFreq)) Then $iFreq = 15 If Not $vT12or24 = "24" Then $vT12or24 = 12 If Not StringIsDigit(String($iVol)) Then $iVol = 80 If $iVol > 100 Then $iVol = 100 If String(Abs($iRate)) <> String($iRate) Then $iRate = 0 If $iRate < -10 Or $iRate > 10 Then $iRate = 0 If Not StringIsDigit(String($iStop)) Then $iStop = 0 If Not StringInStr("|S|M|H|D|W|T|Y|", ("|" & $sUnits & "|")) Then $sUnits = "H" Local $sAllFreqs = "|1|5|10|15|30|60|", $sHowFreq = "" If StringInStr($sAllFreqs, "|" & $iFreq & "|") < 1 Then $bCanned = 0 If Not $bCanned Then If StringIsDigit(String($iFreq)) Then $iFreq = Int($iFreq) If $iFreq < 1 Then Exit _ShowHelp() Else EndIf EndIf If $bCanned Then Switch $iFreq Case 1 $sHowFreq = $sHowFreq1 Case 5 $sHowFreq = $sHowFreq5 Case 10 $sHowFreq = $sHowFreq10 Case 15 $sHowFreq = $sHowFreq15 Case 30 $sHowFreq = $sHowFreq30 Case 60 $sHowFreq = $sHowFreq60 EndSwitch Else $sHowFreq = $iFreq & $sHowFreqCustom EndIf If Not $sFini2 Then WriteTTini() If $bQuiet = 0 Then _SayTxt($sIntro & " " & $sHowFreq) Else $sHowFreq = StringReplace($sHowFreq, "minnit", " minute") $sHowFreq = StringReplace($sHowFreq, "'", "h") If StringLen($sHowFreq) > 10 Then $sHowFreq = @CRLF & $sHowFreq If $sHowFreq Then _Splash($sIntro & $sHowFreq) Sleep(2000) SplashOff() EndIf If $iStop > 0 Then $sDate1 = @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC $sTimerFn = _TmpFile(@TempDir, "au3", 8, "TkTk") $iS = _SetTimer($iStop, $sUnits) $iBabyPID = _StartTimer($iS) EndIf If $bCanned Then While 1 Do Sleep(200) Until @SEC = 00 And Mod(@MIN, $iFreq) = 0 _SayTime($vT12or24) _CheckTimer() Sleep(45000) WEnd Else ; Custom interval Do Sleep(100) Until @SEC = 00 While 1 $iMin = @MIN _SayTime($vT12or24) _CheckTimer() If $iFreq = 60 Then Sleep(60500) $iNext = Mod($iMin + $iFreq, 60) Do Sleep(100) Until @MIN = $iNext WEnd EndIf EndFunc ;==>MAIN ; --------------- Func _GetArgValue($sArg) ; Get value (if any) following /SWitch (arg) $sVal = "" If $CmdLine[0] > 1 Then For $i = 1 To $CmdLine[0] If $sArg = $CmdLine[$i] Then If $CmdLine[0] > $i Then $sVal = StringStripWS($CmdLine[$i + 1], 1) If StringInStr($sVal, "/") = 1 Or StringInStr($sVal, "-") = 1 Then If StringInStr($sArg, "r") = 2 And StringInStr($sVal, "-") And StringIsDigit(StringTrimLeft($sVal, 1)) Then Return $sVal Else Return "" EndIf EndIf EndIf EndIf Next EndIf Return $sVal EndFunc ;==>_GetArgValue Func _SetTimer($iN, $sUnits = "H") If StringLen($sUnits) > 1 Then $sUnits = StringLeft($sUnits, 3) If $sUnits = "mon" Then $sUnits = "T" $sUnits = StringUpper(StringLeft($sUnits, 1)) EndIf Switch $sUnits Case "S" $iM = 1 Case "M" $iM = 60 Case "H" $iM = 3600 Case "D" $iM = 86400 Case "W" $iM = 604800 Case "T" $iM = 2592000 Case "Y" $iM = 31536000 Case Else $iM = 0 EndSwitch $iN *= $iM Return $iN EndFunc ;==>_SetTimer Func _StartTimer($iSecs) $sFn = $sTimerFn $sFc = "Opt(""TrayIconHide"", 1)" & @CRLF & "$iS = " & $iSecs & @CRLF & "Do" & @CRLF & "Do" & @CRLF & "$iSec = @SEC" & @CRLF & "Sleep(100)" & @CRLF & "Until @SEC <> $iSec " & @CRLF & "$iS -= 1" & @CRLF & "Until $iS < 1" & @CRLF & "Exit" & @CRLF $hT = FileOpen($sFn, 2) If $hT > -1 Then FileWrite($hT, $sFc) FileClose($hT) Else _ExitErr("Error writing temp file") EndIf $iPID = Run(@ScriptFullPath & " /AutoIt3ExecuteScript " & $sFn, @TempDir, @SW_HIDE) Sleep(200) Return $iPID EndFunc ;==>_StartTimer Func _CheckTimer() If $iStop > 0 Then If Not ProcessExists($iBabyPID) Then FileDelete($sTimerFn) $sDate2 = @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC Local $sDDType = "", $sDDUnits = "" Switch $sUnits Case "S" $sDDType = "s" $sDDUnits = "seconds" Case "M" $sDDType = "n" $sDDUnits = "minutes" Case "H" $sDDType = "h" $sDDUnits = "hour(s)" Case Else $sDDType = "D" $sDDUnits = "day(s)" EndSwitch $vETime = _DateDiff($sDDType, $sDate1, $sDate2) If @error Then $vETime = "[??]" Exit MsgBox($MB_OK, @ScriptName, @ScriptName & " stopped as requested at " & $sDate2 & @CRLF & "Elapsed time: " & $vETime & " " & $sDDUnits, 60) EndIf EndIf Return EndFunc ;==>_CheckTimer Func _ExitErr($sMg, $iSecs = 0) Exit MsgBox($MB_OK + $MB_ICONERROR, @ScriptName, $sMg, $iSecs) EndFunc ;==>_ExitErr Func _IniFileRead($sVarName, $sSection, $sKey, $sDefault) #cs; ----------------------------------------------- IniRead with default text encoding @error codes: 1 = Variable $sVarName Not Declared 2 = Error reading contents of $sVarName 3 = Section not found 4 = Key not found 5 = Key not found in section #ce; ----------------------------------------------- If Not IsDeclared($sVarName) Then If $sDefault Then Return $sDefault Else Return SetError(1, "Variable " & $sVarName & " is not declared", "") EndIf EndIf $sFc = Eval($sVarName) If Not $sFc Then If $sDefault Then Return $sDefault Else Return SetError(2, "Error reading INI file contents", "") EndIf EndIf $sCrLf = @LF $sFc = StringReplace($sFc, @CRLF, $sCrLf) $iXsec = StringInStr(StringUpper($sFc), $sCrLf & "[" & StringUpper($sSection) & "]") If $iXsec < 1 Then If $sDefault Then Return $sDefault Else Return SetError(3, "Section not found", "") EndIf EndIf $iXsec += StringLen($sCrLf & "[" & StringUpper($sSection) & "]") $sSecC = $sCrLf & StringTrimLeft($sFc, $iXsec) If StringInStr($sSecC, $sCrLf & "[") And StringInStr($sSecC, "]" & $sCrLf) > StringInStr($sSecC, $sCrLf & "[") Then _ $sSecC = StringTrimRight($sSecC, StringLen($sSecC) - StringInStr($sSecC, $sCrLf & "[")) If Not StringInStr(StringUpper($sSecC), StringUpper($sKey) & "=") Then If $sDefault Then Return $sDefault Else Return SetError(4, "Key not found", "") EndIf EndIf $sVal0 = StringTrimLeft($sSecC, StringInStr($sSecC, $sCrLf & $sKey & "=")) $sVal0 = StringTrimRight($sVal0, 1 + StringLen($sVal0) - StringInStr($sVal0, String($sCrLf))) $sValue = StringTrimLeft($sVal0, StringInStr($sVal0, "=")) If Not $sValue Then $sValue = $sDefault Return SetError(0, 0, $sValue) EndFunc ;==>_IniFileRead Func _IniFileReadFile($sFn) #cs; ------------------------------------------------ Read INI file contents into a (string) variable @error codes: 1 = $sVarName Is Not Declared 2 = Error reading $sVarName 3 = Section does not exit 4 = Key does not exit #ce; ------------------------------------------------ If Not FileExists($sFn) Then Return SetError(1, 0, "") $h = FileOpen($sFn) If $h = -1 Then Return SetError(2, 0, "") $sFc = FileRead($h) If Not FileClose($h) Then Return SetError(3, 0, "") If StringRight($sFc, 1) = Chr(26) Then $sFc = StringTrimRight($sFc, 1) Return @CRLF & $sFc EndFunc ;==>_IniFileReadFile Func _ListVoices() $oVox = ObjCreate("SAPI.spVoice") If @error Then Exit _ExitErr("Error creating SAPI object", 10) $oVoices = $oVox.GetVoices() $sVlist = "" For $vName in $oVoices $sVlist &= $vName.GetDescription() & @CRLF Next Return $sVlist EndFunc ;==>_ListVoices Func _PauseVoice($iBeats = 1) If StringIsDigit(String($iBeats)) Then $iBeats = Int($iBeats) Sleep($iBeats * 100) EndIf Return EndFunc ;==>_PauseVoice Func _SayHelp() _SayTxt("Welcome to TalkTock, The Talking Clock.") _PauseVoice(1) _SayTxt("To get started, command START, space, forward slash, M,I,N, space, TalkTock, Enter. Choose your settings, and click Start.") _PauseVoice(1) _SayTxt("For command-line help, command TalkTock, space, forward slash, question mark, and hit Enter.") _PauseVoice(1) _SayTxt("To view and customize all available TalkTock settings, open TalkTock dot I,N,I, in any text editor.") _PauseVoice(1) _SayTxt("I hope you enjoy TalkTock!") Return EndFunc ;==>_SayHelp Func _SayTime($vTime12or24 = 12) $h = Int(@HOUR) $m = @MIN $sAMPM = "" $sPrefix = $sPrefix $sPostfix = PostfixPairsSet() If $vTime12or24 = "12" Then If $bSayAMPM Then $sAMPM = "AM" If $h > 11 Then $sAMPM = "PM" EndIf If $h > 11 Then $h = Mod($h, 12) If $h = 0 Then $h = 12 EndIf If $sPrefix1 And Int($h) = 1 Then $sPrefix = $sPrefix1 If Not $sPostfix Then $sPostfix = $sAMPM $sTime = $sPrefix & " " & $h & ":" & @MIN & " " & $sPostfix If $bQuiet > 0 Then _Splash($sTime) If $iDisplay < 1 Then $iDisplay = 1 Sleep(Int(1000 * $iDisplay)) SplashOff() Else _SayTxt($sTime) EndIf Return EndFunc ;==>_SayTime Func _SayTxt($sIn) ; Text-to-Speech $iRC = -1 If $sIn Then $oVox.Speak($sIn) $iRC = StringLen($sIn) EndIf Return $iRC EndFunc ;==>_SayTxt Func _ShowHelp() MsgBox($MB_OK, @ScriptName & " - Talking Clock", $sHelp) EndFunc ;==>_ShowHelp Func _ShowSource($postfx) ; Show source code If Not $postfx Then $Ext = "txt" Else $Ext = $postfx EndIf $TmpFile = @TempDir & "\ausource." & $Ext If FileExists($TmpFile) Then If FileGetAttrib($TmpFile) = "R" Then FileSetAttrib($TmpFile, "-R") EndIf Select Case $Ext = "txt" FileInstall("X:\ausource.txt", $TmpFile, 1) Case $Ext = "pdf" ;FileInstall("X:\ausource.pdf", $TmpFile, 1) EndSelect Sleep(50) ShellExecute($TmpFile, "", @TempDir, "open") EndFunc ;==>_ShowSource Func _Splash($sTxt) SplashTextOn(@ScriptName, $sTxt, 650, 150, -1, -1, 32, "", 14, 600) Return EndFunc ;==>_Splash Func _TmpFile($sDir = @TempDir, $sExt = "tmp", $iLen = 8, $sPre = "") ; Generate a non-existent 8.3 filename ; Returns null string on failure $aA = StringSplit("ABCDEFGHIJKLMNPQRSTUVWXYZ123456789", "") $sX = "nul" $itr = 0 If $sPre Then $iLen -= StringLen($sPre) While FileExists($sX) $itr += 1 $sX = $sPre For $i = 1 To $iLen $sX &= $aA[Random(1, $aA[0])] Next $sX = $sDir & "\" & $sX & "." & $sExt If $itr > 50 Then $sX = "" ExitLoop EndIf WEnd Return $sX EndFunc ;==>_TmpFile Func _TrayPause() If TrayItemGetText($hTrayPA) = $sgPause Then TrayItemSetText($hTrayPA, $sgResume) If $bQuiet = 0 Then _SayTxt($sPause) Else _Splash($sPause) Sleep(1500) SplashOff() EndIf Else TrayItemSetText($hTrayPA, $sgPause) If $bQuiet = 0 Then _SayTxt($sResume) Else _Splash($sResume) Sleep(1500) SplashOff() EndIf Return EndIf Do Sleep(200) Until TrayItemGetState($hTrayPA) Or TrayItemGetState($hTrayEX) EndFunc ;==>_TrayPause Func _TrayExit() If Not $sFini2 Then WriteTTini() If $bQuiet = 0 Then _SayTxt($sBye) Else _Splash($sBye) Sleep(1000) SplashOff() EndIf If $iBabyPID > -1 Then ProcessClose($iBabyPID) Sleep(500) EndIf Exit EndFunc ;==>_TrayExit Func PostfixPairsRead() Local $aFParts[1000][2] $aFParts[0][0] = 0 $sValPt = "" $sValSp = "" For $n = 1 To 999 $sValPt = _IniFileRead("sFiniV", "Language", "Range" & $n, "") If $sValPt Then $sValSp = _IniFileRead("sFiniV", "Language", "Phrase" & $n, "") $aFParts[$n][0] = $sValPt $aFParts[$n][1] = $sValSp Else $aFParts[0][0] = $n - 1 ExitLoop EndIf Next Return $aFParts EndFunc ;==>PostfixPairsRead Func PostfixPairsSet() $vTime = String(@HOUR & @MIN) $sPostfix = "" If $aParts[0][0] > 0 Then For $z = 1 To $aParts[0][0] $aPtt = StringSplit($aParts[$z][0], "-") If $vTime >= $aPtt[1] And $vTime <= $aPtt[2] Then ExitLoop Next $sPostfix = $aParts[$z][1] EndIf Return $sPostfix EndFunc ;==>PostfixPairsSet Func WriteTTini() IniWrite($sFini, "TalkTock", "Interval", $iFreq) IniWrite($sFini, "TalkTock", "ClockStyle", $vT12or24) IniWrite($sFini, "TalkTock", "SayAMPM", $bSayAMPM) If $sVoice = "" Then $sVoice = "default" IniWrite($sFini, "TalkTock", "Voice", $sVoice) IniWrite($sFini, "TalkTock", "Volume", $iVol) IniWrite($sFini, "TalkTock", "TalkRate", $iRate) IniWrite($sFini, "TalkTock", "ClockStops", $iStop) IniWrite($sFini, "TalkTock", "ClockTimerUnits", $sUnits) IniWrite($sFini, "TalkTock", "Quiet", $bQuiet) IniWrite($sFini, "TalkTock", "Display", $iDisplay) EndFunc ;==>WriteTTini Func RestartTT() $hgRE = GUICreate(@ScriptName, 350, 150, -1, -1, $ES_CENTER) GUISetState(@SW_HIDE, $hgRE) GUICtrlCreateLabel(@ScriptName & " is running. What would you like to do?", 18, 22, 337, 24) $hgREStart = GUICtrlCreateButton("Restart", 20, 55, 70, -1, $BS_DEFPUSHBUTTON) $hgREQuit = GUICtrlCreateButton("Quit", 105, 55, 70, -1, -1) $hgRECancel = GUICtrlCreateButton("Cancel", 190, 55, 70, -1, -1) ;---------- $aTTp = ProcessList(@ScriptName) $iThis = @AutoItPID GUISetState(@SW_SHOW, $hgRE) While 1 Switch GUIGetMsg($hgRE) Case $hgREStart For $q = 1 To $aTTp[0][0] If $aTTp[$q][1] <> $iThis Then ProcessClose($aTTp[$q][1]) Next GUIDelete($hgRE) ExitLoop Case $hgREQuit For $q = 1 To $aTTp[0][0] If $aTTp[$q][1] <> $iThis Then ProcessClose($aTTp[$q][1]) Next ContinueCase Case $hgRECancel ContinueCase Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;---------- EndFunc ;==>ReStartTT Settings file (TalkTock.ini):
      Settings file for TalkTock.exe, Talking Clock ; [TalkTock] ;; Interval between time announcements, in minutes Interval=15 ;; 12- or 24-hour clock ClockStyle=12 ;; Say AM/PM? 1=Yes 0=No; applies to 12-hour clock only SayAMPM=1 ;; TTS voice Voice=default ;Voice=Microsoft George ;; Volume, range 1 to 100 Volume=80 ;; Speaking rate, range -10 to 10 TalkRate=0 ;; Clock stop timer units ;; S=secs M=mins H=hours D=days W=weeks T=months Y=years ClockTimerUnits=H ;; Clock stops after how many timer units? (0 = clock never stops) ClockStops=0 ;; Quiet operation, time shown on screen (1=yes 0=no) Quiet=0 ;; Duration, in seconds, of on-screen time display ;; Fractional (decimal) values are allowed (e.g., Display=3.5) Display=2.5 [Language] ;; Translate the phrases and labels below into your chosen language. ;; Any language with a TTS function (a "Voice") in its language pack ;; should work. To use other languages, edit TalkTock.ini using the ;; UTF-8 character set ; ;; TimeOnly: 1=Yes (phrases set below will NOT be spoken); 0=No TimeOnly=0 ; onStart=Welcome to TalkTock, the Talking Clock Intro=The time will be announced every Freq1=minnit Freq5=5 minutes at the 5-minute mark Freq10=10 minutes at the 10-minute mark Freq15=15 minutes on the quarter hour Freq30=30 minutes on the half hour Freq60='our on the hour FreqCustom=minutes ;; Spoken prefix Prefix=It's ;; No prefix (just announce the time): ;Prefix= ;Prefix=It's ;Prefix=It's now ;Prefix=The time is ;; Singular prefix: Prefix1 defines the singular inflection ;; for "one o'clock" in applicable languages, e.g., Italian ;Prefix1= ; ;; Postfix pairs (optional) ;; ------------------------ ;; Alternatives to saying "AM/PM" (or equivalent) after the time ;; If time falls within Range, TalkTock says ;; Phrase after saying the time ;; You can set as many, or as few, of these pairs as you like ;; Note: Range# settings must have content (a time range hhmm-hhmm) ;; Phrase# settings can be a phrase or empty (say nothing) ;Range1=0000-0000 ;Phrase1=Midnight ;Range2=0001-0329 ;Phrase2=A.M. ;Range3=0330-1159 ;Phrase3=in the morning ;Range4=1200-1200 ;Phrase4=Noon ;Range5=1201-1659 ;Phrase5=in the afternoon ;Range6=1700-1959 ;Phrase6=in the evening ;Range7=2000-2359 ;Phrase7=at night ;; ------------------------ ; ;; Pause/Resume/Stop onPause=TalkTock paused onResume=TalkTock resumed onStop=Goodbye [GUI_Labels] Title=TalkTock - Talking Clock Top=Say the time every Minute=minute Minutes=minutes QuarterHour=quarter hour HalfHour=half hour Hour=hour Hours=hours CustomLabel=Custom ClockStyle=Clock style 12-hour_Label=12-hour 24-hour_Label=24-hour Quiet_label=Time is: Speak_label=spoken Display_label=displayed ClockStop_Label=Clock stops ClockStopsNever_Label= Never ClockStopsAfter_Label= After ClockStopsAfterSecs_Label=secs ClockStopsAfterMins_Label=mins ClockStopsAfterHours_Label=hours ClockStopsAfterDays_Label=days ClockStopsAfterWeeks_Label=weeks ClockStopsAfterMons_Label=months ClockStopsAfterYears_Label=years Volume_Label=Volume ClockStop_Label=Clock stops ClockStopsAfter_Label=After ClockStopsHours_Label=hours ClockStopsNever_Label=Never Start_button=Start Cancel_button=Cancel Tray_pause=Pause Tray_resume=Resume Tray_exit=Stop Enjoy!
    • By UEZ
      Here another example to mark the desktop to get the marked region for capturing. This example is not perfect and not very fast (room for improvements).
      ;Coded by UEZ build 2020-08-07 beta ;Code cleanup up mLipok ; ;Short instruction: mark area on your desktop and press return key to capture. #include <APISysConstants.au3> #include <Array.au3> ;#include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <ScreenCapture.au3> #include <WinAPIGdi.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> ; enum _PROCESS_DPI_AWARENESS -> https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx Global Enum $DPI_AWARENESS_INVALID = -1, $PROCESS_DPI_UNAWARE = 0, $PROCESS_SYSTEM_DPI_AWARE, $PROCESS_PER_MONITOR_DPI_AWARE ;https://docs.microsoft.com/en-us/windows/desktop/hidpi/dpi-awareness-context Global Enum $Context_UnawareGdiScaled = -5, $Context_PerMonitorAwareV2, $Context_PerMonitorAware, $Context_SystemAware, $Context_Unaware _WinAPI_SetProcessDpiAwarenessContext($Context_PerMonitorAware) Global $__g_hGUI_MarkArea, $__g_hGUI_Bg, $__g_iLabel_TL, $__g_iLabel_TM, $__g_iLabel_TR, $__g_iLabel_LM, $__g_iLabel_RM, $__g_iLabel_BL, $__g_iLabel_BM, _ $__g_iLabel_BR, $__g_iOldCursor, $__g_iW, $__g_iH, $__g_iColor_ResizeDots = 0xFFFFFF, $__g_iBorder = 4, $__g_bSelectionDone = False Global $aRect = _GDIPlus_MarkScreenRegionAnimated() Global $hImage_Capture = _ScreenCapture_Capture(@TempDir & "\Test.png", $aRect[0], $aRect[1], $aRect[0] + $aRect[2] - 1, $aRect[1] + $aRect[3] - 1, False) ShellExecute(@TempDir & "\Test.png") ;_ArrayDisplay($aRect, "Marked area coordinates") Func _GDIPlus_MarkScreenRegionAnimated($bAnim = True) _GDIPlus_Startup() Local Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hFullScreen) $__g_hGUI_Bg = GUICreate("", $aFullScreen[2], $aFullScreen[3], $aFullScreen[0], $aFullScreen[1], BitOR($WS_CLIPCHILDREN, $WS_POPUP), $WS_EX_TOPMOST) ;to avoid cursor flickering and for proper control read WinSetTrans($__g_hGUI_Bg, "", 0x01) $__g_hGUI_MarkArea = GUICreate("", 1, 1, -1, -1, $bAnim ? $WS_POPUP : BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED), $__g_hGUI_Bg) GUISetBkColor(0xABCDEF, $__g_hGUI_MarkArea) If Not $bAnim Then $__g_iColor_ResizeDots = 0xFF0000 $__g_iLabel_TL = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;top left GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_TM = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;top mid GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_TR = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;top right GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_LM = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;left mid GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_RM = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;right mid GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_BL = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;bottom left GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_BM = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;bottom mid GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) $__g_iLabel_BR = GUICtrlCreateLabel("", 0, 0, $__g_iBorder, $__g_iBorder) ;bottom right GUICtrlSetResizing(-1, $GUI_DOCKSIZE) GUICtrlSetBkColor(-1, $__g_iColor_ResizeDots) GUISetState(@SW_SHOWNA, $__g_hGUI_Bg) GUISetState(@SW_SHOW, $__g_hGUI_MarkArea) $__g_iOldCursor = MouseGetCursor() GUISetCursor(3, 1, $__g_hGUI_Bg) GUISetCursor(3, 1, $__g_hGUI_MarkArea) _WinAPI_SetLayeredWindowAttributes($__g_hGUI_MarkArea, 0xABCDEF, 0xF0) Local $aMPos, $aPrevMPos[2] = [MouseGetPos(0) + 1, MouseGetPos(1) + 1], $iID, $aCI, $iX, $iY, $aOldWinPos, $aOldMPos, $bMoved Local $aGUIStartPos, $iKey_Exit = GUICtrlCreateButton("", $aFullScreen[0] - 10, $aFullScreen[1] - 10, 1, 1), $aAccelKeys[1][2] = [["{ENTER}", $iKey_Exit]] GUISetAccelerators($aAccelKeys, $__g_hGUI_Bg) GUISetAccelerators($aAccelKeys, $__g_hGUI_MarkArea) #forceref $bMoved Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $iKey_Exit If $bAnim Then GUIRegisterMsg($WM_TIMER, "") DllCall("user32.dll", "bool", "KillTimer", "hwnd", $__g_hGUI_MarkArea, "uint_ptr", $iID) GUIRegisterMsg($WM_ERASEBKGND, "") EndIf _GDIPlus_Shutdown() Local $aResult = WinGetPos($__g_hGUI_MarkArea) $aResult[2] = WinGetClientSize($__g_hGUI_MarkArea)[0] $aResult[3] = WinGetClientSize($__g_hGUI_MarkArea)[1] GUIDelete($__g_hGUI_MarkArea) GUIDelete($__g_hGUI_Bg) If Not $__g_bSelectionDone Then $aResult = 0 Return $aResult EndSwitch $aMPos = MouseGetPos() If ($aMPos[0] <> $aPrevMPos[0] Or $aMPos[1] <> $aPrevMPos[1]) And (Not $__g_bSelectionDone) Then WinMove($__g_hGUI_MarkArea, "", $aMPos[0], $aMPos[1]) $aPrevMPos = $aMPos EndIf $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) If $aCI[2] And (Not $__g_bSelectionDone) Then $aGUIStartPos = WinGetPos($__g_hGUI_MarkArea) If $bAnim Then GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND") GUIRegisterMsg($WM_TIMER, "PlayBorderAnim") $iID = DllCall("User32.dll", "uint_ptr", "SetTimer", "hwnd", $__g_hGUI_MarkArea, "uint_ptr", 1, "uint", 50, "ptr", 0)[0] EndIf While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) $aMPos = MouseGetPos() $__g_iW = Abs($aMPos[0] - $aGUIStartPos[0]) + 1 $__g_iH = Abs($aMPos[1] - $aGUIStartPos[1]) + 1 If $aMPos[0] < $aGUIStartPos[0] Then $iX = $aMPos[0] Else $iX = $aGUIStartPos[0] EndIf If $aMPos[1] < $aGUIStartPos[1] Then $iY = $aMPos[1] Else $iY = $aGUIStartPos[1] EndIf WinMove($__g_hGUI_MarkArea, "", $iX, $iY, $__g_iW, $__g_iH) UpdateCtrlPos($bAnim) WEnd $__g_bSelectionDone = True GUISetCursor(3, 1, $__g_hGUI_MarkArea) ElseIf $aCI[3] And $__g_bSelectionDone Then $aGUIStartPos = WinGetPos($__g_hGUI_MarkArea) If _WinAPI_PtInRectEx(MouseGetPos(0), MouseGetPos(1), $aGUIStartPos[0], $aGUIStartPos[1], $aGUIStartPos[0] + $aGUIStartPos[2], $aGUIStartPos[1] + $aGUIStartPos[3]) Then $aMPos = MouseGetPos() $aGUIStartPos = WinGetPos($__g_hGUI_MarkArea) While $aCI[3] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", $aGUIStartPos[0] - ($aMPos[0] - MouseGetPos(0)), $aGUIStartPos[1] - ($aMPos[1] - MouseGetPos(1)), $__g_iW, $__g_iH) GUISetCursor(0, 1, $__g_hGUI_Bg) GUISetCursor(0, 1, $__g_hGUI_MarkArea) WEnd GUISetCursor(3, 1, $__g_hGUI_Bg) GUISetCursor(3, 1, $__g_hGUI_MarkArea) EndIf EndIf If $__g_bSelectionDone Then $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) If @error Then ContinueLoop Switch $aCI[4] Case $__g_iLabel_TL GUISetCursor(12, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", MouseGetPos(0), MouseGetPos(1), $aOldWinPos[2] + ($aOldMPos[0] - MouseGetPos(0)), $aOldWinPos[3] + ($aOldMPos[1] - MouseGetPos(1))) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_BR GUISetCursor(12, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", $aOldWinPos[0], $aOldWinPos[1], $aOldWinPos[2] - ($aOldMPos[0] - MouseGetPos(0)), $aOldWinPos[3] - ($aOldMPos[1] - MouseGetPos(1))) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_TR GUISetCursor(10, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", $aOldWinPos[0], MouseGetPos(1), $aOldWinPos[2] - ($aOldMPos[0] - MouseGetPos(0)), $aOldWinPos[3] + ($aOldMPos[1] - MouseGetPos(1))) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_BL GUISetCursor(10, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", MouseGetPos(0), $aOldWinPos[1], $aOldWinPos[2] + ($aOldMPos[0] - MouseGetPos(0)), $aOldWinPos[3] - ($aOldMPos[1] - MouseGetPos(1))) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_LM GUISetCursor(13, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", MouseGetPos(0), $aOldWinPos[1], $aOldWinPos[2] + ($aOldMPos[0] - MouseGetPos(0)), $aOldWinPos[3]) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_RM GUISetCursor(13, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", $aOldWinPos[0], $aOldWinPos[1], $aOldWinPos[2] - ($aOldMPos[0] - MouseGetPos(0)), $aOldWinPos[3]) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_TM GUISetCursor(11, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", $aOldWinPos[0], MouseGetPos(1), $aOldWinPos[2], $aOldWinPos[3] + ($aOldMPos[1] - MouseGetPos(1))) WEnd UpdateCtrlPos($bAnim) EndIf Case $__g_iLabel_BM GUISetCursor(11, 1, $__g_hGUI_MarkArea) If $aCI[2] Then $aOldWinPos = WinGetPos($__g_hGUI_MarkArea) $aOldMPos = MouseGetPos() While $aCI[2] * Sleep(10) $aCI = GUIGetCursorInfo($__g_hGUI_MarkArea) WinMove($__g_hGUI_MarkArea, "", $aOldWinPos[0], $aOldWinPos[1], $aOldWinPos[2], $aOldWinPos[3] - ($aOldMPos[1] - MouseGetPos(1))) WEnd UpdateCtrlPos($bAnim) EndIf Case Else GUISetCursor(3, 1, $__g_hGUI_MarkArea) EndSwitch EndIf Until False EndFunc ;==>_GDIPlus_MarkScreenRegionAnimated Func UpdateCtrlPos($bAnim = True) Local Const $aGUIStartPos = WinGetPos($__g_hGUI_MarkArea) If $__g_bSelectionDone And $bAnim Then GUIRegisterMsg($WM_TIMER, "") $__g_iW = $aGUIStartPos[2] $__g_iH = $aGUIStartPos[3] ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_TL, 0, 0, $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_TM, ($__g_iW - $__g_iBorder) / 2, 0, $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_TR, ($__g_iW - $__g_iBorder - $__g_iBorder / 2), 0, $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_LM, 0, ($__g_iH - $__g_iBorder) / 2, $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_RM, ($__g_iW - $__g_iBorder - $__g_iBorder / 2), ($__g_iH - $__g_iBorder) / 2, $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_BL, 0, ($__g_iH - $__g_iBorder - $__g_iBorder / 2), $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_BM, ($__g_iW - $__g_iBorder) / 2, ($__g_iH - $__g_iBorder - $__g_iBorder / 2), $__g_iBorder, $__g_iBorder) ControlMove($__g_hGUI_MarkArea, "", $__g_iLabel_BR, ($__g_iW - $__g_iBorder - $__g_iBorder / 2), ($__g_iH - $__g_iBorder - $__g_iBorder / 2), $__g_iBorder, $__g_iBorder) If $__g_bSelectionDone And $bAnim Then GUIRegisterMsg($WM_TIMER, "PlayBorderAnim") EndFunc ;==>UpdateCtrlPos Func PlayBorderAnim() Local $aWinPos = WinGetClientSize($__g_hGUI_MarkArea), $iW = $aWinPos[0], $iH = $aWinPos[1] Local Static $fOffset = 0 Local Const $iSize = $__g_iBorder / 2 Local Const $hDC = _WinAPI_GetDC($__g_hGUI_MarkArea) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) Local Const $hPen = _GDIPlus_PenCreate(0xFF0178D7, $iSize), $hPen2 = _GDIPlus_PenCreate(0xFFFFFFFF, $iSize), _ $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $__g_iColor_ResizeDots), $hPen3 = _GDIPlus_PenCreate(0xFF000000) _GDIPlus_PenSetDashStyle($hPen, $GDIP_DASHSTYLEDASHDOT) _GDIPlus_GraphicsClear($hCanvas, 0xFFABCDEF) ;for faster performance direct dll calls DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen2, "float", 1 + $iSize, "float", 1 + $iSize, "float", $iW - 2 * $iSize - 2, "float", $iH - 2 * $iSize - 2) DllCall($__g_hGDIPDll, "int", "GdipSetPenDashOffset", "handle", $hPen, "float", $fOffset) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen, "float", 1 + $iSize, "float", 1 + $iSize, "float", $iW - 2 * $iSize - 2, "float", $iH - 2 * $iSize - 2) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", 0, "float", 0, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", 0, "float", 0, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", ($iW - $__g_iBorder) / 2, "float", 0, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", ($iW - $__g_iBorder) / 2, "float", 0, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", ($iW - $__g_iBorder) - 2, "float", 0, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", ($iW - $__g_iBorder) - 2, "float", 0, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", 0, "float", ($iH - $__g_iBorder) / 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", 0, "float", ($iH - $__g_iBorder) / 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", ($iW - $__g_iBorder) - 2, "float", ($iH - $__g_iBorder) / 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", ($iW - $__g_iBorder) - 2, "float", ($iH - $__g_iBorder) / 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", 0, "float", ($iH - $__g_iBorder) - 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", 0, "float", ($iH - $__g_iBorder) - 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", ($iW - $__g_iBorder) / 2, "float", ($iH - $__g_iBorder) - 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", ($iW - $__g_iBorder) / 2, "float", ($iH - $__g_iBorder) - 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", ($iW - $__g_iBorder) - 2, "float", ($iH - $__g_iBorder) - 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) DllCall($__g_hGDIPDll, "int", "GdipDrawRectangle", "handle", $hCanvas, "handle", $hPen3, "float", ($iW - $__g_iBorder) - 2, "float", ($iH - $__g_iBorder) - 2, "float", $__g_iBorder + 1, "float", $__g_iBorder + 1) _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY) $fOffset += 0.5 _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($__g_hGUI_MarkArea, $hDC) _GDIPlus_PenDispose($hPen) _GDIPlus_PenDispose($hPen2) _GDIPlus_PenDispose($hPen3) _GDIPlus_BrushDispose($hBrush) EndFunc ;==>PlayBorderAnim Func WM_ERASEBKGND($hWnd, $iMsgm, $wParam, $lParam) ;suppress repainting to avoid flickering but causes some other side effects #forceref $iMsgm, $wParam, $lParam, $hWnd Local Const $hBrush = _WinAPI_CreateSolidBrush(0xEFCDAB) ;BGR format ;~ _WinAPI_RedrawWindow($__g_hGUI_MarkArea, 0, 0, BitOR($RDW_NOERASE, $RDW_NOCHILDREN, $RDW_NOFRAME, $RDW_VALIDATE)) _WinAPI_SetClassLongEx($__g_hGUI_MarkArea, $GCL_HBRBACKGROUND, $hBrush) _WinAPI_DeleteObject($hBrush) Return 0 EndFunc ;==>WM_ERASEBKGND ;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiawarenesscontext Func _WinAPI_SetProcessDpiAwarenessContext($DPIAwareContext = $Context_PerMonitorAware, $hGUI = 0, $iMode = 3) ;https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiawarenesscontext $DPIAwareContext = ($DPIAwareContext < -5) ? -5 : ($DPIAwareContext > -1) ? -1 : $DPIAwareContext $iMode = ($iMode < 1) ? 1 : ($iMode > 3) ? 3 : $iMode Switch $iMode Case 1 Local $hDC = _WinAPI_GetDC($hGUI) Local $aResult1 = DllCall("user32.dll", "ptr", "GetDpiFromDpiAwarenessContext", "ptr", $hDC) If @error Or Not IsArray($aResult1) Then Return SetError(11, 0, 0) _WinAPI_ReleaseDC(0, $hDC) Local $aResult = DllCall("user32.dll", "Bool", "SetProcessDpiAwarenessContext", "int", $aResult1[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(12, 0, 0) Case 2 ;~ If Not $hGUI Then $hGUI = WinGetHandle(AutoItWinGetTitle()) Local $aResult2 = DllCall("user32.dll", "int", "GetWindowDpiAwarenessContext", "ptr", $hGUI) If @error Or Not IsArray($aResult2) Then Return SetError(21, 0, 0) Local $aResult = DllCall("user32.dll", "Bool", "SetProcessDpiAwarenessContext", "int", $aResult2[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(22, 0, 0) Case 3 Local $aResult31 = DllCall("user32.dll", "ptr", "GetThreadDpiAwarenessContext") If @error Or Not IsArray($aResult31) Then Return SetError(31, 0, 0) Local $aResult32 = DllCall("user32.dll", "ptr", "GetAwarenessFromDpiAwarenessContext", "ptr", $aResult31[0]) If @error Or Not IsArray($aResult32) Then Return SetError(32, 0, 0) Local $aResult = DllCall("user32.dll", "Bool", "SetThreadDpiAwarenessContext", "int", $aResult32[0] + $DPIAwareContext) If @error Or Not IsArray($aResult) Then Return SetError(33, 0, 0) EndSwitch Return 1 EndFunc ;==>_WinAPI_SetProcessDpiAwarenessContext  
      Just press the lmb and move your mouse. When lmb is released you can adjust the size of the window by dragging the white rectangle to any direction. Rmb will move the marked area.
      Press ESC to get the coordinates of the marked region.
      If you have any improvements, please post it here.
       
      Tested on Win10 x64 only.
       
    • By UEZ
      This project has been discontinued!
       
      Here a small tool I wrote to update my Sysinternal tools collection without the need to download always the whole package or visiting the site to check for updates. I know that there are several tools available (also some tools written in AutoIt) but here another one for the collection. It was good exercise for me to code it.
       
       
        
       
       
      Some files from cannot be downloaded although they are visible on the web site!
       
      Here the download link of the source code only: AutoIt Sysinternal Tools Synchronizer v0.99.5 build 2020-07-04 beta.7z  (1509 downloads previously)
      -=> Requires AutoIt version 3.3.13.20 or higher / tested on Win8.1 real machine and some VMs: Win7 / Vista / Win10
       
      Compiled exe only: @MediaFire
       
      Just select the Sysinternal Tools folder or create one and press the synchronize button to download the selected items. Click on AutoIt label (near to left upper corner) to open menu.
       
      Special thanks to LarsJ, Melba23 and mesale0077 for their help. 
       
      I've still some ideas to implement which are more gimmick related, so it is not finished yet...
      If you want to add your language please check out #Region Language. Thanks. 
       
      Please report any bug or if you have any suggestions.
       
      The language of the tool tip from each of the executable in the left list view were automatically created using Google translator and weren't checked for correctness.
       
      Br,
      UEZ
    • By Bilgus
      This is an update or derivative work of Beege 's Scrolling Line Graph UDF
      https://www.autoitscript.com/forum/topic/109599-scrolling-line-graph-udf
       
      I noticed a few issues for my use case with the UDF one being that adding a sample required updating the waveform
      High CPU usage went hand in hand with that requirement
      Another issue was just how long updating took to complete
      I've hopefully rectified that with this version
       
      There are a few changes (only 1 line per graph for instance)
      The addition of a function AddSample (uses graphics paths to speed up drawing samples on update) Gridlines are only generated once A sample finished line can be added UpdateGraph allows you to compress the discarded portion of the graph (it looks kinda cool but uses more CPU) Lower Cpu usage Uses real Control Ids - it is a label control underneath so you get click events and can display text when control is disabled Example (Waveform.au3)
       
      Example 2 (peak.au3)
      UDF
      Updated:
      Previous Downloads [38 / 38/ 0]
      SSLG.au3 waveform.au3 Peak.au3
    • By UEZ
      I was inspired by a CSS example to create a procedural graphic without any shader or ray tracing technique.
      Here the result using GDI+ only:

       
      Blue Orb.au3
      ;Inspired from https://codepen.io/bradleytaunt/details/VwvzKyb ;Coded by UEZ build 2020-05-07 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> If @OSBuild < 7600 Then Exit MsgBox(BitOR($MB_TOPMOST, $MB_ICONERROR), "ERROR", "This demo requires GDIPlus v1.1", 10) _GDIPlus_Startup() Global Const $iW = 1200, $iH = 700, $iSize_globe = 450 Global Const $hGUI = GUICreate("GDI+ Procedural Gfx / Blue Orb v1.20 by UEZ", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Global Const $hCanvas = _GDIPlus_GraphicsCreateFromHWND($hGUI) Global Const $hImage = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Global Const $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage) _GDIPlus_GraphicsSetSmoothingMode($hGfx, $GDIP_SMOOTHINGMODE_ANTIALIAS8X8) ;~ _GDIPlus_GraphicsSetCompositingQuality($hGfx, $GDIP_COMPOSITINGQUALITYHIGHQUALITY) _GDIPlus_GraphicsSetInterpolationMode($hGfx, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, $GDIP_PIXELOFFSETMODE_HALF) ;draw background Global Const $hBrush_bg = _GDIPlus_LineBrushCreate($iW / 2, 0, $iW / 2, $iH / 2, 0xFF1E88E5, 0xFF1565C0, 2) _GDIPlus_LineBrushSetSigmaBlend ($hBrush_bg, 0.95, 1) ;create blurry edge _GDIPlus_GraphicsFillRect($hGfx, 0, 0, $iW, $iH, $hBrush_bg) ;draw blurred text Global Const $hImage_text = _GDIPlus_BitmapCreateFromScan0($iW, $iH / 2) Global Const $hGfx_text = _GDIPlus_ImageGetGraphicsContext($hImage_text) Global Const $hPath_text = _GDIPlus_PathCreate() Global Const $hFamily = _GDIPlus_FontFamilyCreate("Impact") Global Const $hStringFormat = _GDIPlus_StringFormatCreate() Global Const $hBrush_txt = _GDIPlus_LineBrushCreate($iW / 2, 0, $iW / 2, $iH / 2, 0xE0FFFFFF, 0xA01A237E) ;_GDIPlus_BrushCreateSolid(0xF02E86FB) _GDIPlus_LineBrushSetSigmaBlend($hBrush_txt, 0.66, 1) Global Const $hPen_txt = _GDIPlus_PenCreate(0x801A237E, 1) _GDIPlus_StringFormatSetAlign($hStringFormat, 1) _GDIPlus_StringFormatSetLineAlign($hStringFormat, 1) _GDIPlus_GraphicsSetSmoothingMode($hGfx_text, $GDIP_SMOOTHINGMODE_ANTIALIAS8X8) _GDIPlus_GraphicsSetTextRenderingHint($hGfx_text, $GDIP_TextRenderingHintAntialias) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx_text, $GDIP_PIXELOFFSETMODE_HALF) _GDIPlus_GraphicsSetCompositingQuality($hGfx_text, $GDIP_COMPOSITINGQUALITYHIGHQUALITY) Global $tLayout = _GDIPlus_RectFCreate() $tLayout.width = $iW $tLayout.height = $iH / 2 $tLayout.y = -$iH * 0.05 _GDIPlus_PathAddString($hPath_text, "AutoIt rulez!", $tLayout, $hFamily, 0, $iW / 8, $hStringFormat) _GDIPlus_GraphicsFillPath($hGfx_text, $hPath_text, $hBrush_txt) _GDIPlus_GraphicsDrawPath($hGfx_text, $hPath_text, $hPen_txt) Global Const $hEffect_blur_text = _GDIPlus_EffectCreateBlur(20) _GDIPlus_BitmapApplyEffect($hImage_text, $hEffect_blur_text) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_text, 0, 0, $iW, $iH / 2) ;draw shadow of the text Global Const $hBrush_txt_shadow = _GDIPlus_BrushCreateSolid(0x40000000) _GDIPlus_GraphicsClear($hGfx_text, 0) _GDIPlus_PathReset($hPath_text) $tLayout.width = $iW $tLayout.height = $iH / 2 $tLayout.y = 0 _GDIPlus_PathAddString($hPath_text, "AutoIt rulez!", $tLayout, $hFamily, 0, $iW / 8, $hStringFormat) _GDIPlus_GraphicsFillPath($hGfx_text, $hPath_text, $hBrush_txt_shadow) Global Const $hEffect_blur_text_shadow = _GDIPlus_EffectCreateBlur(60) _GDIPlus_BitmapApplyEffect($hImage_text, $hEffect_blur_text_shadow) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_text, 0, $iH * 0.55, $iW, $iH / 8) ;draw shadow Global Const $iW_shadow1 = $iSize_globe * 0.85, $iH_shadow1 = $iSize_globe * 0.1, $iW_shadow2 = $iSize_globe * 0.60, _ $iW_shadow_Img = $iW_shadow1 * 2, $iH_shadowImg = $iH_shadow1 * 4 Global Const $hImage_shadow = _GDIPlus_BitmapCreateFromScan0($iW_shadow_Img, $iH_shadowImg) Global Const $hGfx_shadow = _GDIPlus_ImageGetGraphicsContext($hImage_shadow) _GDIPlus_GraphicsSetSmoothingMode($hGfx_shadow, $GDIP_SMOOTHINGMODE_ANTIALIAS8X8) Global Const $hBrush_shadow = _GDIPlus_BrushCreateSolid(0x66000000) _GDIPlus_GraphicsFillEllipse($hGfx_shadow, ($iW_shadow_Img - $iW_shadow1) / 2, ($iH_shadowImg / 4 + $iH_shadow1), $iW_shadow1, $iH_shadow1, $hBrush_shadow) _GDIPlus_BrushSetSolidColor($hBrush_shadow, 0xB3000000) _GDIPlus_GraphicsFillEllipse($hGfx_shadow, ($iW_shadow_Img - $iW_shadow2) / 2, ($iH_shadowImg / 4 + $iH_shadow1), $iW_shadow2, $iH_shadow1, $hBrush_shadow) Global Const $hEffect_blur_shadow = _GDIPlus_EffectCreateBlur(32) _GDIPlus_BitmapApplyEffect($hImage_shadow, $hEffect_blur_shadow) _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_shadow, ($iW - $iW_shadow_Img) / 2, $iH / 2 + $iH_shadow1 * 2.20, $iW_shadow_Img, $iH_shadowImg) ;draw globe Global Const $hPath_globe = _GDIPlus_PathCreate() _GDIPlus_PathAddEllipse($hPath_globe, ($iW - $iSize_globe) / 2, ($iH - $iSize_globe) / 2, $iSize_globe, $iSize_globe) Global Const $hLBrush_globe1 = _GDIPlus_LineBrushCreate($iW / 2, ($iH - $iSize_globe) / 2, $iW / 2, ($iH + $iSize_globe) / 2, 0, 0, 1) Global $aInterpolations[5][2] $aInterpolations[0][0] = 4 $aInterpolations[1][0] = 0xFFFFFFFF $aInterpolations[1][1] = 0 $aInterpolations[2][0] = 0xFFEEEEEE $aInterpolations[2][1] = 0.10 $aInterpolations[3][0] = 0xFF2E86FB $aInterpolations[3][1] = 0.50 $aInterpolations[4][0] = 0xFF1A237E $aInterpolations[4][1] = 1.0 _GDIPlus_LineBrushSetPresetBlend($hLBrush_globe1, $aInterpolations) _GDIPlus_GraphicsFillPath($hGfx, $hPath_globe, $hLBrush_globe1) Global Const $iSize_globe2 = $iSize_globe * 0.85, $iSize_globe2_Img = $iSize_globe2 * 1.5 Global Const $hImage_globe2 = _GDIPlus_BitmapCreateFromScan0($iSize_globe2_Img, $iSize_globe2_Img) Global Const $hGfx_globe2 = _GDIPlus_ImageGetGraphicsContext($hImage_globe2) Global Const $hBrush_globe2 = _GDIPlus_BrushCreateSolid(0x7F000000) ;draw shadow and blur it Global Const $px = ($iSize_globe2_Img - $iSize_globe2) / 2, $py = ($iSize_globe2_Img - $iSize_globe2) / 2 _GDIPlus_GraphicsFillEllipse($hGfx_globe2, $px, $py + ($iSize_globe - $iSize_globe2) * 0.25, $iSize_globe2, $iSize_globe2, $hBrush_globe2) Global Const $hEffect_blur_shadow2 = _GDIPlus_EffectCreateBlur(15) _GDIPlus_BitmapApplyEffect($hImage_globe2, $hEffect_blur_shadow2) ;draw 2nd smaller globe and blur it, too Global Const $hLBrush_globe2 = _GDIPlus_LineBrushCreate($iW / 2, $py, $iW / 2, $py + $iSize_globe2, 0, 0) Dim $aInterpolations[4][2] $aInterpolations[0][0] = 3 $aInterpolations[1][0] = 0xFFFFFFFF $aInterpolations[1][1] = 0 $aInterpolations[2][0] = 0xFF2E86FB $aInterpolations[2][1] = 0.60 $aInterpolations[3][0] = 0xFF283593 $aInterpolations[3][1] = 1.0 _GDIPlus_LineBrushSetPresetBlend($hLBrush_globe2, $aInterpolations) _GDIPlus_GraphicsFillEllipse($hGfx_globe2, $px, $py, $iSize_globe2, $iSize_globe2, $hLBrush_globe2) Global Const $hImage_globe2_blur = _Blur($hImage_globe2, $iSize_globe, $iSize_globe) ;windows gdi+ blur doesn't work properly _GDIPlus_GraphicsDrawImageRect($hGfx, $hImage_globe2_blur, ($iW - $iSize_globe2_Img) / 2 - ($iSize_globe - $iSize_globe2) / 8, ($iH - $iSize_globe2_Img) / 2, $iSize_globe2_Img, $iSize_globe2_Img) GUISetState() _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage, 0, 0, $iW, $iH) ;~ _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Blue Orb v1.20.png") ;clean-up ressources _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hStringFormat) _GDIPlus_EffectDispose($hEffect_blur_text) _GDIPlus_EffectDispose($hEffect_blur_text_shadow) _GDIPlus_EffectDispose($hEffect_blur_shadow) _GDIPlus_EffectDispose($hEffect_blur_shadow2) _GDIPlus_PathDispose($hPath_text) _GDIPlus_PathDispose($hPath_globe) _GDIPlus_PenDispose($hPen_txt) _GDIPlus_BrushDispose($hBrush_txt) _GDIPlus_BrushDispose($hBrush_txt_shadow) _GDIPlus_BrushDispose($hBrush_bg) _GDIPlus_BrushDispose($hLBrush_globe1) _GDIPlus_BrushDispose($hLBrush_globe2) _GDIPlus_BrushDispose($hBrush_globe2) _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hImage_text) _GDIPlus_ImageDispose($hImage_shadow) _GDIPlus_ImageDispose($hImage_globe2) _GDIPlus_ImageDispose($hImage_globe2_blur) _GDIPlus_GraphicsDispose($hCanvas) _GDIPlus_GraphicsDispose($hGfx_text) _GDIPlus_GraphicsDispose($hGfx_shadow) _GDIPlus_GraphicsDispose($hGfx_globe2) _GDIPlus_Shutdown() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUI) Exit Func _Blur($hBitmap, $iW, $iH, $fScale = 0.0525, $dx1 = 0, $dy1 = 0, $dx2 = 0, $dy2 = 0, $qual = 6) ; by eukalyptus Local $hBmpSmall = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfxSmall = _GDIPlus_ImageGetGraphicsContext($hBmpSmall) _GDIPlus_GraphicsSetPixelOffsetMode($hGfxSmall, $GDIP_PIXELOFFSETMODE_HALF) Local $hBmpBig = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfxBig = _GDIPlus_ImageGetGraphicsContext($hBmpBig) _GDIPlus_GraphicsSetPixelOffsetMode($hGfxBig, $GDIP_PIXELOFFSETMODE_HALF) _GDIPlus_GraphicsScaleTransform($hGfxSmall, $fScale, $fScale) _GDIPlus_GraphicsSetInterpolationMode($hGfxSmall, $qual) _GDIPlus_GraphicsScaleTransform($hGfxBig, 1 / $fScale, 1 / $fScale) _GDIPlus_GraphicsSetInterpolationMode($hGfxBig, $qual) _GDIPlus_GraphicsDrawImageRect($hGfxSmall, $hBitmap, 0, $dx1, $iW, $iH + $dy1) _GDIPlus_GraphicsDrawImageRect($hGfxBig, $hBmpSmall, 0, $dx2, $iW, $iH + $dy2) _GDIPlus_BitmapDispose($hBmpSmall) _GDIPlus_GraphicsDispose($hGfxSmall) _GDIPlus_GraphicsDispose($hGfxBig) Return $hBmpBig EndFunc ;==>_Blur  
      I hope you like it.
       
      Feel free to post your examples here, too. 
×
×
  • Create New...