Win32(no offence intended to ZMan's fine mfc example):
Use GetDlgItemInt to return the numerical contents of an edit control (make sure the control has ES_NUMBER style to avoid confusion).
If you want to get the contents as a string then use GetDlgItemText.
eg.
Code:
BOOL bSuccess;
BOOL bSigned=FALSE; //TRUE if you want signed int only returned
int nNumericContents=GetDlgItemInt(hDlg,IDC_NUM_EDIT,&bSuccess,bSigned);
or, using GetDlgItemText:
Code:
TCHAR chBuffer[20];
int nNumCharsCopied=GetDlgItemText(hDlg,IDC_NUM_EDIT,chBuffer,20);
Where, in both cases, hDlg is the handle of the parent wnd, IDC_NUM_EDIT is the id for the edit cntrl. The return value from GetDlgItemText is shown for demo purposes only; you can use it if you wish.
Hope that helps.