winapicontrolscreatewindow

Win32 Default Height of Edit Control


I'm using CreateWindowEx to create an Edit control (a textbox), but saying CW_DEFAULT doesn't help with getting the default height of the textbox -- it just makes a window with a height of zero.

How do I get the system-default size of a textbox, so I can turn Edit control into a normal-looking textbox?


Solution

  • The recommended size is 14 dialog units. Here is the reference

    You can use MapDialogRect to convert dialog units into pixels.