Made it usable inside Greenshot

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@885 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2010-09-22 06:16:51 +00:00
parent 3a4fc710b7
commit dd630f20a1
2 changed files with 8 additions and 11 deletions

View file

@ -91,6 +91,7 @@
</Compile>
<Compile Include="Helpers\ClipboardHelper.cs" />
<Compile Include="Helpers\CopyData.cs" />
<Compile Include="Helpers\CredentialsHelper.cs" />
<Compile Include="Helpers\EnvironmentInfo.cs" />
<Compile Include="Helpers\FilenameHelper.cs" />
<Compile Include="Helpers\HotkeyHelper.cs" />

View file

@ -20,12 +20,14 @@
*/
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Greenshot.UnmanagedHelpers;
/// <summary>
/// The following code comes from: http://www.developerfusion.com/code/4693/using-the-credential-management-api/
/// and is slightly modified so it works for us.
@ -423,10 +425,12 @@ namespace Greenshot.Helpers {
password, CREDUI.MAX_PASSWORD_LENGTH,
ref saveChecked,
flags
);
);
// clean up resources
if (this.Banner != null) GDI32.DeleteObject(info.hbmBanner);
if (this.Banner != null) {
GDI32.DeleteObject(info.hbmBanner);
}
// set the accessors from the api call parameters
this.Name = name.ToString();
@ -514,14 +518,6 @@ namespace Greenshot.Helpers {
}
}
public sealed class GDI32 {
private GDI32() {
}
[DllImport("gdi32.dll", EntryPoint="DeleteObject")]
public static extern bool DeleteObject(IntPtr hObject);
}
public sealed class CREDUI {
private CREDUI() {
}