Refactored code location of the isGDIAllowed/isDWMAllowed, also changed the timeout for getting the HTML object from a window to 5 Seconds (instead of 1).

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1877 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-18 07:36:18 +00:00
commit cac99fbaf3
5 changed files with 54 additions and 52 deletions

View file

@ -200,49 +200,6 @@ namespace GreenshotPlugin.Core {
return (ExperimentalFeatures != null && ExperimentalFeatures.Contains(experimentalFeature));
}
/// <summary>
/// Helper method to check if it is allowed to capture the process using DWM
/// </summary>
/// <param name="process">Process owning the window</param>
/// <returns>true if it's allowed</returns>
public bool isDWMAllowed(Process process) {
if (process != null) {
if (NoDWMCaptureForProduct != null && NoDWMCaptureForProduct.Count > 0) {
try {
string productName = process.MainModule.FileVersionInfo.ProductName;
if (productName != null && NoDWMCaptureForProduct.Contains(productName.ToLower())) {
return false;
}
} catch (Exception ex) {
LOG.Warn(ex);
}
}
}
return true;
}
/// <summary>
/// Helper method to check if it is allowed to capture the process using GDI
/// </summary>
/// <param name="processName">Process owning the window</param>
/// <returns>true if it's allowed</returns>
public bool isGDIAllowed(Process process) {
if (process != null) {
if (NoGDICaptureForProduct != null && NoGDICaptureForProduct.Count > 0) {
try {
string productName = process.MainModule.FileVersionInfo.ProductName;
if (productName != null && NoGDICaptureForProduct.Contains(productName.ToLower())) {
return false;
}
} catch (Exception ex) {
LOG.Warn(ex);
}
}
}
return true;
}
/// <summary>
/// Supply values we can't put as defaults
/// </summary>