Microsoft KB Archive/316306

= PRB: Password Edit Control Displays Incorrect Character =

Article ID: 316306

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Win32 Application Programming Interface, when used with:
 * Microsoft Windows XP Professional

-



This article was previously published under Q316306



SYMPTOMS
When the Win32 application that creates edit controls supports Microsoft Windows XP visual styles, the edit controls that use the ES_PASSWORD style may display an incorrect password character.



CAUSE
The edit control Comctl32.dll, version 6, uses a round, black character from the Tahoma font as the password character. This character may not be defined in other fonts.



RESOLUTION
To resolve this problem, use one of the following methods:
 * Use the Tahoma font in edit controls in Comctl32.dll version 6 when you use the ES_PASSWORD style.
 * Send an EM_SETPASSWORDCHAR message to the edit control to specify a different password character in the control.



MORE INFORMATION
When you create the Comctl32.dll edit control with the ES_PASSWORD style, the default font is Tahoma.

Some dialog editors, such as the editor that is included with Microsoft Visual C++ 6.0, use MS Sans Serif as the default font for new dialog box templates. In an application that uses Comctl32.dll, version 6 throughout this article, the password character appears as a vertical bar in the edit control where the black circle character is expected.

Although edit controls in Comctl32.dll with the ES_PASSWORD style use the Tahoma font by default, the system sends a WM_SETFONT message to the edit control that uses the font that is specified in the dialog box template when the dialog box is created.

When you set the dialog box font to MS Shell Dlg, and if you use the DS_SHELLFONT style, the dialog box uses the system font. On Microsoft Windows XP, the default system font is Tahoma.

