Richard & Marc,
I will figure out your suggestions.
Although I used Forth for some time (not as a Pro), the use of the
Windows API is new and complicated for me. I discoverd that in
this labyrinth one is tended to even more complicated solutions.
For the moment I would like to confine myself to simple solutions.
SetDlgItemText will do, when you work with the same (fixed) font.
I guess that checking out the Dialog Size or Control Size in relation
to the used font is one of these fancy programming elements that I
will postpone.
But of course if one of you has experience with this problem and
wants to share this knowledge ........
Cees
On 3 Apr 2002 at 16:47, marc_hawley wrote:
>
> Cees:
>
> I'm not sure if this is what you are looking for, but you can get the
> size of a text string with this API function:
>
> BOOL GetTextExtentPoint(
>
> HDC hdc, // handle of device context
> LPCTSTR lpString, // address of text string
> int cbString, // number of characters in string
> LPSIZE lpSize // address of structure for string size
> );
>
> There is a similar function called GetTextExtentPoint32. These
> functions put the size info into a SIZE structure:
>
> The SIZE structure specifies the width and height of a rectangle.
>
> typedef struct tagSIZE { // siz
> LONG cx;
> LONG cy;
> } SIZE;
>
> Members
> cx
> Specifies the rectangle's width.
>
> cy
> Specifies the rectangle's height.
>
> I have not tried it, but I assume you could then use this info to set
> the size of the control in your dialog.
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Thu Apr 04 2002 - 02:48:24 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 09-Feb-2012. Archive updated nightly.