{
intnIndex;
HWND hChildWnd;
/* Get handle to time format control */
hChildWnd = GetDlgItem(hwndDlg, dwIdc);
/* Get index to selected time format */
nIndex = SendMessage(hChildWnd, CB_GETCURSEL, 0, 0);
if (nIndex == CB_ERR)
/* No selection? Get content of the edit control */SendMessage(hChildWnd, WM_GETTEXT, uSize, (LPARAM)Buffer);
else {
LPTSTR tmp;
UINT uReqSize;
/* Get requested size, including the null terminator; * it shouldn't be required because the previous CB_LIMITTEXT, * but it would be better to check it anyways */
uReqSize = SendMessage(hChildWnd, CB_GETLBTEXTLEN, (WPARAM)nIndex, 0) + 1;
/* Allocate enough space to be more safe */
tmp = (LPTSTR)_alloca(uReqSize*sizeof(TCHAR));
/* Get selected time format text */SendMessage(hChildWnd, CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)tmp);
/* Finally, copy the result into the output */_tcsncpy(Buffer, tmp, uSize);
}
}
Generated on Sun May 27 2012 04:46:06 for ReactOS by
1.7.6.1
ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.