Shiro Posted August 22, 2009 Share Posted August 22, 2009 hi, i have created a very little script which shows a message box. in the message box i want to add 30 day trial info. something like this: Title: You have been using this program since 1 day! Message: This program 'll expire in 29 days! how would i do this? Link to comment Share on other sites More sharing options...
Yashied Posted August 22, 2009 Share Posted August 22, 2009 (edited) MsgBox(64, "You have been using this program since 1 day!", "This program 'll expire in 29 days!") ??? Edited August 22, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Shiro Posted August 22, 2009 Author Share Posted August 22, 2009 (edited) MsgBox(64, "You have been using this program since 1 day!", "This program 'll expire in 29 days!") ??? it's not what i am looking for, i know MsgBox() very well. the problem is that i want it to be changed every day! Like if i ran/run the app today then it 'll say! Title: You have been using this program since 1 day! Message: This program 'll expire in 29 days! After 5 days: Title: You have been using this program since 5 days! Message: This program 'll expire in 25 days! after 18 days: Title: You have been using this program since 18 days! Message: This program 'll expire in 12 days! i hope you got my point, in the message box i want to add 30 day trial info. Edited August 22, 2009 by Shiro Link to comment Share on other sites More sharing options...
Yashied Posted August 22, 2009 Share Posted August 22, 2009 it's not what i am looking for, i know MsgBox() very well.the problem is that i want it to be changed every day!Like if i ran/run the app today then it 'll say!Title: You have been using this program since 1 day!Message: This program 'll expire in 29 days!After 5 days:Title: You have been using this program since 5 days!Message: This program 'll expire in 25 days!after 18 days:Title: You have been using this program since 18 days!Message: This program 'll expire in 12 days!i hope you got my point, in the message box i want to add 30 day trial info.Keep the starting date in the registry, and every time you start program compare this date with the current date. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Shiro Posted August 22, 2009 Author Share Posted August 22, 2009 any example? Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 22, 2009 Share Posted August 22, 2009 im not sure about the registry so i wont post it... but $startup = ;the registry key you need... or anyfile you wanted to write $0 = @YDAY msgbox (0,'',$0 - $startup & ' days left on trial.') just as an example mind you... use more indepth math operations and string manipulations to do it more efficiently... also get the @YEAR and then compare that as well [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Shiro Posted August 22, 2009 Author Share Posted August 22, 2009 well, i could not understand at all, where in msgbox $0 is @day & $startup is the registry key?if we store some spesific date in a txt fie or in registry key then how it 'll show them as i want them?i think in the example mentioned above there is nothing which can help me to write it.i mean something like "you have passed 1 day(s) running this app and 29 day(s) are left."can any one post a example of storing date in txt file and do as i asked? Link to comment Share on other sites More sharing options...
Bowmore Posted August 22, 2009 Share Posted August 22, 2009 well, i could not understand at all, where in msgbox $0 is @day & $startup is the registry key? if we store some spesific date in a txt fie or in registry key then how it 'll show them as i want them? i think in the example mentioned above there is nothing which can help me to write it. i mean something like "you have passed 1 day(s) running this app and 29 day(s) are left." can any one post a example of storing date in txt file and do as i asked? This example should make it clearer for you. It uses the registry rather than a text file to store the date the application was first run. #include <Date.au3> MsgBox(0 ,"Days Used", "You have been using this application for " & _GetNumDaysSinceFirstRun() & " days") Func _GetNumDaysSinceFirstRun() Local $NumDaysUsed = 0 Local $InstallDate = "" Local $TodaysDate = _NowCalcDate() ;To test uncomment the line below to test, Adds 9 days to todays date ;$TodaysDate = _DateAdd("D",9,$TodaysDate) $InstallDate = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\mytrialapplication", "firstrun" ) If @error Then ; Registry key does not exist so it's probably the ; first time application has been run so store todays date in registry RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\mytrialapplication", "firstrun", "REG_SZ", $TodaysDate) ;Number of days used is 0 Return $NumDaysUsed Else ; Calculate the number of days between install date and today $NumDaysUsed = _DateDiff("D", $InstallDate, $TodaysDate) EndIf Return $NumDaysUsed EndFunc "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Shiro Posted August 23, 2009 Author Share Posted August 23, 2009 thanks a lot "Bowmore" but how can i get the information of days left in expiration?For example it says: You have been using this application for 0 days.and i also want to show days left: You have been using this application for 0 days and it will expire in 30 days. Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 23, 2009 Share Posted August 23, 2009 use math [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Shiro Posted August 23, 2009 Author Share Posted August 23, 2009 any example code? Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 23, 2009 Share Posted August 23, 2009 use this lol $started = ;when you started the trial... get this date from however means you wish $current = @yday $daysleft = $current - $started ;for example ;$started = 10 (JAN 10TH) ;$Current = 11 (JAN 11TH) ;$Daysleft = $Current - $started ;therefore... $Daysleft = 1 simple as that dont bother running this code it wont work... [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now