#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=icons\chat.ico #AutoIt3Wrapper_Outfile=bubbletip.exe #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; ================================================================================================================ ; LANGUAGE OPTIONS Opt("TrayMenuMode",1) AutoItSetOption("MustDeclareVars", 0) ; ================================================================================================================ ; INCLUDES (update as needed) #Include #include #include ; ================================================================================================================ ; DUPLICATE INSTANCE CHECK (may need to remove or move this around depending on where it is needed) If UBound(ProcessList(@ScriptName)) > 2 Then Exit ; ================================================================================================================ ; SCRIPT DESCRIPTION and VERSION $sAppDescription = "User definable Windows bubbletip" $sAppName = "Bubbletip" $sAppAuthor = "Sean Shrum" $sAppVersion = "1.10" ; ================================================================================================================ ; AUTO GENERATED SCRIPT VALUES (this is based on the filename of the script/executable) $sAppEmail = StringLower($sAppName)& "@shrum.net" $sAppHome = "http://www.shrum.net/sean/code/" & StringLower($sAppName) $sAppNews = $SAppHome & "/updates.html" $sAppSupport = $sAppHome & "/support.html" $sAppFileType ="." & StringLower($sAppName) $aAppBuild = FileGetTime(@ScriptFullPath) $sAppBuild = $aAppBuild[0] & "." & $aAppBuild[1] & "." & $aAppBuild[2] & " @ " & $aAppBuild[3] & ":" & $aAppBuild[4] & ":" & $aAppBuild[5] $sAppTitle = $sAppName & " v." & $sAppVersion $sAppSettings = "HKCU\software\shrum.net\" & $sAppName ; ================================================================================================================ ; VARIABLE DECLARATIONS / DEFAULTS Global $bVerbose, $iSeconds=10, $iIcon=0, $sTitle=$sAppTitle ; ================================================================================================================ ; TRAY ICON AND TOOLTIP SET (looks for .ico in same folder as .exe otherwise uses the build icon) TraySetToolTip($sAppTitle) TraySetIcon($sAppName & ".ico") ; ================================================================================================================ ; SPLASH SCREEN / TRAYTIP BUBBLE (*only* if no command line params are present: automated run/batch call) ; ================================================================================================================ ; REGISTRY UPDATES (location, version, runcount) $iRunCount = RegRead($sAppSettings, "Executed") RegWrite($sAppSettings, "Executed", "REG_SZ", $iRunCount + 1) RegWrite($sAppSettings, "", "REG_SZ", @Scriptdir) RegWrite($sAppSettings, "Version", "REG_SZ", $sAppVersion) ; ================================================================================================================ ; PROGRAM GROUP / SHORTCUTS CREATION (fires only when Executed reg value = "" from above) If $iRunCount = "" Then DirCreate(@ProgramsCommonDir & "\shrum.net\" & $sAppName) FileCreateShortcut(@ScriptFullPath, @ProgramsCommonDir & "\shrum.net\" & $sAppName & "\" & $sAppName & ".lnk") FileCreateShortcut($sAppHome, @ProgramsCommonDir & "\shrum.net\" & $sAppName & "\Homepage.lnk") FileCreateShortcut(@ScriptFullPath, @UserProfileDir & "\application data\microsoft\Internet Explorer\Quick Launch\" & $sAppName & ".lnk") EndIf ; ================================================================================================================ ; SYSTRAY MENU DEFINITIONS (if any) ; N/A ; ================================================================================================================ ; LAST RUN SETTINGS LOAD ; N/A ; ================================================================================================================ ; COMMAND-LINE / .INI EVALUATION if $CmdLine[0] = 0 Then $iResult = MsgBox(4,$sAppTitle, $sAppTitle & " (" & $sAppBuild & ")" & @CRLF & _ $sAppHome & @CRLF & _ $sAppAuthor & " (" & $sAppEmail & ")" & @CRLF & @CRLF & _ $sAppDescription & @CRLF & @CRLF & _ "+ Bubbletip params:" & @CRLF & @CRLF & _ " [T]itle = Bubbletip title" & @CRLF & _ " [M]essage = Message" & @CRLF & _ " [S]econds = Seconds to display (10 default)" & @CRLF & _ " [I]con = Icon to display (0 default)" & @CRLF & @CRLF & _ "Would you like to visit the Bubbletip web site?") If $iResult = 6 Then ShellExecute($sAppHome) Exit else for $i = 1 to $CmdLine[0] $aParam = StringSplit($CmdLine[$i], "=") $sParam = StringUpper(stringleft($aParam[1],1)) Select case $sParam = "T";itle $sTitle = $aParam[2] case $sParam = "M";essage $sMessage = $aParam[2] case $sParam = "S";econds $iSeconds = $aParam[2] case $sParam = "I";con $iIcon = $aParam[2] EndSelect Next EndIf ; ================================================================================================================ ; ARGUMENT CHECKS / PROMPTS if $sMessage = "" then msgbox(0, $sAppTitle, "No message arguement supplied. Exiting", 10) Exit EndIf ; ================================================================================================================ ; SETTINGS SAVE (all user passed params should be formatted to program-desired formats by this point) ; N/A ; ================================================================================================================ ; HOTKEY DEFINITIONS (if any) ; N/A ; ================================================================================================================ ; DEBUG WINDOW (notepad; if requested) ; N/A ; ================================================================================================================ ; MAIN PROGRAM traytip($sTitle, $sMessage, $iSeconds, $iIcon) sleep($iSeconds * 1000)