Scale for dimensions in .rc file vs CreateWindow

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?
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.


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?

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.