SendMessage problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I developed a dialng_based application:
code as following:
/////////////////CODE
void CxxxDlg::OnButton1()
{
CRect rect;
GetClientRect(&rect);
WORD wx = rect.right;
WORD wy = rect.bottom;
SendMessage(WM_SIZE, MAKEWPARAM(wx, wy));
}

void CxxxDlg::OnSize(UINT nType, int cx, int cy)
{
char lpsz[300];
ZeroMemory(&lpsz, sizeof(lpsz));
::sprintf(lpsz, "cx = %d, cy = %d", cx, cy);
MessageBox(lpsz , "dd" ) ;
CDialog::OnSize(nType, cx, cy);

// TODO: Add your message handler code here

}
/////////////////CODE END
but I cannot receive the correct value in the OnSize
function. why?
.


Quantcast