PlanetSquires Forums

Support Forums => José Roca Software => Topic started by: James Fuller on June 24, 2016, 10:17:48 AM

Title: Dlg rc 2 CWindow
Post by: James Fuller on June 24, 2016, 10:17:48 AM
Jose,
  I am exploring a 64bit static build of pcre.
I am parsing a Dialog resource (.rc) script that I want to convert to CWindow. What would be the best approach to convert the Dialog Units to pixels?

James
Title: Re: Dlg rc 2 CWindow
Post by: José Roca on June 24, 2016, 11:58:43 AM
You have to use the MapDialogRect function: https://msdn.microsoft.com/en-us/library/ms645502(v=VS.85).aspx

But you need first to create a dialog that uses the wanted font to pass its handle to the function, because it needs to know the font size in order to perform the conversion.

There is also the function GetDialogBaseUnits: https://msdn.microsoft.com/en-us/library/ms645475

But it uses the system font, and nobody uses the system font any more. Well, perhaps one or two old farts, but nobody else.

And this article in Microsoft Knowledge Base:
https://support.microsoft.com/es-es/kb/125681
Title: Re: Dlg rc 2 CWindow
Post by: James Fuller on June 24, 2016, 02:15:09 PM
Thanks Jose that jogged my memory a bit so I went-a-code-searchin' ; and surprise! surprise! I found Fb code from 2007 that implemented my runtime dialogs converted from my original Pb version (pre DDT). Made a few alterations for 64bit and away we go!!

James