Source code of Windows XP (NT5)
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.

182 lines
5.7 KiB

  1. // NT UPS Applet
  2. #define IDD_UPS_EXISTS 1000
  3. #define IDD_UPS_PORTCB 1001
  4. #define IDD_UPS_PFSIGNAL 1002
  5. #define IDD_UPS_BATTERYLIFE 1003
  6. #define IDD_UPS_BLTEXT1 1004
  7. #define IDD_UPS_BLTEXT2 1005
  8. #define IDD_UPS_RECHARGEPERMINUTE 1006
  9. #define IDD_UPS_RPMTEXT1 1007
  10. #define IDD_UPS_RPMTEXT2 1008
  11. #define IDD_UPS_LOWBATTERY 1009
  12. #define IDD_UPS_TURNOFF 1010
  13. #define IDD_UPS_FIRSTWARNING 1012
  14. #define IDD_UPS_WARNINGINTERVAL 1013
  15. #define IDD_UPS_PFSIGNALHIGH 1014
  16. #define IDD_UPS_PFSIGNALLOW 1015
  17. #define IDD_UPS_LOWBATTERYHIGH 1016
  18. #define IDD_UPS_LOWBATTERYLOW 1017
  19. #define IDD_UPS_TURNOFFHIGH 1018
  20. #define IDD_UPS_TURNOFFLOW 1019
  21. #define IDD_UPS_TEXT 1020
  22. #define IDD_UPS_SIGN 1021
  23. #define IDD_UPS_FWTEXT1 1022
  24. #define IDD_UPS_FWTEXT2 1023
  25. #define IDD_UPS_WITEXT1 1024
  26. #define IDD_UPS_WITEXT2 1025
  27. #define IDD_UPS_UPSGROUP 1026
  28. #define IDD_UPS_BLEDIT 1027
  29. #define IDD_UPS_RPMEDIT 1028
  30. #define IDD_UPS_FWEDIT 1029
  31. #define IDD_UPS_WIEDIT 1030
  32. #define IDD_UPS_CHARACTER 1031
  33. #define IDD_UPS_SERVICE 1032
  34. #define IDD_UPS_STATUS_TITLE 1033
  35. #define IDD_UPS_STATUS 1034
  36. #define IDD_UPS_BLANKGROUP 1035
  37. #define IDD_UPS_COMMANDFILE 1036
  38. #define IDD_UPS_FILETEXT 1037
  39. #define IDD_UPS_FILENAME 1038
  40. #define UPS_INSTALLED 0x00000001
  41. #define UPS_POWERFAILSIGNAL 0x00000002
  42. #define UPS_LOWBATTERYSIGNAL 0x00000004
  43. #define UPS_CANTURNOFF 0x00000008
  44. #define UPS_POWERFAIL_LOW 0x00000010
  45. #define UPS_LOWBATTERY_LOW 0x00000020
  46. #define UPS_TURNOFF_LOW 0x00000040
  47. #define UPS_COMMANDFILE 0X00000080
  48. #define UPSICON 100
  49. #define CHILD_UPS 100
  50. #define IDH_CHILD_UPS (IDH_HELPFIRST + 200)
  51. #define DLG_UPS 100
  52. #define DEFAULTBATTERYLIFE 2
  53. #define DEFAULTRECHARGEPERMINUTE 100
  54. #define DEFAULTFIRSTWARNING 5
  55. #define DEFAULTWARNINGINTERVAL 120
  56. #define UPS_STATUS_ERROR 31
  57. #define UPS_OPTIONS_ERROR 32
  58. #define UPS_ACCESS_ERROR 33
  59. #define UPS_REGISTRY_ERROR 34
  60. #define UPS_SERVICE_ERROR 35
  61. #define UPS_START_MSG 36
  62. #define UPS_FW_WARNING 37
  63. #define UPS_DELAY_WARNING 38
  64. #define UPS_RESTART_MSG 39
  65. #define UPS_STOP_MSG 40
  66. #define UPS_FWRange 41
  67. #define UPS_WIRange 42
  68. #define UPS_BLRange 43
  69. #define UPS_RPMRange 44
  70. #define UPS_PENDING_MSG 45
  71. #define UPS_STARTFAIL_MSG 46
  72. #define UPS_STOPFAIL_MSG 47
  73. #define UPS_UNKNOWNSTATE_MSG 49
  74. #define UPS_INVALID_PATH 50
  75. #define UPS_INVALID_FILENAME 51
  76. #define UPS_FILE_NOT_EXIST 52
  77. #define UPS_CANT_FIND_SYSDIR 53
  78. #define SERVICE_ACCESS_DENIED 0
  79. /* INCLUDE FILES */
  80. #include <windows.h>
  81. /* DEFINATION FILES */
  82. #define IDH_HELPFIRST 5000
  83. #define LSFAIL 10
  84. #define CPCAPTION 11
  85. #define ERRMEM 12
  86. #define _STOPPED 20
  87. #define _START_PENDING 21
  88. #define _STOP_PENDING 22
  89. #define _RUNNING 23
  90. #define _CONTINUE_PENDING 24
  91. #define _PAUSE_PENDING 25
  92. #define _PAUSED 26
  93. #define _UNKNOWN 27
  94. #define CHILDREN 48
  95. #define INFO 600
  96. #define IDD_HELP 119
  97. #define MAX_LDF_SEP 4
  98. #define MENU_INDHELP 40
  99. /* CONSTANT USED BY UPS.C */
  100. #define KEYBZ 4096
  101. #define SHORTBZ 16
  102. #define MIDBZ 256
  103. #define LONGBZ 1024
  104. #define MASK 0x0E
  105. typedef struct tagLDF {
  106. WORD Leadin;
  107. char LeadinSep[MAX_LDF_SEP];
  108. WORD Order[3];
  109. char Sep[2][MAX_LDF_SEP];
  110. } LDF;
  111. typedef LDF NEAR *PLDF;
  112. #define PATHMAX 158 /* path length max - used for Get...Directory() calls */
  113. #define PORTLEN 128 /* COM port string lenght.
  114. #define DESCMAX 129 /* max description in newexe header */
  115. #define MODNAMEMAX 20 /* max module name in newexe header */
  116. extern HANDLE hModule;
  117. extern char szErrMem[133];
  118. extern char szErrLS[133];
  119. extern char szCtlPanel[30];
  120. extern UINT wHelpMessage; // stuff for help
  121. #ifndef NOARROWS
  122. typedef struct
  123. {
  124. short lineup; /* lineup/down, pageup/down are relative */
  125. short linedown; /* changes. top/bottom and the thumb */
  126. short pageup; /* elements are absolute locations, with */
  127. short pagedown; /* top & bottom used as limits. */
  128. short top;
  129. short bottom;
  130. short thumbpos;
  131. short thumbtrack;
  132. BYTE flags; /* flags set on return */
  133. } ARROWVSCROLL;
  134. typedef ARROWVSCROLL NEAR *NPARROWVSCROLL;
  135. typedef ARROWVSCROLL FAR *LPARROWVSCROLL;
  136. #define UNKNOWNCOMMAND 1
  137. #define OVERFLOW 2
  138. #define UNDERFLOW 4
  139. #endif
  140. /* const used by ups.c */
  141. #define MAXTRIES 3
  142. #define SLEEP_TIME 2500L
  143. typedef int (*PFNGETNAME)(LPSTR pszName, LPSTR pszInf);
  144. /* FUNCTION PROTOTYPES */
  145. /* ups.c */
  146. void HourGlass(BOOL bOn);
  147. /* memutil.c */
  148. void ErrLoadString (HWND hParent);
  149. int MyMessageBox (HWND hWnd, DWORD wText, DWORD wCaption, DWORD wType, ...);
  150. LPVOID AllocMem (DWORD cb);
  151. BOOL FreeMem (LPVOID pMem, DWORD cb);
  152. LPSTR AllocStr (LPSTR lpStr);
  153. BOOL FreeStr (LPSTR lpStr);
  154. BOOL ReallocStr (LPSTR *plpStr, LPSTR lpStr);
  155. /* arrow.c */
  156. short ArrowVScrollProc (short wScroll, short nCurrent, LPARROWVSCROLL lpAVS);
  157. BOOL OddArrowWindow (HWND);
  158. VOID UnRegisterArrowClass (HANDLE hModule);
  159. /* cpl.c */
  160. extern void CPHelp (HWND hwnd);