Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : MyCtrls.cpp //
  3. // //
  4. // DESCRIPTION : Expand the imlementation of AtlCtrls.h //
  5. // //
  6. // AUTHOR : yossg //
  7. // //
  8. // HISTORY : //
  9. // Nov 25 1999 yossg Init. //
  10. // //
  11. // Copyright (C) 1999 Microsoft Corporation All Rights Reserved //
  12. /////////////////////////////////////////////////////////////////////////////
  13. #include "StdAfx.h"
  14. #include "MyCtrls.h"
  15. #ifdef _DEBUG
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /*
  20. - CMyUpDownCtrls::OnInitDialog
  21. -
  22. * Purpose:
  23. * Call SetPos with range verification.
  24. *
  25. * Arguments:
  26. *
  27. * Return:
  28. * int
  29. */
  30. int CMyUpDownCtrl::SetPos(int nPos)
  31. {
  32. int iMin;
  33. int iMax;
  34. ATLASSERT(::IsWindow(m_hWnd));
  35. GetRange32(iMin, iMax);
  36. if (nPos > iMax)
  37. {
  38. nPos = iMax;
  39. }
  40. else if (nPos < iMin)
  41. {
  42. nPos = iMin;
  43. }
  44. return (CUpDownCtrl::SetPos(nPos));
  45. }