GetDlgItemText
The GetDlgItemText function retrieves the title or text associated with a control in a dialog box.
UINT GetDlgItemText(
HWND hDlg, // handle of dialog box
int nIDDlgItem, // identifier of control
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum size of string
);
Parameters
hDlg
Identifies the dialog box that contains the control.
nIDDlgItem
Specifies the identifier of the control whose title or text is to be retrieved.
lpString
Pointer to the buffer to receive the title or text.
nMaxCount
Specifies the maximum length, in characters, of the string to be copied to the buffer pointed to by lpString. If the length of the string exceeds the limit, the string is truncated.
Since you are telling the function that the maximum length of string to be copied to pszString is the sizeof(pszString), which is four, you are likely getting close to what you are asking for. As the old saying goes, "Computers do what we tell them to do, not what we want". And by the way, I answered that MSFlexGrid questiion you posed last summer. I posted a C++ SDK example of using the MSFlexGrid for you. Do a search for MSFlexGrid and you'll likely find it.