What are the units for Dialog MFC Resource Measurements

牧云@^-^@ 提交于 2019-12-25 18:14:09

问题


In this declaration syntax from https://msdn.microsoft.com/en-us/library/windows/desktop/aa381003(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:


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 GetDialogBaseUnits function. As per xMRi's suggestion, for a non system font use this technique.



来源:https://stackoverflow.com/questions/45297886/what-are-the-units-for-dialog-mfc-resource-measurements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!