@@ -2459,6 +2459,9 @@ private void TakeScreenshot()
24592459 _screenCapture . DateTimePreviousCycle = DateTime . Now ;
24602460 Log . Write ( "Date and time of screen capture cycle set to " + _screenCapture . DateTimePreviousCycle ) ;
24612461
2462+ _screenCapture . ActiveWindowTitle = _screenCapture . GetActiveWindowTitle ( ) ;
2463+ Log . Write ( "Active window title of screen capture set to " + _screenCapture . ActiveWindowTitle ) ;
2464+
24622465 RunRegionCaptures ( ) ;
24632466
24642467 RunScreenCaptures ( ) ;
@@ -2706,9 +2709,7 @@ private void RunRegionCaptures()
27062709 {
27072710 MacroParser . screenCapture = _screenCapture ;
27082711
2709- string activeWindowTitle = _screenCapture . GetActiveWindowTitle ( ) ;
2710-
2711- if ( ! string . IsNullOrEmpty ( activeWindowTitle ) )
2712+ if ( ! string . IsNullOrEmpty ( _screenCapture . ActiveWindowTitle ) )
27122713 {
27132714 if ( _screenCapture . GetScreenImages ( - 1 , region . X , region . Y , region . Width , region . Height , region . Mouse , out Bitmap bitmap ) )
27142715 {
@@ -2722,7 +2723,7 @@ private void RunRegionCaptures()
27222723 viewId : region . ViewId ,
27232724 bitmap : bitmap ,
27242725 label : textBoxScreenshotLabel . Text ,
2725- windowTitle : activeWindowTitle ,
2726+ windowTitle : _screenCapture . ActiveWindowTitle ,
27262727 screenCollection : formScreen . ScreenCollection ,
27272728 regionCollection : formRegion . RegionCollection ,
27282729 screenshotCollection : _screenshotCollection
@@ -2749,10 +2750,8 @@ private void RunScreenCaptures()
27492750 {
27502751 MacroParser . screenCapture = _screenCapture ;
27512752
2752- string activeWindowTitle = _screenCapture . GetActiveWindowTitle ( ) ;
2753-
27542753 // Active Window
2755- if ( ! string . IsNullOrEmpty ( activeWindowTitle ) )
2754+ if ( ! string . IsNullOrEmpty ( _screenCapture . ActiveWindowTitle ) )
27562755 {
27572756 if ( _screenCapture . GetScreenImages ( screen . Component , 0 , 0 , 0 , 0 , false , out Bitmap bitmap ) )
27582757 {
@@ -2766,7 +2765,7 @@ private void RunScreenCaptures()
27662765 viewId : screen . ViewId ,
27672766 bitmap : bitmap ,
27682767 label : textBoxScreenshotLabel . Text ,
2769- windowTitle : activeWindowTitle ,
2768+ windowTitle : _screenCapture . ActiveWindowTitle ,
27702769 screenCollection : formScreen . ScreenCollection ,
27712770 regionCollection : formRegion . RegionCollection ,
27722771 screenshotCollection : _screenshotCollection
@@ -2788,9 +2787,7 @@ private void RunScreenCaptures()
27882787 {
27892788 MacroParser . screenCapture = _screenCapture ;
27902789
2791- string activeWindowTitle = _screenCapture . GetActiveWindowTitle ( ) ;
2792-
2793- if ( ! string . IsNullOrEmpty ( activeWindowTitle ) )
2790+ if ( ! string . IsNullOrEmpty ( _screenCapture . ActiveWindowTitle ) )
27942791 {
27952792 // Screen X
27962793 if ( _screenCapture . GetScreenImages ( screen . Component ,
@@ -2809,7 +2806,7 @@ private void RunScreenCaptures()
28092806 viewId : screen . ViewId ,
28102807 bitmap : bitmap ,
28112808 label : textBoxScreenshotLabel . Text ,
2812- windowTitle : activeWindowTitle ,
2809+ windowTitle : _screenCapture . ActiveWindowTitle ,
28132810 screenCollection : formScreen . ScreenCollection ,
28142811 regionCollection : formRegion . RegionCollection ,
28152812 screenshotCollection : _screenshotCollection
0 commit comments