News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Incorrect window size of the resources transmitted through the section

Started by Mikl__, June 04, 2017, 10:06:15 PM

Previous topic - Next topic

Mikl__

Tell me why the size of the dialogue created through DialogBoxParam matchs the size of the window created through RegisterClassEx/CreateWindowEx?
The upper dialog has a size of 400x100, the lower window has a size of 800x200

aw27

How do you know that the template used for the dialog is 400x100 pixels? Sizes of dialog templates are not in pixels.

Mikl__

Hi, aw27!
If I correctly understood you - the size of the window is measured in pixels, then in what units is the size of the dialog measured?
https://support.microsoft.com/ru-ru/help/125681/how-to-calculate-dialog-base-units-with-non-system-based-font

aw27

Quote from: Mikl__ on June 04, 2017, 10:36:27 PM
Hi, aw27!
If I correctly understood you - the size of the window is measured in pixels, then in what units is the size of the dialog measured?
https://support.microsoft.com/ru-ru/help/125681/how-to-calculate-dialog-base-units-with-non-system-based-font
The size of the window is in screen coordinates while the dimensions you see on a resource template are based on the font. I don't remember details, but you will be able to find the info somewhere for sure.

Mikl__

horz pixels = 2 * horz dialog units * (average char width  of dialog font  / average char width of system font)
vert pixels = 2 * vert dialog units * (average char height of dialog font  / average char height of system font)

aw27

Quote from: Mikl__ on June 04, 2017, 11:03:42 PM
horz pixels = 2 * horz dialog units * (average char width  of dialog font  / average char width of system font)
vert pixels = 2 * vert dialog units * (average char height of dialog font  / average char height of system font)
Everybody and his uncle knew about that (except us).  :badgrin:

Mikl__

aw27,
I do not understand English well and did not understand the joke about my uncle...

aw27

Not really your uncle, search in google for "Everybody and his uncle", don't forget the double quotes. :bgrin:

hutch--

The OZ variation is "everyone and their dog knows that ....".  :P

You could translate that as "common knowledge" but the idiom has more emphasis.

aw27

Quote from: hutch-- on June 05, 2017, 12:16:31 AM
The OZ variation is "everyone and their dog knows that ....".  :P

You could translate that as "common knowledge" but the idiom has more emphasis.
According to dictionary.com
[1940s+; in earlier versions going back to the 1860s, his cousin or their mothers-in-law could replace uncle]
So, I believe we can replace dog with other pets as well.  :badgrin: