⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apmhelp.txt

📁 封装了电源管理的控件
💻 TXT
字号:
Advanced Power Management (APM) Component 1.0 by Jerry Ryle

This component will intercept the APM messages received by its
parent on run-time. It encapsulates the APM API and allows the
programmer to write APM event handlers easily. The
OnOverrideableSuspendQuery event even allows you to block a
suspend request from the system. 

This is of course, absolutely free; however, I will take no
responsiblity for any damage.  If you find this component
incredibly useful, I'd be happy to accept donations. ;)
Enjoy, learn, & modify freely. Let me know of any major
improvements.

 --   gryle@calpoly.edu

----------------------------------------------------------------

-Functions: ----------------------------------------------------------------------------

    {When Force is TRUE, the system suspends even if programs/drivers
     do not wish to allow it}

 Function TAPM.Suspend(Force : Boolean) : Boolean;
    {Suspend the system using RAM-alive technique}

 Function TAPM.Hibernate(Force : Boolean) : Boolean;
    {Suspend the system using hibernate technique}

 Procedure TAPM.RefreshAPMStats;
    {Update the component's APM properties}


-Properties: ---------------------------------------------------------------------------

 ACPowerStatus : String 
    {This is a string representing the AC Power status. Values are:
     "OnLine, OffLine, Unknown" }

 ACPowerStatusFlag : Byte
    {Same as above; however in byte format for those of you who don't
     like strings.

     Value   Meaning
     0       Offline
     1       Online
     255     Unknown status.}

 BatteryChargeStatus : String;
    {Battery charge status. Values are: "High, Low, Critical, Charging, No Battery"}

 BatteryChargeStatusFlag : Byte;
    {Same as above; however in byte format. Values can be "OR"ed combinations of:

     Value   Meaning
      1      High
      2      Low
      4      Critical
      8      Charging
      128    No system battery
      255    Unknown status}

 BatteryLifeFullTime : Cardinal;
   {Number of seconds of battery life when at full charge, or -1 if full lifetime is
    unknown.}

 BatteryLifePercent : Byte;
   {Percentage of full battery charge remaining. This member can be a value in the
    range 0 to 100, or 255 if status is unknown.}

 BatteryLifeTime : Cardinal;
   {Number of seconds of battery life remaining, or -1 if remaining seconds are unknown.}

 Enabled: Boolean;
   {Set this to false to disable all events. The sleep and refresh functions still work
    however.}

-Events: --------------------------------------------------------------------------------
 OnBatteryLow(Sender: TObject)
   {Event occurs when the battery becomes low as determined by the APM driver}

 OnOEMEvent(Sender: TObject; EventCode : Integer)
   {Event occurs when when an APM BIOS signals an APM OEM event.
    EventCode is an OEM-defined event code that was signaled by the
    system's APM BIOS. OEM event codes are in the range 0200h - 02FFh.}

 OnSuspend(Sender: TObject)
   {Event occurs immediately before the computer is suspended.}

 OnSuspendQuery(Sender: TObject)
   {Event occurs when a non-blockable suspend is requested}

 OnOverrideableSuspendQuery(Sender: TObject; var CanSuspend : Boolean)
   {Event occurs when a blockable suspend is requested. Setting CanSuspend to
    FALSE will not allow the system to suspend}

 OnSuspendDenied(Sender: TObject)
   {Event occurs when permission to suspend the computer was denied}

 OnResumeAfterCritical(Sender: TObject)
   {Event occurs when the system has resumed operation after a critical suspension
    caused by a failing battery}

 OnResumeAfterSuspend(Sender: TObject)
   {Event occurs when the system has resumed operation after being suspended}

 OnPowerStatusChange(Sender: TObject)
   {Event occurs when a change in the power status of the computer is detected,
    such as a switch from battery power to A/C or a drop in remaining battery 
    power below a threshold}

-----------------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -