mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Added IncorrectPassword for windows versions newer as Windows XP
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@883 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
ede0ddfc6b
commit
e820e1bc0e
1 changed files with 17 additions and 0 deletions
|
@ -29,6 +29,7 @@ using System.Windows.Forms;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The following code comes from: http://www.developerfusion.com/code/4693/using-the-credential-management-api/
|
/// 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.
|
/// and is slightly modified so it works for us.
|
||||||
|
/// Oh, try Start-> Run and type "Control keymgr.dll" to see your usernames and passwords
|
||||||
/// The following code is an example for a login, it will call the Authenticate with user/password
|
/// The following code is an example for a login, it will call the Authenticate with user/password
|
||||||
/// which should return true if the login worked, false if not.
|
/// which should return true if the login worked, false if not.
|
||||||
/// private static bool Login(string system, string name) {
|
/// private static bool Login(string system, string name) {
|
||||||
|
@ -45,6 +46,7 @@ using System.Windows.Forms;
|
||||||
/// } catch (ApplicationException) {
|
/// } catch (ApplicationException) {
|
||||||
/// // exception handling ...
|
/// // exception handling ...
|
||||||
/// }
|
/// }
|
||||||
|
/// dialog.IncorrectPassword = true;
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// } catch (ApplicationException) {
|
/// } catch (ApplicationException) {
|
||||||
|
@ -132,6 +134,17 @@ namespace Greenshot.Helpers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _incorrectPassword = false;
|
||||||
|
/// <summary>Gets or sets if the incorrect password balloontip needs to be shown. Introduced AFTER Windows XP</summary>Gets></summary>
|
||||||
|
public bool IncorrectPassword {
|
||||||
|
get {
|
||||||
|
return _incorrectPassword;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
_incorrectPassword = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool _keepName = false;
|
private bool _keepName = false;
|
||||||
/// <summary>Gets or sets if the name is read-only.</summary>
|
/// <summary>Gets or sets if the name is read-only.</summary>
|
||||||
public bool KeepName {
|
public bool KeepName {
|
||||||
|
@ -440,6 +453,10 @@ namespace Greenshot.Helpers {
|
||||||
private CREDUI.FLAGS GetFlags() {
|
private CREDUI.FLAGS GetFlags() {
|
||||||
CREDUI.FLAGS flags = CREDUI.FLAGS.GENERIC_CREDENTIALS;
|
CREDUI.FLAGS flags = CREDUI.FLAGS.GENERIC_CREDENTIALS;
|
||||||
|
|
||||||
|
if (this.IncorrectPassword) {
|
||||||
|
flags = flags | CREDUI.FLAGS.INCORRECT_PASSWORD;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.AlwaysDisplay) {
|
if (this.AlwaysDisplay) {
|
||||||
flags = flags | CREDUI.FLAGS.ALWAYS_SHOW_UI;
|
flags = flags | CREDUI.FLAGS.ALWAYS_SHOW_UI;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue