//-------------------------------------------------------------------
// ECLWinMetrics::SetWindowRect
//
// 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. Also move the window.
//-------------------------------------------------------------------
void Sample89() {
ECLWinMetrics *Metrics; // Ptr to object
long X, Y, Width, Height;
try {
Metrics = new ECLWinMetrics('A'); // Create for connection A
if (Metrics->IsMinimized() || Metrics->IsMaximized()) {
printf("Cannot size/move minimized or maximized window.\n");
}
else {
Metrics->GetWindowRect(&X, &Y, &Width, &Height);
Metrics->SetWindowRect(X+10, Y+10, // Move window
Width/2, Height/2); // Size window
}
delete Metrics;
}
catch (ECLErr Err) {
printf("ECL Error: %s\n", Err.GetMsgText());
}
} // end sample