Exemplo n.º 1
0
BOOL UpdateLoop
  (
  HWND  hwnd
  )

  {
  Loop*   pLoop   = (Loop*)GetWindowLong(hwnd, DWL_USER);
  BOOL    fRet    = FALSE;

  if(pLoop)
    {
    char      szBuffer[256];
    WPARAM    index;
    OBJECTID  oi;
    
    GetDlgItemText(hwnd, ED_START, szBuffer, 256);
    fRet = pLoop->SetStartValue(strtol(szBuffer, NULL, 0));

    GetDlgItemText(hwnd, ED_LENGTH, szBuffer, 256);
    fRet = pLoop->SetLength(strtol(szBuffer, NULL, 0)) | fRet;

    fRet = pLoop->SetMultiTask(IsDlgButtonChecked(hwnd, RB_MULTITASK)) | fRet;

    index = (WPARAM)SendDlgItemMessage(hwnd, CB_CONNECT, CB_GETCURSEL, 0, 0L);
    if(index==(WPARAM)CB_ERR)
      fRet = pLoop->SetConnectionObject(NULL) | fRet;
    else
      {
      oi = (OBJECTID)SendDlgItemMessage(hwnd, CB_CONNECT, CB_GETITEMDATA, index, 0L);
      fRet = pLoop->SetConnectionObject((oi == (OBJECTID)CB_ERR) ? NULL : oi) | fRet;
      }
    }
    
  return fRet;
  }