Scale for dimensions in .rc file vs CreateWindow

Oct 1, 2021 at 1:53am
A few years ago I wrote a C++ program with the help of Virtual Studio and some books. The program works OK, but one of my frustrating problems was the apparent difference in scale between the dimensions used in the .rc file and those used as arguments to the CreateWindow function. Is there some way to know how long 100 units (for example) is in each case? Pixels, inches, other?
Oct 1, 2021 at 10:08am
If I remember correctly the units used in the .rc file are dialog base units. They are the average width and height of characters in the system font.

CreateWindow uses device units, so pixels for a screen.


Oct 3, 2021 at 8:34pm
And "dialog base units" are ...? Fractional parts of a character's width and height? If so, what fraction? If not, what?

Is there any relation between pixels and dialog base units? Or inches? Or character width/height?

Oct 3, 2021 at 9:02pm
Is there any relation between pixels and dialog base units?..

This might help, GetDialogBaseUnits function.
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdialogbaseunits
Topic archived. No new replies allowed.