Code cleanup, removed a lot of FxCop messages and added some more disposing.

This commit is contained in:
RKrom 2014-06-15 11:45:01 +02:00
parent 49869a2630
commit 15253ef295
18 changed files with 119 additions and 335 deletions

View file

@ -1366,7 +1366,7 @@ namespace GreenshotPlugin.Core {
}
returnImage = new Bitmap(windowRect.Width, windowRect.Height, pixelFormat);
using (Graphics graphics = Graphics.FromImage(returnImage)) {
using (SafeDeviceContextHandle graphicsDC = graphics.getSafeDeviceContext()) {
using (SafeDeviceContextHandle graphicsDC = graphics.GetSafeDeviceContext()) {
bool printSucceeded = User32.PrintWindow(Handle, graphicsDC.DangerousGetHandle(), 0x0);
if (!printSucceeded) {
// something went wrong, most likely a "0x80004005" (Acess Denied) when using UAC