BOOL GetClientRect( HWND hWnd, // handle to window LPRECT lpRect // client coordinates ); Parameters hWnd [in] Handle to the window whose client coordinates are to be retrieved. lpRect [out] Pointer to a RECT structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.
你可以在WM_SIZE消息中得到, case WM_SIZE: cxClient=LOWORD(lParam); cyClient=HIWORD(lParam); 这样任何时候都可以得到客户区尺寸了
HWND hWnd, // handle to window
LPRECT lpRect // client coordinates
);
Parameters
hWnd
[in] Handle to the window whose client coordinates are to be retrieved.
lpRect
[out] Pointer to a RECT structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.
case WM_SIZE:
cxClient=LOWORD(lParam);
cyClient=HIWORD(lParam);
这样任何时候都可以得到客户区尺寸了