function MemoWndProc(hEdit: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
stdcall;
var
rc: TRect;
OldFont: HFONT;
S:
string;
DC: HDC;
PaintStruct: TPaintStruct;
begin
case uMsg
of
WM_PAINT:
begin;
DC := BeginPaint(hEdit, PaintStruct);
GetClientRect(hEdit, rc);
SetBkMode(
DC, TRANSPARENT);
OldFont := SelectObject(
DC, hAppFont);
if (Length(GetText(hEdit)) < 1)
and (GetFocus <> hEdit)
then begin;
case GetDlgCtrlID(hEdit)
of
IDC_MEMO1: S := szKBText;
IDC_MEMO2: S := szReccFarmsText;
end;
SetTextColor(
DC, GetSysColor(COLOR_GRAYTEXT));
DrawText(
DC, PChar(S), Length(S), rc, DT_CENTER
or DT_VCENTER
or DT_NOPREFIX
or DT_WORDBREAK);
end;
SelectObject(
DC, OldFont);
ReleaseDC(hEdit,
DC);
DeleteObject(OldFont);
EndPaint(hEdit, PaintStruct);
Result := 0;
end
else
Result := CallWindowProc(OldWndProc, hEdit, uMsg, wParam, lParam);
end;
end;