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

📄 jvqcomputerinfoex.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 5 页
字号:
{******************************************************************************}
{* WARNING:  JEDI VCL To CLX Converter generated unit.                        *}
{*           Manual modifications will be lost on next release.               *}
{******************************************************************************}

{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.

The Original Code is: JvComputerInfoEx.PAS, released on 2004-03-07.

The Initial Developer of the Original Code is Peter Th鰎nqvist [peter3 at sourceforge dot net]
Portions created by Peter Th鰎nqvist are Copyright (C) 2004 Peter Th鰎nqvist.
All Rights Reserved.

Contributor(s):

You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net

Description
  A read-only computer info component. Subproperties are created as needed so loading
  at run-time should be pretty fast.

  This component replaces JvComputerInfo, JvKeyboardStates, JvDeviceChanged, JvDirectories
  and JvSystemColors.

Known Issues:
  * ADO version info might not be correct/available on all systems (depending on the ADO version installed)
  * ResetSystemIcons only tested on W2k

-----------------------------------------------------------------------------}
// $Id: JvQComputerInfoEx.pas,v 1.13 2004/08/28 18:57:27 asnepvangers Exp $

{$I jvcl.inc}
{$I windowsonly.inc}

unit JvQComputerInfoEx;

{$HPPEMIT '#pragma link "wininet.lib"'}

interface

uses
  Classes, SysUtils,  
  Qt, QControls, QGraphics,
  JvQComponent, 
  Windows, Messages, ShlObj,
  JclWin32, JclSysInfo,
  JvQJCLUtils, JvQJVCLUtils, JvQDataProvider, JvQTypes;

{$HPPEMIT '#include <dbt.h>'}
// these are defined here to avoid including DBT.pas
const
  {$EXTERNALSYM DBT_DEVICEARRIVAL}
  DBT_DEVICEARRIVAL = $8000; { system detected a new device }
  {$EXTERNALSYM DBT_DEVICEREMOVECOMPLETE}
  DBT_DEVICEREMOVECOMPLETE = $8004; { device is gone }
  {$EXTERNALSYM DBT_DEVTYP_VOLUME}
  DBT_DEVTYP_VOLUME = $00000002; { logical volume }
  {$EXTERNALSYM DBTF_MEDIA}
  DBTF_MEDIA = $0001; { media commings and goings }

  // new params for SystemParametersInfo not defined in Windows
  SPI_GETDESKWALLPAPER = $0073;
  {$EXTERNALSYM SPI_GETDESKWALLPAPER}
  SPI_GETMOUSESONAR = $101C;
  {$EXTERNALSYM SPI_GETMOUSESONAR}
  SPI_SETMOUSESONAR = $101D;
  {$EXTERNALSYM SPI_SETMOUSESONAR}
  SPI_GETMOUSECLICKLOCK = $101E;
  {$EXTERNALSYM SPI_GETMOUSECLICKLOCK}
  SPI_SETMOUSECLICKLOCK = $101F;
  {$EXTERNALSYM SPI_SETMOUSECLICKLOCK}
  SPI_GETMOUSEVANISH = $1020;
  {$EXTERNALSYM SPI_GETMOUSEVANISH}
  SPI_SETMOUSEVANISH = $1021;
  {$EXTERNALSYM SPI_SETMOUSEVANISH}
  SPI_GETFLATMENU = $1022;
  {$EXTERNALSYM SPI_GETFLATMENU}
  SPI_SETFLATMENU = $1023;
  {$EXTERNALSYM SPI_SETFLATMENU}
  SPI_GETDROPSHADOW = $1024;
  {$EXTERNALSYM SPI_GETDROPSHADOW}
  SPI_SETDROPSHADOW = $1025;
  {$EXTERNALSYM SPI_SETDROPSHADOW}

  SPI_GETFOREGROUNDLOCKTIMEOUT = $2000;
  {$EXTERNALSYM SPI_GETFOREGROUNDLOCKTIMEOUT}
  SPI_SETFOREGROUNDLOCKTIMEOUT = $2001;
  {$EXTERNALSYM SPI_SETFOREGROUNDLOCKTIMEOUT}
  SPI_GETACTIVEWNDTRKTIMEOUT = $2002;
  {$EXTERNALSYM SPI_GETACTIVEWNDTRKTIMEOUT}
  SPI_SETACTIVEWNDTRKTIMEOUT = $2003;
  {$EXTERNALSYM SPI_SETACTIVEWNDTRKTIMEOUT}
  SPI_GETFOREGROUNDFLASHCOUNT = $2004;
  {$EXTERNALSYM SPI_GETFOREGROUNDFLASHCOUNT}
  SPI_SETFOREGROUNDFLASHCOUNT = $2005;
  {$EXTERNALSYM SPI_SETFOREGROUNDFLASHCOUNT}
  SPI_GETCARETWIDTH = $2006;
  {$EXTERNALSYM SPI_GETCARETWIDTH}
  SPI_SETCARETWIDTH = $2007;
  {$EXTERNALSYM SPI_SETCARETWIDTH}

  SPI_GETMOUSECLICKLOCKTIME = $2008;
  {$EXTERNALSYM SPI_GETMOUSECLICKLOCKTIME}
  SPI_SETMOUSECLICKLOCKTIME = $2009;
  {$EXTERNALSYM SPI_SETMOUSECLICKLOCKTIME}
  SPI_GETFONTSMOOTHINGTYPE = $200A;
  {$EXTERNALSYM SPI_GETFONTSMOOTHINGTYPE}
  SPI_SETFONTSMOOTHINGTYPE = $200B;
  {$EXTERNALSYM SPI_SETFONTSMOOTHINGTYPE}

  { constants for SPI_GETFONTSMOOTHINGTYPE and SPI_SETFONTSMOOTHINGTYPE: }
  FE_FONTSMOOTHINGSTANDARD = $0001;
  {$EXTERNALSYM FE_FONTSMOOTHINGSTANDARD}
  FE_FONTSMOOTHINGCLEARTYPE = $0002;
  {$EXTERNALSYM FE_FONTSMOOTHINGCLEARTYPE}
  FE_FONTSMOOTHINGDOCKING = $8000;
  {$EXTERNALSYM FE_FONTSMOOTHINGDOCKING}

  SPI_GETFONTSMOOTHINGCONTRAST = $200C;
  {$EXTERNALSYM SPI_GETFONTSMOOTHINGCONTRAST}
  SPI_SETFONTSMOOTHINGCONTRAST = $200D;
  {$EXTERNALSYM SPI_SETFONTSMOOTHINGCONTRAST}

  SPI_GETFOCUSBORDERWIDTH = $200E;
  {$EXTERNALSYM SPI_GETFOCUSBORDERWIDTH}
  SPI_SETFOCUSBORDERWIDTH = $200F;
  {$EXTERNALSYM SPI_SETFOCUSBORDERWIDTH}
  SPI_GETFOCUSBORDERHEIGHT = $2010;
  {$EXTERNALSYM SPI_GETFOCUSBORDERHEIGHT}
  SPI_SETFOCUSBORDERHEIGHT = $2011;
  {$EXTERNALSYM SPI_SETFOCUSBORDERHEIGHT}
 

type
  EJVCLComputerInfoEx = class(EJVCLException);

  {$EXTERNALSYM PDevBroadcastHdr}
  PDevBroadcastHdr = ^TDevBroadcastHdr;
  {$EXTERNALSYM DEV_BROADCAST_HDR}
  DEV_BROADCAST_HDR = packed record
    dbch_size: DWORD;
    dbch_devicetype: DWORD;
    dbch_reserved: DWORD;
  end;
  TDevBroadcastHdr = DEV_BROADCAST_HDR;

  {$EXTERNALSYM PDevBroadcastVolume}
  PDevBroadcastVolume = ^TDevBroadcastVolume;
  {$EXTERNALSYM DEV_BROADCAST_VOLUME}
  DEV_BROADCAST_VOLUME = packed record
    dbcv_size: DWORD;
    dbcv_devicetype: DWORD;
    dbcv_reserved: DWORD;
    dbcv_unitmask: DWORD;
    dbcv_flags: Word;
  end;
  TDevBroadcastVolume = DEV_BROADCAST_VOLUME;

  TWMDeviceChange = record
    Msg: Cardinal;
    Event: UINT;
    dwData: Pointer;
    Result: LongInt;
  end;

  // TJvReadOnlyInfo doesn't have any writeable properties
  TJvReadOnlyInfo = class(TPersistent);

  // TJvWriteableInfo have at least one writeable property
  // and also have a ReadOnly property that controls whether the properties
  // are allowed to change
  TJvWriteableInfo = class(TPersistent)
  private
    FReadOnly: Boolean;
  protected
    property ReadOnly: Boolean read FReadOnly write FReadOnly default True;
  public
    constructor Create;
  end;

  TJvAPMInfo = class(TJvReadOnlyInfo)
  private
    function GetAPMBatteryFlag: TAPMBatteryFlag;
    function GetAPMBatteryFullLifeTime: DWORD;
    function GetAPMBatteryLifePercent: Integer;
    function GetAPMBatteryLifeTime: DWORD;
    function GetAPMLineStatus: TAPMLineStatus;
    procedure SetAPMBatteryFlag(const Value: TAPMBatteryFlag);
    procedure SetAPMBatteryFullLifeTime(const Value: DWORD);
    procedure SetAPMBatteryLifePercent(const Value: Integer);
    procedure SetAPMBatteryLifeTime(const Value: DWORD);
    procedure SetAPMLineStatus(const Value: TAPMLineStatus);
  published
    property LineStatus: TAPMLineStatus read GetAPMLineStatus write SetAPMLineStatus stored False;
    property BatteryFlag: TAPMBatteryFlag read GetAPMBatteryFlag write SetAPMBatteryFlag stored False;
    property BatteryLifePercent: Integer read GetAPMBatteryLifePercent write SetAPMBatteryLifePercent stored False;
    property BatteryLifeTime: DWORD read GetAPMBatteryLifeTime write SetAPMBatteryLifeTime stored False;
    property BatteryFullLifeTime: DWORD read GetAPMBatteryFullLifeTime write SetAPMBatteryFullLifeTime stored False;
  end;

  TJvOSVersionInfo = class(TJvReadOnlyInfo)
  private
    function GetProductType: TNtProductType;
    function GetWinProductID: string;
    function GetWinProductName: string;
    function GetWinVersionBuild: DWORD;
    function GetWinVersionMajor: DWORD;
    function GetWinVersionMinor: DWORD;
    function GetWinVersionCSDString: string;
    procedure SetProductType(const Value: TNtProductType);
    procedure SetWinProductID(const Value: string);
    procedure SetWinProductName(const Value: string);
    procedure SetWinVersionBuild(const Value: DWORD);
    procedure SetWinVersionMajor(const Value: DWORD);
    procedure SetWinVersionMinor(const Value: DWORD);
    procedure SetWinVersionCSDString(const Value: string);
    function GetWinServicePackVersion: DWORD;
    procedure SetWinServicePackVersion(const Value: DWORD);
    function GetOSVersion: TWindowsVersion;
    procedure SetOSVersion(const Value: TWindowsVersion);
  published
    property OSVersion: TWindowsVersion read GetOSVersion write SetOSVersion stored False;
    property ProductType: TNtProductType read GetProductType write SetProductType stored False;
    property ProductID: string read GetWinProductID write SetWinProductID stored False;
    property ProductName: string read GetWinProductName write SetWinProductName stored False;
    property ServicePackVersion: DWORD read GetWinServicePackVersion write SetWinServicePackVersion stored False;

⌨️ 快捷键说明

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