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

📄 jvhidcontrollerclass.hpp

📁 human interface devices.zip 一套组件
💻 HPP
📖 第 1 页 / 共 2 页
字号:
// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'JvHidControllerClass.pas' rev: 6.00

#ifndef JvHidControllerClassHPP
#define JvHidControllerClassHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ModuleLoader.hpp>	// Pascal unit
#include <Hid.hpp>	// Pascal unit
#include <SetupApi.hpp>	// Pascal unit
#include <DBT.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Jvhidcontrollerclass
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TJvHidDevice;
typedef bool __fastcall (__closure *TJvHidEnumerateEvent)(TJvHidDevice* HidDev, const int Idx);

typedef void __fastcall (__closure *TJvHidUnplugEvent)(TJvHidDevice* HidDev);

typedef void __fastcall (__closure *TJvHidDataEvent)(TJvHidDevice* HidDev, Byte ReportID, const void * Data, Word Size);

typedef void __fastcall (__closure *TJvHidDataErrorEvent)(TJvHidDevice* HidDev, unsigned Error);

typedef bool __stdcall (*TJvHidCheckCallback)(TJvHidDevice* HidDev);

#pragma option push -b-
enum TJvHidOpenExMode { omhRead, omhWrite };
#pragma option pop

typedef DynamicArray<Word >  TJvPhysicalDescriptor;

class DELPHICLASS TJvHidPnPInfo;
class PASCALIMPLEMENTATION TJvHidPnPInfo : public System::TObject 
{
	typedef System::TObject inherited;
	
public:
	unsigned FDeviceID;
	AnsiString FDevicePath;
	unsigned FCapabilities;
	AnsiString FClassDescr;
	AnsiString FClassGUID;
	Classes::TStringList* FCompatibleIDs;
	unsigned FConfigFlags;
	AnsiString FDeviceDescr;
	AnsiString FDriver;
	AnsiString FFriendlyName;
	Classes::TStringList* FHardwareID;
	Classes::TStringList* FLowerFilters;
	AnsiString FMfg;
	Classes::TStringList* FUpperFilters;
	AnsiString FAddress;
	unsigned FBusNumber;
	AnsiString FBusType;
	AnsiString FCharacteristics;
	AnsiString FDevType;
	AnsiString FEnumeratorName;
	unsigned FExclusive;
	AnsiString FLegacyBusType;
	AnsiString FLocationInfo;
	AnsiString FPhysDevObjName;
	AnsiString FSecurity;
	AnsiString FService;
	unsigned FUINumber;
	AnsiString FUINumberFormat;
	AnsiString __fastcall GetRegistryPropertyString(void * PnPHandle, const SP_DEVINFO_DATA &DevData, unsigned Prop);
	Classes::TStringList* __fastcall GetRegistryPropertyStringList(void * PnPHandle, const SP_DEVINFO_DATA &DevData, unsigned Prop);
	unsigned __fastcall GetRegistryPropertyDWord(void * PnPHandle, const SP_DEVINFO_DATA &DevData, unsigned Prop);
	__property unsigned DeviceID = {read=FDeviceID, nodefault};
	__property AnsiString DevicePath = {read=FDevicePath};
	__property unsigned Capabilities = {read=FCapabilities, nodefault};
	__property AnsiString ClassDescr = {read=FClassDescr};
	__property AnsiString ClassGUID = {read=FClassGUID};
	__property Classes::TStringList* CompatibleIDs = {read=FCompatibleIDs};
	__property unsigned ConfigFlags = {read=FConfigFlags, nodefault};
	__property AnsiString DeviceDescr = {read=FDeviceDescr};
	__property AnsiString Driver = {read=FDriver};
	__property AnsiString FriendlyName = {read=FFriendlyName};
	__property Classes::TStringList* HardwareID = {read=FHardwareID};
	__property Classes::TStringList* LowerFilters = {read=FLowerFilters};
	__property AnsiString Mfg = {read=FMfg};
	__property Classes::TStringList* UpperFilters = {read=FUpperFilters};
	__property AnsiString Address = {read=FAddress};
	__property unsigned BusNumber = {read=FBusNumber, nodefault};
	__property AnsiString BusType = {read=FBusType};
	__property AnsiString Characteristics = {read=FCharacteristics};
	__property AnsiString DevType = {read=FDevType};
	__property AnsiString EnumeratorName = {read=FEnumeratorName};
	__property unsigned Exclusive = {read=FExclusive, nodefault};
	__property AnsiString LegacyBusType = {read=FLegacyBusType};
	__property AnsiString LocationInfo = {read=FLocationInfo};
	__property AnsiString PhysDevObjName = {read=FPhysDevObjName};
	__property AnsiString Security = {read=FSecurity};
	__property AnsiString Service = {read=FService};
	__property unsigned UINumber = {read=FUINumber, nodefault};
	__property AnsiString UINumberFormat = {read=FUINumberFormat};
	__fastcall TJvHidPnPInfo(void * APnPHandle, const SP_DEVINFO_DATA &ADevData, char * ADevicePath);
	__fastcall virtual ~TJvHidPnPInfo(void);
};


typedef DynamicArray<Byte >  JvHidControllerClass__3;

class DELPHICLASS TJvHidDeviceReadThread;
class PASCALIMPLEMENTATION TJvHidDeviceReadThread : public Classes::TThread 
{
	typedef Classes::TThread inherited;
	
private:
	unsigned FErr;
	void __fastcall DoData(void);
	void __fastcall DoDataError(void);
	__fastcall TJvHidDeviceReadThread(const TJvHidDevice* Dev);
	
public:
	TJvHidDevice* Device;
	unsigned NumBytesRead;
	DynamicArray<Byte >  Report;
	virtual void __fastcall Execute(void);
	__fastcall TJvHidDeviceReadThread(bool CreateSuspended);
public:
	#pragma option push -w-inl
	/* TThread.Destroy */ inline __fastcall virtual ~TJvHidDeviceReadThread(void) { }
	#pragma option pop
	
};


typedef DynamicArray<HIDP_LINK_COLLECTION_NODE >  JvHidControllerClass__5;

class DELPHICLASS TJvHidDeviceController;
class PASCALIMPLEMENTATION TJvHidDeviceController : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	#pragma pack(push, 1)
	GUID FHidGuid;
	#pragma pack(pop)
	
	Classes::TNotifyEvent FDeviceChangeEvent;
	TJvHidEnumerateEvent FEnumerateEvent;
	TJvHidDataEvent FDevDataEvent;
	TJvHidDataErrorEvent FDevDataErrorEvent;
	TJvHidUnplugEvent FDevUnplugEvent;
	bool FDeviceChangeFired;
	int FDevThreadSleepTime;
	AnsiString FVersion;
	AnsiString FDummy;
	Classes::TList* FList;
	int FNumCheckedInDevices;
	int FNumCheckedOutDevices;
	int FNumUnpluggedDevices;
	bool __fastcall CheckThisOut(TJvHidDevice* &HidDev, int Idx, bool Check);
	void __fastcall FillInList(Classes::TList* &List);
	bool __fastcall EventPipe(Messages::TMessage &Msg);
	
protected:
	void __fastcall DoDeviceChange(void);
	bool __fastcall DoEnumerate(TJvHidDevice* HidDev, int Idx);
	void __fastcall SetDeviceChangeEvent(const Classes::TNotifyEvent Notifier);
	void __fastcall SetEnumerate(const TJvHidEnumerateEvent Enumerator);
	void __fastcall SetDevThreadSleepTime(const int DevTime);
	void __fastcall SetDevData(const TJvHidDataEvent DataEvent);
	void __fastcall SetDevDataError(const TJvHidDataErrorEvent DataErrorEvent);
	void __fastcall SetDevUnplug(const TJvHidUnplugEvent Unplugger);
	
public:
	__property GUID HidGuid = {read=FHidGuid};
	__fastcall virtual TJvHidDeviceController(Classes::TComponent* AOwner);
	__fastcall virtual ~TJvHidDeviceController(void);
	void __fastcall CheckIn(TJvHidDevice* &HidDev);
	bool __fastcall CheckOut(TJvHidDevice* &HidDev);
	bool __fastcall CheckOutByClass(TJvHidDevice* &HidDev, const AnsiString ClassName);
	bool __fastcall CheckOutByID(TJvHidDevice* &HidDev, const int Vid, const int Pid);

⌨️ 快捷键说明

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