2.2.6.32.9 Window::GetClientRect

Description

Syntax

void GetClientRect( RECT * lpRect )

Parameters

lpRect
[output] Points to a RECT structure that will receive the coordinates of the upper-left and lower-right corners of the client area.

Return

Examples

EX1

//Please make sure you have a worksheet window exist when you run the example
int Window_GetClientRect_ex1()
{
    WorksheetPage testWks = Project.WorksheetPages(0);
    Window testWin = testWks.GetWindow();
    testWin.ShowWindow(SW_NORMAL);
    
    RECT rect;
    testWin.GetClientRect(&rect);
    printf("upper-left position to client area, x:%d, y:%d\n", rect.left, rect.top);
    printf("lower-right position to client area: x:%d, y:%d\n", rect.right, rect.bottom);
    return 1;
  }

Remark

Copies the client coordinates of the Window client area into the structure pointed to by lpRect.

The client coordinates specify the upper-left and lower-right corners of the client area. Since

client coordinates are relative to the upper-left corners of the CWnd client area, the

coordinates of the upper-left corner are (0,0).

See Also

Header to Include

origin.h