Ask Your Question

Revision history [back]

Here is my code (winapi) - it works:

case WM_HSCROLL: switch (LOWORD(wParam)) {

  case TB_ENDTRACK:           {
          if ((HWND)lParam==hSliBright){

              char buf[100] = "Brightness: ";
              char tmp[10];
              dwPos = SendMessage(hSliBright, TBM_GETPOS, 0, 0);
              strncat(buf,_itoa(dwPos,tmp,10),strlen(buf));
              SetWindowText( hLabBright, buf);
              cam->capture.set(CV_CAP_PROP_BRIGHTNESS,dwPos);
              /*if (dwPos > 100) 
              SendMessage(hSliBright, TBM_SETPOS, 
              (WPARAM) TRUE,       // redraw flag 
              (LPARAM) 100); 

              else if (dwPos < 0) 
              SendMessage(hSliBright, TBM_SETPOS, 
              (WPARAM) TRUE,       // redraw flag 
              (LPARAM) 0); */
              buf[0];
              tmp[0];
              break; 
          }
          if ((HWND)lParam==hSliContrast)
          {
              char buf[100] = "Contrast: ";
              char tmp[10];
              dwPos = SendMessage(hSliContrast, TBM_GETPOS, 0, 0);
              strncat(buf,_itoa(dwPos,tmp,10),strlen(buf));
              SetWindowText( hLabContrast, buf);
              cam->capture.set(CV_CAP_PROP_CONTRAST,dwPos);
              buf[0];
              tmp[0];
              break; 
          }           }       default: 

      break;          }       break;