//-------------------------------------------------------------------
// ECLWinMetrics::GetWidth
//
// Make window 1/2 its current size. Depending on display settings
// (Appearance->Display Setup menu) it may snap to a font that is
// not exactly the 1/2 size we specify.
//-------------------------------------------------------------------
void Sample85() {
ECLWinMetrics *Metrics; // Ptr to object
long X, Y;
try {
Metrics = new ECLWinMetrics('A'); // Create for connection A
if (Metrics->IsMinimized() || Metrics->IsMaximized()) {
printf("Cannot size minimized or maximized window.\n");
}
else {
X = Metrics->GetWidth();
Y = Metrics->GetHeight();
Metrics->SetWidth(X/2);
Metrics->SetHeight(Y/2);
}
delete Metrics;
}
catch (ECLErr Err) {
printf("ECL Error: %s\n", Err.GetMsgText());
}
} // end sample