求解:为何在win32 SDK的框架下GetClientRect()总是返回0

求解:为什么在win32 SDK的框架下GetClientRect()总是返回0
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int  cxClient, cyClient ;
HDC         hdc ;
PAINTSTRUCT ps ;
LPRECT      lpRect=0;
long        length,width;
FILE        *in=fopen("f:\\in.txt","r"),*out=fopen("f:\\out.txt","w");
int         x0,y0,xend,yend;

switch (message)
{
case WM_SIZE:
cxClient = LOWORD (lParam) ;
cyClient = HIWORD (lParam) ;
return 0 ;

case WM_PAINT:
hdc = BeginPaint (hwnd, &ps) ;
/*获取文件*/

/*计算现有窗口的边界值*/
if(GetClientRect(hwnd,lpRect)){
length=lpRect->right-lpRect->left;
length/=2;
width=lpRect->bottom-lpRect->top;
width/=2;
}
else{ 
exit(1);
}

fscanf(in,"%d%d%d%d",&x0,&y0,&xend,&yend);
这是部分代码,包含了这个函数。
为什么会出现这种情况呢?小弟刚学win32,很多都不明白。

------解决方案--------------------
LPRECT      lpRect=0;
==> RECT rect;
GetClientRect(hwnd,lpRect)
===>
GetClientRect(hwnd,&rect)