Function

TfrmConsults.LinesVisible

Module

fConsults

Last Modified

7/15/2014 3:26:34 PM

Comments

CB

Visibility

Public

Owner

TfrmConsults

Declaration

function LinesVisible(richedit: Trichedit): integer; //CB

Called-By Hierarchy


          TfrmConsults.LinesVisible
TfrmConsults.ProcessNotifications┘ 
       TfrmConsults.DisplayPage┘   

Called-By

Name Declaration Comments
TfrmConsults.ProcessNotifications procedure ProcessNotifications; -


Source

3326  function TfrmConsults.LinesVisible(richedit: Trichedit): integer;
3327     Var
3328       OldFont : HFont;
3329       Hand : THandle;
3330       TM : TTextMetric;
3331       Rect  : TRect;
3332       tempint : integer;
3333     begin
3334       Hand := GetDC(richedit.Handle);
3335       try
3336         OldFont := SelectObject(Hand, richedit.Font.Handle);
3337         try
3338           GetTextMetrics(Hand, TM);
3339           richedit.Perform(EM_GETRECT, 0, longint(@Rect));
3340           tempint := (Rect.Bottom - Rect.Top) div
3341              (TM.tmHeight + TM.tmExternalLeading);
3342         finally
3343           SelectObject(Hand, OldFont);
3344         end;
3345       finally
3346         ReleaseDC(richedit.Handle, Hand);
3347       end;
3348       Result := tempint;
3349     end;