@@ -88,7 +88,7 @@ public FormMain(string[] args)
8888 InitializeComponent ( ) ;
8989
9090 Text = Properties . Settings . Default . ApplicationName ;
91- notifyIcon . Text = Properties . Settings . Default . ApplicationName ;
91+ notifyIcon . Text = Properties . Settings . Default . ApplicationName + " (" + Properties . Settings . Default . ApplicationVersion + ")" ;
9292
9393 Log . Write ( "*** " + Properties . Settings . Default . ApplicationName + " (" + Properties . Settings . Default . ApplicationVersion + ") ***" ) ;
9494
@@ -961,17 +961,14 @@ private void StopScreenCapture()
961961 ScreenCapture . Count = 0 ;
962962 timerScreenCapture . Enabled = false ;
963963
964- // Let the user know of the last capture that was taken and the status of the session ("Stopped").
965- DisplayCaptureStatus ( false ) ;
964+ ScreenCapture . Running = false ;
966965
967966 DisableStopScreenCapture ( ) ;
968967 EnableStartScreenCapture ( ) ;
969968
970969 SearchDates ( ) ;
971970 SearchSlides ( ) ;
972971
973- ScreenCapture . Running = false ;
974-
975972 RunTriggersOfConditionType ( TriggerConditionType . ScreenCaptureStopped ) ;
976973 }
977974 }
@@ -1088,14 +1085,15 @@ private void StartScreenCapture()
10881085
10891086 ScreenCapture . Running = true ;
10901087
1088+ ScreenCapture . DateTimeStartCapture = DateTime . Now ;
1089+
10911090 RunTriggersOfConditionType ( TriggerConditionType . ScreenCaptureStarted ) ;
10921091
10931092 if ( checkBoxInitialScreenshot . Checked )
10941093 {
10951094 Log . Write ( "Taking initial screenshots." ) ;
10961095
10971096 TakeScreenshot ( ) ;
1098- DisplayCaptureStatus ( true ) ;
10991097 }
11001098
11011099 // Start taking screenshots.
@@ -1631,26 +1629,6 @@ private void DisableStartScreenCapture()
16311629 buttonBrowseFolder . Enabled = false ;
16321630 }
16331631
1634- /// <summary>
1635- /// Displays the screen capture status.
1636- /// </summary>
1637- /// <param name="running">Can be "true" for "Running" or "false" for "Stopped".</param>
1638- private void DisplayCaptureStatus ( bool running )
1639- {
1640- string appName = Properties . Settings . Default . ApplicationName ;
1641-
1642- if ( running )
1643- {
1644- appName += " - " + StatusMessage . RUNNING ;
1645- }
1646- else
1647- {
1648- appName += " - " + StatusMessage . STOPPED ;
1649- }
1650-
1651- notifyIcon . Text = appName ;
1652- }
1653-
16541632 /// <summary>
16551633 /// Plays the slideshow.
16561634 /// </summary>
@@ -2598,8 +2576,6 @@ private void Tick_timerPreviewCapture(object sender, EventArgs e)
25982576 /// <param name="e"></param>
25992577 private void Tick_timerScreenCapture ( object sender , EventArgs e )
26002578 {
2601- DisplayCaptureStatus ( true ) ;
2602-
26032579 if ( ! timerScreenCapture . Enabled )
26042580 {
26052581 StopScreenCapture ( ) ;
@@ -2633,19 +2609,19 @@ private void TakeScreenshot()
26332609
26342610 AutoReset ( ) ;
26352611
2636- DateTime dateTimeScreenshotTaken = DateTime . Now ;
2612+ ScreenCapture . DateTimePreviousScreenshot = DateTime . Now ;
26372613
26382614 // Save a copy of an empty screenshot image file so that we can retrieve it later in the Slideshow.
26392615 if ( CaptureScreenAllowed ( 1 ) || CaptureScreenAllowed ( 2 ) || CaptureScreenAllowed ( 3 ) || CaptureScreenAllowed ( 4 ) || CaptureScreenAllowed ( 5 ) )
26402616 {
2641- ScreenCapture . Save ( FileSystem . UserAppDataLocalDirectory + MacroParser . ParseTags ( _imageFormatCollection , MacroParser . ScreenshotListMacro , ScreenCapture . Format , null , dateTimeScreenshotTaken ) ) ;
2617+ ScreenCapture . Save ( FileSystem . UserAppDataLocalDirectory + MacroParser . ParseTags ( _imageFormatCollection , MacroParser . ScreenshotListMacro , null ) ) ;
26422618 }
26432619
26442620 // Active Window
26452621 if ( CaptureScreenAllowed ( 5 ) )
26462622 {
2647- ScreenCapture . TakeScreenshot ( _imageFormatCollection , null , dateTimeScreenshotTaken , ScreenCapture . Format , "5" , FileSystem . UserAppDataLocalDirectory + MacroParser . ParseTags ( _imageFormatCollection , MacroParser . ApplicationMacro , ScreenCapture . Format , "5" , dateTimeScreenshotTaken ) , 5 , ScreenshotType . Application , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
2648- ScreenCapture . TakeScreenshot ( _imageFormatCollection , null , dateTimeScreenshotTaken , ScreenCapture . Format , textBoxScreen5Name . Text , ScreenCapture . Folder + MacroParser . ParseTags ( _imageFormatCollection , ScreenCapture . Macro , ScreenCapture . Format , textBoxScreen5Name . Text , dateTimeScreenshotTaken ) , 5 , ScreenshotType . User , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
2623+ ScreenCapture . TakeScreenshot ( _imageFormatCollection , null , "5" , FileSystem . UserAppDataLocalDirectory + MacroParser . ParseTags ( _imageFormatCollection , MacroParser . ApplicationMacro , "5" ) , 5 , ScreenshotType . Application , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
2624+ ScreenCapture . TakeScreenshot ( _imageFormatCollection , null , textBoxScreen5Name . Text , ScreenCapture . Folder + MacroParser . ParseTags ( _imageFormatCollection , ScreenCapture . Macro , textBoxScreen5Name . Text ) , 5 , ScreenshotType . User , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
26492625 }
26502626
26512627 // All screens.
@@ -2679,8 +2655,8 @@ private void TakeScreenshot()
26792655
26802656 if ( ! string . IsNullOrEmpty ( screenName ) )
26812657 {
2682- ScreenCapture . TakeScreenshot ( _imageFormatCollection , screen , dateTimeScreenshotTaken , ScreenCapture . Format , count . ToString ( ) , FileSystem . UserAppDataLocalDirectory + MacroParser . ParseTags ( _imageFormatCollection , MacroParser . ApplicationMacro , ScreenCapture . Format , count . ToString ( ) , dateTimeScreenshotTaken ) , count , ScreenshotType . Application , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
2683- ScreenCapture . TakeScreenshot ( _imageFormatCollection , screen , dateTimeScreenshotTaken , ScreenCapture . Format , screenName , ScreenCapture . Folder + MacroParser . ParseTags ( _imageFormatCollection , ScreenCapture . Macro , ScreenCapture . Format , screenName , dateTimeScreenshotTaken ) , count , ScreenshotType . User , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
2658+ ScreenCapture . TakeScreenshot ( _imageFormatCollection , screen , count . ToString ( ) , FileSystem . UserAppDataLocalDirectory + MacroParser . ParseTags ( _imageFormatCollection , MacroParser . ApplicationMacro , count . ToString ( ) ) , count , ScreenshotType . Application , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
2659+ ScreenCapture . TakeScreenshot ( _imageFormatCollection , screen , screenName , ScreenCapture . Folder + MacroParser . ParseTags ( _imageFormatCollection , ScreenCapture . Macro , screenName ) , count , ScreenshotType . User , ( long ) numericUpDownJpegQualityLevel . Value , checkBoxMouse . Checked ) ;
26842660 }
26852661 }
26862662 }
@@ -3403,5 +3379,25 @@ private void RunTriggersOfConditionType(TriggerConditionType conditionType)
34033379 }
34043380 }
34053381 }
3382+
3383+ /// <summary>
3384+ /// Displays the remaining time for when the next screenshot will be taken
3385+ /// when the mouse pointer moves over the system tray icon.
3386+ /// </summary>
3387+ /// <param name="sender"></param>
3388+ /// <param name="e"></param>
3389+ private void notifyIcon_MouseMove ( object sender , MouseEventArgs e )
3390+ {
3391+ int remainingHours = ScreenCapture . TimeRemainingForNextScreenshot . Hours ;
3392+ int remainingMinutes = ScreenCapture . TimeRemainingForNextScreenshot . Minutes ;
3393+ int remainingSeconds = ScreenCapture . TimeRemainingForNextScreenshot . Seconds ;
3394+
3395+ string remainingHoursStr = ( remainingHours > 0 ? remainingHours . ToString ( ) + " hour" + ( remainingHours > 1 ? "s" : string . Empty ) + ", " : string . Empty ) ;
3396+ string remainingMinutesStr = ( remainingMinutes > 0 ? remainingMinutes . ToString ( ) + " minute" + ( remainingMinutes > 1 ? "s" : string . Empty ) + ", " : string . Empty ) ;
3397+
3398+ notifyIcon . Text = "Next screenshot in " +
3399+ remainingHoursStr + remainingMinutesStr + remainingSeconds . ToString ( ) +
3400+ " second" + ( remainingSeconds > 1 ? "s" : string . Empty ) + " at " + ScreenCapture . DateTimeNextScreenshot . ToShortTimeString ( ) ;
3401+ }
34063402 }
34073403}
0 commit comments