Ver Mensaje Individual
  #2  
Antiguo 20-02-2026
Avatar de Angel.Matilla
Angel.Matilla Angel.Matilla is offline
Miembro
 
Registrado: ene 2007
Ubicación: Toledo - España
Posts: 1.418
Reputación: 21
Angel.Matilla Va por buen camino
Me respondo a mi mismo. Había escrito mal una de las líneas. Quedaría así:
Código:
int BorderWidth;
TRegistry *rRegistro = new TRegistry();

rRegistro->RootKey = HKEY_CURRENT_USER;
if (rRegistro->OpenKeyReadOnly("Control Panel\\Desktop\\WindowMetrics"))
     BorderWidth = MulDiv(-StrToFloat(rRegistro->ReadString("PaddedBorderWidth")), Screen->PixelsPerInch, 1440);

// Calculamos la altura exacta de una línea
SIZE size;
HDC hdc = GetDC(Lista->Handle);
SelectObject(hdc, Lista->Font->Handle);
GetTextExtentPoint32(hdc, "Mg", 2, &size);
ReleaseDC(Lista->Handle, hdc);

// Calculamos la altura del ListView para que muestre todas las líneas
Lista->Height = 2 * BorderWidth + size.cy * Lista->Items->Count;
Siendo Lista el TListView.
Responder Con Cita