ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static VOID GetSelectedComboEntry ( HWND  hwndDlg,
DWORD  dwIdc,
TCHAR Buffer,
UINT  uSize 
) [static]

Definition at line 52 of file time.c.

Referenced by TimePageProc().

{
    int nIndex;
    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 doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.