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

📄 dbt.pas

📁 human interface devices.zip 一套组件
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{******************************************************************}
{                                                                  }
{ Borland Delphi Runtime Library                                   }
{ <API> interface unit                                             }
{                                                                  }
{ Portions created by Microsoft are                                }
{ Copyright (C) 1993-1998 Microsoft Corporation.                   }
{ All Rights Reserved.                                             }
{                                                                  }
{ The original file is: dbt.h, released 24 May 1993                }
{ The original Pascal code is: dbt.pas, released 01 Jan 1998       }
{ The initial developer of the Pascal code is Tom Deprez           }
{ (Tom.Deprez@village.uunet.be)                                    }
{                                                                  }
{ Portions created by Tom Deprez are                               }
{ Copyright (C) 1999-2000 Tom Deprez.                              }
{                                                                  }
{ Contributor(s):                                                  }
{     Robert Marquardt : pointed out that TWMDeviceChange          }
{                        is better placed inside dbt.pas           }
{                                                                  }
{                                                                  }
{ Obtained through:                                                }
{                                                                  }
{ Joint Endeavour of Delphi Innovators (Project JEDI)              }
{                                                                  }
{ You may retrieve the latest version of this file at the Project  }
{ JEDI home page, located at http://delphi-jedi.org                }
{                                                                  }
{ The contents of this file are used with permission, 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 express or   }
{ implied. See the License for the specific language governing     }
{ rights and limitations under the License.                        }
{                                                                  }
{******************************************************************}

unit DBT;

{$WEAKPACKAGEUNIT ON}

interface

(*$HPPEMIT '' *)
(*$HPPEMIT '#include <dbt.h>' *)
(*$HPPEMIT '' *)

uses
  Windows;

{ *
  * BroadcastSpecialMessage constants
  * }

const
  {$EXTERNALSYM WM_DEVICECHANGE}
  WM_DEVICECHANGE = $0219;


{ *
  * Broadcast message and receipient flags.
  *
  * Note that there is a third "flag". If the wParam has:
  *
  *   bit 15 on: lparam is a pointer and bit 14 is meaningfull.
  *   bit 15 off: lparam is just a UNLONG data type.
  *
  *   bit 14 on: lparam is a pointer to an ASCIIZ string.
  *   bit 14 off: lparam is a pointer to a binary struture starting with
  *     a dword describing the length of the structure.
  * }

const
  {$EXTERNALSYM BSF_QUERY}
  BSF_QUERY = $00000001;
  {$EXTERNALSYM BSF_IGNORECURRENTTASK}
  BSF_IGNORECURRENTTASK = $00000002;        { Meaningless for VxDs }
  {$EXTERNALSYM BSF_FLUSHDISK}
  BSF_FLUSHDISK = $00000004;                { Shouldn't be used by VxDs }
  {$EXTERNALSYM BSF_NOHANG}
  BSF_NOHANG = $00000008;
  {$EXTERNALSYM BSF_POSTMESSAGE}
  BSF_POSTMESSAGE = $00000010;
  {$EXTERNALSYM BSF_FORCEIFHUNG}
  BSF_FORCEIFHUNG = $00000020;
  {$EXTERNALSYM BSF_NOTIMEOUTIFNOTHUNG}
  BSF_NOTIMEOUTIFNOTHUNG = $00000040;
  {$EXTERNALSYM BSF_MSGSRV32ISOK}
  BSF_MSGSRV32ISOK = DWORD($80000000);      { Called synchronously from PM API }
  {$EXTERNALSYM BSF_MSGSRV32ISOK_BIT}
  BSF_MSGSRV32ISOK_BIT = 31;                { Called synchronously from PM API }
  {$EXTERNALSYM BSM_ALLCOMPONENTS}
  BSM_ALLCOMPONENTS = $00000000;
  {$EXTERNALSYM BSM_VXDS}
  BSM_VXDS = $00000001;
  {$EXTERNALSYM BSM_NETDRIVER}
  BSM_NETDRIVER = $00000002;
  {$EXTERNALSYM BSM_INSTALLABLEDRIVERS}
  BSM_INSTALLABLEDRIVERS = $00000004;
  {$EXTERNALSYM BSM_APPLICATIONS}
  BSM_APPLICATIONS = $00000008;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_APPYBEGIN
  *   lParam = (not used)
  *
  * 'Appy-time is now available. This message is itself sent
  * at 'Appy-time.
  *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_APPYEND
  *   lParam = (not used)
  *
  * 'Appy-time is no longer available. This message is*NOT* sent
  * at 'Appy-time. (It cannot be, because 'Appy-time is gone.)
  *
  * NOTE! It is possible for DBT_APPYBEGIN and DBT_APPYEND to be sent
  * multiple times during a single Windows session. Each appearance of
  * 'Appy-time is bracketed by these two messages, but 'Appy-time may
  * momentarily become unavailable during otherwise normal Windows
  * processing. The current status of 'Appy-time availability can always
  * be obtained from a call to _SHELL_QueryAppyTimeAvailable.
  * }

const
  {$EXTERNALSYM DBT_APPYBEGIN}
  DBT_APPYBEGIN = $0000;
  {$EXTERNALSYM DBT_APPYEND}
  DBT_APPYEND = $0001;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_DEVNODES_CHANGED
  *   lParam = 0
  *
  * send when configmg finished a process tree batch. Some devnodes
  * may have been added or removed. This is used by ring3 people which
  * need to be refreshed whenever any devnode changed occur (like
  * device manager). People specific to certain devices should use
  * DBT_DEVICE* instead.
  * }

const
  {$EXTERNALSYM DBT_DEVNODES_CHANGED}
  DBT_DEVNODES_CHANGED = $0007;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_QUERYCHANGECONFIG
  *   lParam = 0
  *
  * sent to ask if a config change is allowed
  * }

const
  {$EXTERNALSYM DBT_QUERYCHANGECONFIG}
  DBT_QUERYCHANGECONFIG = $0017;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_CONFIGCHANGED
  *   lParam = 0
  *
  * sent when a config has changed
  * }

const
  {$EXTERNALSYM DBT_CONFIGCHANGED}
  DBT_CONFIGCHANGED = $0018;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_CONFIGCHANGECANCELED
  *   lParam = 0
  *
  * someone cancelled the config change
  * }

const
  {$EXTERNALSYM DBT_CONFIGCHANGECANCELED}
  DBT_CONFIGCHANGECANCELED = $0019;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_MONITORCHANGE
  *   lParam = new resolution to use (LOWORD=x, HIWORD=y)
  * if 0, use the default res for current config
  *
  * this message is sent when the display monitor has changed
  * and the system should change the display mode to match it.
  * }

const
  {$EXTERNALSYM DBT_MONITORCHANGE}
  DBT_MONITORCHANGE = $001B;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_SHELLLOGGEDON
  *   lParam = 0
  *
  * The shell has finished login on: VxD can now do Shell_EXEC.
  * }

const
  {$EXTERNALSYM DBT_SHELLLOGGEDON}
  DBT_SHELLLOGGEDON = $0020;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_CONFIGMGAPI
  *   lParam = CONFIGMG API Packet
  *
  * CONFIGMG ring 3 call.
  * }

const
  {$EXTERNALSYM DBT_CONFIGMGAPI32}
  DBT_CONFIGMGAPI32 = $0022;


{ *
  * Message = WM_DEVICECHANGE
  *   wParam = DBT_VXDINITCOMPLETE
  *   lParam = 0
  *
  * CONFIGMG ring 3 call.
  * }

const
  {$EXTERNALSYM DBT_VXDINITCOMPLETE}
  DBT_VXDINITCOMPLETE = $0023;


{ *
  * Message = WM_DEVICECHANGE
  * wParam = DBT_VOLLOCK*
  * lParam = pointer to VolLockBroadcast structure described below
  *
  * Messages issued by IFSMGR for volume locking purposes on WM_DEVICECHANGE.
  * All these messages pass a pointer to a struct which has no pointers.
  * }

const
  {$EXTERNALSYM DBT_VOLLOCKQUERYLOCK}
  DBT_VOLLOCKQUERYLOCK = $8041;
  {$EXTERNALSYM DBT_VOLLOCKLOCKTAKEN}
  DBT_VOLLOCKLOCKTAKEN = $8042;
  {$EXTERNALSYM DBT_VOLLOCKLOCKFAILED}
  DBT_VOLLOCKLOCKFAILED = $8043;
  {$EXTERNALSYM DBT_VOLLOCKQUERYUNLOCK}
  DBT_VOLLOCKQUERYUNLOCK = $8044;
  {$EXTERNALSYM DBT_VOLLOCKLOCKRELEASED}
  DBT_VOLLOCKLOCKRELEASED = $8045;
  {$EXTERNALSYM DBT_VOLLOCKUNLOCKFAILED}
  DBT_VOLLOCKUNLOCKFAILED = $8046;


{ *
  * Device broadcast header
  * }

type
  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;


{ *
  * Structure for volume lock broadcast
  * }

⌨️ 快捷键说明

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