TNB Library
C:
Home
Private
TnbLibrary
TnbInc
TnbUsbHidFinder.h
[詳解]
1
#pragma once
11
#include "
TnbUsbGuidFinder.h
"
12
#include "
TnbUsbHidPathName.h
"
13
#include "
TnbVector.h
"
14
15
16
17
//TNB Library
18
namespace
TNB
19
{
20
21
22
35
class
CUsbHidFinder
:
public
CAbstractUsbGuidFinder
36
{
37
DEFSUPER(
CAbstractUsbGuidFinder
);
38
CUsbHidPathName
m_hidName;
39
protected
:
46
virtual
DWORD
OnFound
(LPCTSTR lpszDevicePath)
47
{
48
return
m_hidName.
SetPathName
(lpszDevicePath);
49
}
54
virtual
void
OnClosed
(
void
)
55
{
56
m_hidName.
Empty
();
57
}
58
59
public
:
60
62
CUsbHidFinder
(
void
) : m_hidName()
63
{
64
}
65
71
bool
Find
(
void
)
72
{
73
GUID g;
74
CUsbHidApi
().
HidD_GetHidGuid
(&g);
75
return
_super::Find(g);
76
}
77
83
bool
FindMouseHid
(
void
)
84
{
85
GUID g = { 0x378de44c, 0x56ef, 0x11d1, 0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd };
86
return
_super::Find(g);
87
}
88
95
const
CUsbHidPathName
&
Get
(
void
)
const
96
{
97
if
( ! _super::IsFinding() )
98
{
99
throw
CEmptyException
();
100
}
101
return
m_hidName;
102
}
103
109
static
CVectorT<CUsbHidPathName>
EnumPathNames
(
void
)
110
{
111
CVectorT<CUsbHidPathName>
v;
112
CUsbHidFinder
fh;
113
if
( fh.
Find
() )
114
{
115
do
116
{
117
v.
Add
(fh.
Get
());
118
}
while
( fh.
Next
() );
119
}
120
return
v;
121
}
122
130
static
CVectorT<CUsbHidPathName>
FindPathNames
(
int
iVendorId,
int
iProductId)
131
{
132
CVectorT<CUsbHidPathName>
v;
133
CUsbHidFinder
fh;
134
if
( fh.
Find
() )
135
{
136
do
137
{
138
if
( fh.
Get
().
GetVendorId
() == iVendorId && fh.
Get
().
GetProductId
() == iProductId )
139
{
140
v.
Add
(fh.
Get
());
141
}
142
}
while
( fh.
Next
() );
143
}
144
return
v;
145
}
146
};
147
148
149
150
};
// TNB
TnbUsbGuidFinder.h
DEVICE の検索関係のヘッダ
TnbUsbHidPathName.h
USB HIDのパスネーム情報管理関係のヘッダ
TnbVector.h
配列型情報管理関係のヘッダ
TNB::CAbstractUsbGuidFinder
DEVICE 検索クラス
Definition:
TnbUsbGuidFinder.h:36
TNB::CAbstractUsbGuidFinder::Next
bool Next(void)
[検索] 次検索
Definition:
TnbUsbGuidFinder.h:204
TNB::CEmptyException
取得要素(空き)無し例外
Definition:
TnbException.h:107
TNB::CUsbHidApi
hid.dll アクセスクラス
Definition:
TnbUsbHidPathName.h:211
TNB::CUsbHidApi::HidD_GetHidGuid
void HidD_GetHidGuid(LPGUID pHidGuid) const
[取得] HID GUID 取得.
Definition:
TnbUsbHidPathName.h:349
TNB::CUsbHidFinder
USB-HID検索クラス
Definition:
TnbUsbHidFinder.h:36
TNB::CUsbHidFinder::OnFound
virtual DWORD OnFound(LPCTSTR lpszDevicePath)
[通知] 発見.
Definition:
TnbUsbHidFinder.h:46
TNB::CUsbHidFinder::FindMouseHid
bool FindMouseHid(void)
[検索] 検索開始(Mouse指定)
Definition:
TnbUsbHidFinder.h:83
TNB::CUsbHidFinder::Find
bool Find(void)
[検索] 検索開始
Definition:
TnbUsbHidFinder.h:71
TNB::CUsbHidFinder::CUsbHidFinder
CUsbHidFinder(void)
コンストラクタ
Definition:
TnbUsbHidFinder.h:62
TNB::CUsbHidFinder::FindPathNames
static CVectorT< CUsbHidPathName > FindPathNames(int iVendorId, int iProductId)
[取得] 指定 USB-HID パスネーム情報一覧.
Definition:
TnbUsbHidFinder.h:130
TNB::CUsbHidFinder::Get
const CUsbHidPathName & Get(void) const
[取得] 検索結果情報取得
Definition:
TnbUsbHidFinder.h:95
TNB::CUsbHidFinder::EnumPathNames
static CVectorT< CUsbHidPathName > EnumPathNames(void)
[取得] USB-HID パスネーム情報一覧.
Definition:
TnbUsbHidFinder.h:109
TNB::CUsbHidFinder::OnClosed
virtual void OnClosed(void)
[通知] クローズ.
Definition:
TnbUsbHidFinder.h:54
TNB::CUsbHidPathName
USB-HIDパスネーム情報管理クラス
Definition:
TnbUsbHidPathName.h:585
TNB::CUsbHidPathName::SetPathName
DWORD SetPathName(LPCTSTR lpszPathName)
[設定] パスネーム設定.
Definition:
TnbUsbHidPathName.h:644
TNB::CUsbHidPathName::GetProductId
WORD GetProductId(void) const
[取得] プロダクトID取得
Definition:
TnbUsbHidPathName.h:825
TNB::CUsbHidPathName::GetVendorId
WORD GetVendorId(void) const
[取得] ベンダID取得
Definition:
TnbUsbHidPathName.h:816
TNB::CUsbHidPathName::Empty
void Empty(void)
[設定] 情報なし
Definition:
TnbUsbHidPathName.h:625
TNB::CVectorT
配列型情報管理テンプレート
Definition:
TnbVector.h:75
TNB::CVectorT::Add
virtual INDEX Add(const TYP &t)
[追加] 要素一つ追加.
Definition:
TnbVector.h:383
TNB
TNB Library
Definition:
TnbDoxyTitle.txt:2
2023年02月05日(日) 07時21分33秒作成 - TNB Library / 構成:
1.9.3