What are the units for Dialog MFC Resource Measurements

In this declaration syntax from (v=vs.85).aspx

nameID DIALOG x, y, width, height [optional-statements] {control-statement . . . }

what are the units used for width and height?

I assumed that they were pixels, and so set my window to 640x480. However, I now have a window that is too big for my needs.

1 Answer

The units are dialog units as explained in the DIALOGEX resource definition statement. The DIALOG is deprecated. Excerpt:

x
Location on the screen of the left side of the dialog box, in dialog units.

y
Location on the screen of the top of the dialog box, in dialog units.

To retrieve the dialog based units use the GetDialogBaseUnitsfunction. As per xMRi's suggestion, for a non system font use this technique.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like