Caps Lock Warning for Password Control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zacks@construction-imaging.com

    Caps Lock Warning for Password Control

    I'm not sure when it came into being, since this it the first time I
    have worked very much with a password control in .NET, but if a
    textbox that has a non-empty value for PasswordChar or the
    UseSystemPasswo rdChar property is true, and the textbox has focus, if
    the Caps Lock key is pressed, a warning balloon tooltip is
    automatically displayed by the system. I cannot even find
    documentation that describes this behaviour.

    My question is, is there anyway to temporarily turn that off in code?
  • Jeroen Mostert

    #2
    Re: Caps Lock Warning for Password Control

    zacks@construct ion-imaging.com wrote:
    I'm not sure when it came into being, since this it the first time I
    have worked very much with a password control in .NET, but if a
    textbox that has a non-empty value for PasswordChar or the
    UseSystemPasswo rdChar property is true, and the textbox has focus, if
    the Caps Lock key is pressed, a warning balloon tooltip is
    automatically displayed by the system. I cannot even find
    documentation that describes this behaviour.
    >
    There isn't any, it's a courtesy of your friendly neighborhood common
    controls library. :-)
    My question is, is there anyway to temporarily turn that off in code?
    My question is, why on earth would you want to? It's saved my bacon a few
    times. That said...

    The behavior you describe comes with the system edit control. The system
    (well, actually, "something" , it's always hard to tell) will send an
    EM_SHOWBALLOONT IP message, which you can suppress by (for example) using a
    custom control that overrides WndProc:

    public class CustomMaskedTex tBox : MaskedTextBox {
    private const int EM_SHOWBALLOONT IP = 0x1503;
    public bool DisableBalloonT ips { get; set; }

    protected override void WndProc(ref Message m) {
    if (m.Msg == EM_SHOWBALLOONT IP && DisableBalloonT ips) {
    m.Result = (IntPtr) 0;
    return;
    }
    base.WndProc(re f m);
    }
    }

    A more general method would be to use some way of subclassing the control,
    since this can apply to any edit box.

    Since you cross-posted this in the C# and VB groups, I trust you can
    translate it to VB yourself if necessary. For future reference, a better
    group would have been microsoft.publi c.dotnet.framew ork.windowsform s, since
    this is not a language-specific question.

    --
    J.

    Comment

    • zacks@construction-imaging.com

      #3
      Re: Caps Lock Warning for Password Control

      On Jul 11, 2:54 pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
      za...@construct ion-imaging.com wrote:
      I'm not sure when it came into being, since this it the first time I
      have worked very much with a password control in .NET, but if a
      textbox that has a non-empty value for PasswordChar or the
      UseSystemPasswo rdChar property is true, and the textbox has focus, if
      the Caps Lock key is pressed, a warning balloon tooltip is
      automatically displayed by the system. I cannot even find
      documentation that describes this behaviour.
      >
      There isn't any, it's a courtesy of your friendly neighborhood common
      controls library. :-)
      >
      My question is, is there anyway to temporarily turn that off in code?
      >
      My question is, why on earth would you want to? It's saved my bacon a few
      times. That said...
      My company uses a third part software packe that our software
      integrates with. The third part software has two methods of security,
      one uses Active Directory, where the password is defiitely case
      sensitive. But the password for the builtin security is not case
      sensitive. That is why I would like to be able to turn it off, if the
      database is configured to use the third party software security, there
      is no need to warn the user that the Caps Lock key is on.
      >
      The behavior you describe comes with the system edit control. The system
      (well, actually, "something" , it's always hard to tell) will send an
      EM_SHOWBALLOONT IP message, which you can suppress by (for example) using a
      custom control that overrides WndProc:
      >
         public class CustomMaskedTex tBox : MaskedTextBox {
           private const int EM_SHOWBALLOONT IP = 0x1503;
           public bool DisableBalloonT ips { get; set; }
      >
           protected override void WndProc(ref Message m) {
             if (m.Msg == EM_SHOWBALLOONT IP && DisableBalloonT ips) {
               m.Result = (IntPtr) 0;
               return;
             }
             base.WndProc(re f m);
           }
         }
      >
      A more general method would be to use some way of subclassing the control,
      since this can apply to any edit box.
      >
      Since you cross-posted this in the C# and VB groups, I trust you can
      translate it to VB yourself if necessary. For future reference, a better
      group would have been microsoft.publi c.dotnet.framew ork.windowsform s, since
      this is not a language-specific question.
      Thanks, I will try your segguestion. I crossposted to both groups
      cause it was, as you say, not language specific. I was unaware of the
      other newsgroup, in the future I will first try there.

      Comment

      • Jeroen Mostert

        #4
        Re: Caps Lock Warning for Password Control

        zacks@construct ion-imaging.com wrote:
        On Jul 11, 2:54 pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
        >za...@construc tion-imaging.com wrote:
        >>I'm not sure when it came into being, since this it the first time I
        >>have worked very much with a password control in .NET, but if a
        >>textbox that has a non-empty value for PasswordChar or the
        >>UseSystemPass wordChar property is true, and the textbox has focus, if
        >>the Caps Lock key is pressed, a warning balloon tooltip is
        >>automatical ly displayed by the system. I cannot even find
        >>documentati on that describes this behaviour.
        >There isn't any, it's a courtesy of your friendly neighborhood common
        >controls library. :-)
        >>
        >>My question is, is there anyway to temporarily turn that off in code?
        >My question is, why on earth would you want to? It's saved my bacon a few
        >times. That said...
        >
        My company uses a third part software packe that our software
        integrates with. The third part software has two methods of security,
        one uses Active Directory, where the password is defiitely case
        sensitive. But the password for the builtin security is not case
        sensitive. That is why I would like to be able to turn it off, if the
        database is configured to use the third party software security, there
        is no need to warn the user that the Caps Lock key is on.
        >
        It can't hurt to warn, though, and it's very good for users to get
        accustomed to the rule "passwords are case sensitive", since in most systems
        they are (and in those were they aren't, they ought to be, but let's ignore
        the issue of password strength for now). Unless users (or pointy-haired
        bosses) actually complain that they're confused by the message, I wouldn't
        go to the trouble of disabling it. Especially since the way to disable it is
        a bit dubious (turning off balloon tips works, but it has the obvious
        drawback of, well, turning off balloon tips, which can be used for more
        purposes than caps lock warnings).

        --
        J.

        Comment

        • zacks@construction-imaging.com

          #5
          Re: Caps Lock Warning for Password Control

          On Jul 11, 3:49 pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
          za...@construct ion-imaging.com wrote:
          On Jul 11, 2:54 pm, Jeroen Mostert <jmost...@xs4al l.nlwrote:
          za...@construct ion-imaging.com wrote:
          >I'm not sure when it came into being, since this it the first time I
          >have worked very much with a password control in .NET, but if a
          >textbox that has a non-empty value for PasswordChar or the
          >UseSystemPassw ordChar property is true, and the textbox has focus, if
          >the Caps Lock key is pressed, a warning balloon tooltip is
          >automaticall y displayed by the system. I cannot even find
          >documentatio n that describes this behaviour.
          There isn't any, it's a courtesy of your friendly neighborhood common
          controls library. :-)
          >
          >My question is, is there anyway to temporarily turn that off in code?
          My question is, why on earth would you want to? It's saved my bacon a few
          times. That said...
          >
          My company uses a third part software packe that our software
          integrates with. The third part software has two methods of security,
          one uses Active Directory, where the password is defiitely case
          sensitive. But the password for the builtin security is not case
          sensitive. That is why I would like to be able to turn it off, if the
          database is configured to use the third party software security, there
          is no need to warn the user that the Caps Lock key is on.
          >
          It can't hurt to warn, though, and it's very good for users to get
          accustomed to the rule "passwords are case sensitive", since in most systems
          they are (and in those were they aren't, they ought to be, but let's ignore
          the issue of password strength for now). Unless users (or pointy-haired
          bosses) actually complain that they're confused by the message, I wouldn't
          go to the trouble of disabling it. Especially since the way to disable itis
          a bit dubious (turning off balloon tips works, but it has the obvious
          drawback of, well, turning off balloon tips, which can be used for more
          purposes than caps lock warnings).
          >
          Thanks for your comment. In fact, after I mentioned this to my "pointy
          head boss", that was exactly what he said to me.

          No, he not really "pointed headed". :-)

          Comment

          Working...