@@ -124,27 +124,33 @@ internal static void CaptureWindow(ref ScreenshotTask data)
124124
125125 bool AeroColorToggled = false ;
126126 WindowsApi . DWM_COLORIZATION_PARAMS originalParameters = new WindowsApi . DWM_COLORIZATION_PARAMS ( ) ;
127- //TODO: reenable
128127 if ( Environment . OSVersion . Version . Major >= 6 )
129128 {
130- WindowsApi . DwmGetColorizationParameters ( out originalParameters ) ;
131- if ( data . CustomGlass && AeroEnabled ( ) )
132- {
133- // Original colorization parameters
134- originalParameters . clrGlassReflectionIntensity = 50 ;
135-
136- // Custom colorization parameters
137- WindowsApi . DWM_COLORIZATION_PARAMS parameters ;
138- WindowsApi . DwmGetColorizationParameters ( out parameters ) ;
139- parameters . clrAfterGlowBalance = 2 ;
140- parameters . clrBlurBalance = 29 ;
141- parameters . clrColor = ColorToBgra ( data . AeroColor ) ;
142- parameters . nIntensity = 69 ;
143-
144- // Call the DwmSetColorizationParameters to make the change take effect.
145- WindowsApi . DwmSetColorizationParameters ( ref parameters , false ) ;
146- AeroColorToggled = true ;
147- }
129+ try
130+ {
131+ WindowsApi . DwmGetColorizationParameters ( out originalParameters ) ;
132+ if ( data . CustomGlass && AeroEnabled ( ) )
133+ {
134+ // Original colorization parameters
135+ originalParameters . clrGlassReflectionIntensity = 50 ;
136+
137+ // Custom colorization parameters
138+ WindowsApi . DWM_COLORIZATION_PARAMS parameters ;
139+ WindowsApi . DwmGetColorizationParameters ( out parameters ) ;
140+ parameters . clrAfterGlowBalance = 2 ;
141+ parameters . clrBlurBalance = 29 ;
142+ parameters . clrColor = ColorToBgra ( data . AeroColor ) ;
143+ parameters . nIntensity = 69 ;
144+
145+ // Call the DwmSetColorizationParameters to make the change take effect.
146+ WindowsApi . DwmSetColorizationParameters ( ref parameters , false ) ;
147+ AeroColorToggled = true ;
148+ }
149+ }
150+ catch ( Exception )
151+ {
152+ AeroColorToggled = false ; //workaround for Vista Betas
153+ }
148154 }
149155
150156
@@ -239,15 +245,15 @@ internal static void CaptureWindow(ref ScreenshotTask data)
239245 string pathWhiteActive = Path . Combine ( data . DiskSaveDirectory , name + "_w1.png" ) ;
240246 string pathWhiteInactive = Path . Combine ( data . DiskSaveDirectory , name + "_w2.png" ) ;
241247
242- if ( File . Exists ( pathActive ) || File . Exists ( pathInactive ) )
248+ if ( File . Exists ( pathActive ) || File . Exists ( pathInactive ) || File . Exists ( pathWhiteActive ) || File . Exists ( pathWhiteInactive ) )
243249 {
244250 for ( int i = 1 ; i < 9999 ; i ++ )
245251 {
246252 pathActive = Path . Combine ( data . DiskSaveDirectory , name + " " + i + "_b1.png" ) ;
247253 pathInactive = Path . Combine ( data . DiskSaveDirectory , name + " " + i + "_b2.png" ) ;
248254 pathWhiteActive = Path . Combine ( data . DiskSaveDirectory , name + " " + i + "_w1.png" ) ;
249255 pathWhiteInactive = Path . Combine ( data . DiskSaveDirectory , name + " " + i + "_w2.png" ) ;
250- if ( ! File . Exists ( pathActive ) )
256+ if ( ! File . Exists ( pathActive ) && ! File . Exists ( pathInactive ) && ! File . Exists ( pathWhiteActive ) && ! File . Exists ( pathWhiteInactive ) )
251257 break ;
252258 }
253259 }
@@ -258,6 +264,8 @@ internal static void CaptureWindow(ref ScreenshotTask data)
258264 }
259265 s [ 0 ] . Dispose ( ) ;
260266 s [ 1 ] . Dispose ( ) ;
267+ s [ 2 ] . Dispose ( ) ;
268+ s [ 3 ] . Dispose ( ) ;
261269 }
262270
263271 if ( data . DoResize )
0 commit comments