[Lazarus] GetTextExtent on Windows

Marc Weustink marc at dommelstein.nl
Mon Sep 14 22:05:58 CEST 2015



On September 14, 2015 6:16:19 PM GMT+02:00, "Jürgen Hestermann" <juergen.hestermann at gmx.de> wrote:
>Am 2015-09-13 um 22:09 schrieb Marc Weustink:
>>
>> On September 12, 2015 2:12:32 PM GMT+02:00, "Jürgen Hestermann"
><juergen.hestermann at gmx.de> wrote:
>>> I think many of my problems come from using this deprecated API
>>> function.
>>> Are there any plans to change this?
>> If you had a look at the win32 implementation of GetTextExtentPoint
>then you would have seen that GetTextExtentPoint32 is used internally.
>>
>Realy?
>Where do you find this?
>I only find the opposite.
>When I follow where Canvas.TextWidth comes from
>I end up on in this function from "canvas.inc" (line 1763):
>
>function TCanvas.TextExtent(const Text: string): TSize;
>begin
>Result.cX := 0;
>Result.cY := 0;
>if Text='' then exit;
>RequiredState([csHandleValid, csFontValid]);
>GetTextExtentPoint(FHandle, PChar(Text), Length(Text), Result);
>end;

If you set a breakpoint and start stepping, you will see that you end up in TWin32WidgetSet. The codetools cannot jump to the real widgetset.

Marc







More information about the Lazarus mailing list