The MASM Forum

General => The Campus => Topic started by: Mikl__ on June 04, 2017, 10:06:15 PM

Title: Incorrect window size of the resources transmitted through the section
Post by: Mikl__ on June 04, 2017, 10:06:15 PM
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
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: aw27 on June 04, 2017, 10:23:01 PM
How do you know that the template used for the dialog is 400x100 pixels? Sizes of dialog templates are not in pixels.
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: 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
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: aw27 on June 04, 2017, 10:48:10 PM
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.
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: 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)
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: aw27 on June 04, 2017, 11:25:08 PM
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:
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: Mikl__ on June 04, 2017, 11:46:10 PM
aw27,
I do not understand English well and did not understand the joke about my uncle...
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: aw27 on June 04, 2017, 11:54:13 PM
Not really your uncle, search in google for "Everybody and his uncle", don't forget the double quotes. :bgrin:
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: 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.
Title: Re: Incorrect window size of the resources transmitted through the section
Post by: aw27 on June 05, 2017, 12:34:11 AM
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: