olectl.py 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. """Constants used by COM Controls
  2. Hand created version of OLECTL.H constants.
  3. """
  4. import winerror
  5. FACILITY_CONTROL = 0xa
  6. def MAKE_SCODE(sev, fac, code):
  7. return int((int(-sev)<<31) | ((fac)<<16) | ((code)))
  8. def STD_CTL_SCODE(n):
  9. return MAKE_SCODE(winerror.SEVERITY_ERROR, FACILITY_CONTROL, n)
  10. CTL_E_ILLEGALFUNCTIONCALL = STD_CTL_SCODE(5)
  11. CTL_E_OVERFLOW = STD_CTL_SCODE(6)
  12. CTL_E_OUTOFMEMORY = STD_CTL_SCODE(7)
  13. CTL_E_DIVISIONBYZERO = STD_CTL_SCODE(11)
  14. CTL_E_OUTOFSTRINGSPACE = STD_CTL_SCODE(14)
  15. CTL_E_OUTOFSTACKSPACE = STD_CTL_SCODE(28)
  16. CTL_E_BADFILENAMEORNUMBER = STD_CTL_SCODE(52)
  17. CTL_E_FILENOTFOUND = STD_CTL_SCODE(53)
  18. CTL_E_BADFILEMODE = STD_CTL_SCODE(54)
  19. CTL_E_FILEALREADYOPEN = STD_CTL_SCODE(55)
  20. CTL_E_DEVICEIOERROR = STD_CTL_SCODE(57)
  21. CTL_E_FILEALREADYEXISTS = STD_CTL_SCODE(58)
  22. CTL_E_BADRECORDLENGTH = STD_CTL_SCODE(59)
  23. CTL_E_DISKFULL = STD_CTL_SCODE(61)
  24. CTL_E_BADRECORDNUMBER = STD_CTL_SCODE(63)
  25. CTL_E_BADFILENAME = STD_CTL_SCODE(64)
  26. CTL_E_TOOMANYFILES = STD_CTL_SCODE(67)
  27. CTL_E_DEVICEUNAVAILABLE = STD_CTL_SCODE(68)
  28. CTL_E_PERMISSIONDENIED = STD_CTL_SCODE(70)
  29. CTL_E_DISKNOTREADY = STD_CTL_SCODE(71)
  30. CTL_E_PATHFILEACCESSERROR = STD_CTL_SCODE(75)
  31. CTL_E_PATHNOTFOUND = STD_CTL_SCODE(76)
  32. CTL_E_INVALIDPATTERNSTRING = STD_CTL_SCODE(93)
  33. CTL_E_INVALIDUSEOFNULL = STD_CTL_SCODE(94)
  34. CTL_E_INVALIDFILEFORMAT = STD_CTL_SCODE(321)
  35. CTL_E_INVALIDPROPERTYVALUE = STD_CTL_SCODE(380)
  36. CTL_E_INVALIDPROPERTYARRAYINDEX = STD_CTL_SCODE(381)
  37. CTL_E_SETNOTSUPPORTEDATRUNTIME = STD_CTL_SCODE(382)
  38. CTL_E_SETNOTSUPPORTED = STD_CTL_SCODE(383)
  39. CTL_E_NEEDPROPERTYARRAYINDEX = STD_CTL_SCODE(385)
  40. CTL_E_SETNOTPERMITTED = STD_CTL_SCODE(387)
  41. CTL_E_GETNOTSUPPORTEDATRUNTIME = STD_CTL_SCODE(393)
  42. CTL_E_GETNOTSUPPORTED = STD_CTL_SCODE(394)
  43. CTL_E_PROPERTYNOTFOUND = STD_CTL_SCODE(422)
  44. CTL_E_INVALIDCLIPBOARDFORMAT = STD_CTL_SCODE(460)
  45. CTL_E_INVALIDPICTURE = STD_CTL_SCODE(481)
  46. CTL_E_PRINTERERROR = STD_CTL_SCODE(482)
  47. CTL_E_CANTSAVEFILETOTEMP = STD_CTL_SCODE(735)
  48. CTL_E_SEARCHTEXTNOTFOUND = STD_CTL_SCODE(744)
  49. CTL_E_REPLACEMENTSTOOLONG = STD_CTL_SCODE(746)
  50. CONNECT_E_FIRST = MAKE_SCODE(winerror.SEVERITY_ERROR, winerror.FACILITY_ITF, 0x0200)
  51. CONNECT_E_LAST = MAKE_SCODE(winerror.SEVERITY_ERROR, winerror.FACILITY_ITF, 0x020F)
  52. CONNECT_S_FIRST = MAKE_SCODE(winerror.SEVERITY_SUCCESS, winerror.FACILITY_ITF, 0x0200)
  53. CONNECT_S_LAST = MAKE_SCODE(winerror.SEVERITY_SUCCESS, winerror.FACILITY_ITF, 0x020F)
  54. CONNECT_E_NOCONNECTION = CONNECT_E_FIRST+0
  55. CONNECT_E_ADVISELIMIT = CONNECT_E_FIRST+1
  56. CONNECT_E_CANNOTCONNECT = CONNECT_E_FIRST+2
  57. CONNECT_E_OVERRIDDEN = CONNECT_E_FIRST+3
  58. CLASS_E_NOTLICENSED = winerror.CLASSFACTORY_E_FIRST+2