- 新增 wyhkm.dll 硬件盒子 COM 接口封装,支持键盘鼠标控制 - 修复 game_state_config.json 中 scan_region_width 过小导致截图越界的问题 - 添加鼠标路径录制器、硬件测试脚本等工具 - 更新多项配置默认值 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
68 lines
2.7 KiB
HTML
68 lines
2.7 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
|
||
<title>HKMGetDevString</title>
|
||
<link rel="stylesheet" type="text/css" href="css/help.css">
|
||
</head>
|
||
<body>
|
||
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="ts">
|
||
<tr>
|
||
<th width="50">名称</th>
|
||
<td class="name">HKMGetDevString 获得设备字符串</td>
|
||
</tr>
|
||
<tr>
|
||
<th>功能</th>
|
||
<td>获得设备相关的字符串。</td>
|
||
</tr>
|
||
<tr>
|
||
<th>参数</th>
|
||
<td class="canshu">参数1 设备对象:无类型指针。使用<a href="HKMOpen.html">HKMOpen</a>可以创建它。<br />
|
||
参数2 序号:无符号32位整型数。需要获取的字符串的序号。可取值如下:<br />
|
||
<table width="236" border="1" cellpadding="0" cellspacing="0">
|
||
<tr>
|
||
<th width="34" scope="col"><span class="thf">值</span></th>
|
||
<th width="196" scope="col"><span class="thf">说明</span></th>
|
||
</tr>
|
||
<tr>
|
||
<td>1</td>
|
||
<td>制造商</td>
|
||
</tr>
|
||
<tr>
|
||
<td>2</td>
|
||
<td>产品名</td>
|
||
</tr>
|
||
</table>
|
||
参数3 是否鼠标:布尔值。取false时,自动获得设备字符串,如果同时有键盘模式或者鼠标模式的设备,获得键盘模式的设备字符串。取true时,自动获得设备字符串,如果同时有键盘模式或者鼠标模式的设备,获得鼠标模式的设备字符串。<br />
|
||
参数4 字符串长度:无符号32位整型数指针。用于接收返回值为非NULL时,返回字符串的字符数,不包括字符串结束符'\0'。不需要时可以取值为NULL。</td>
|
||
</tr>
|
||
<tr>
|
||
<th>返回值</th>
|
||
<td class="fanhui">字符串(Unicode/Ansi)。失败返回NULL,成功返回字符串地址。默认是Unicode字符串,可以通过<a href="HKMSetMode.html">HKMSetMode</a>修改为Ansi字符串。字符串保存在设备对象的临时数据区中,无需单独释放,但是需要将内容尽快读出,防止被其它使用临时数据区的函数将数据改写了。</td>
|
||
</tr>
|
||
<tr>
|
||
<th>C语言<br />例子</th>
|
||
<td class="lizi">DWORD dwDevId,;<br />
|
||
LPVOID lpDev;<br />
|
||
LPWSTR lpStr;<br />
|
||
setlocale(LC_ALL,"chs");<span class="note">//printf输出中文Unicode字符要这样设置才能正常显示</span><br />
|
||
dwDevId=HKMSearchDevice(0x1234,0xABCD,0);<br />
|
||
if(dwDevId==0xFFFFFFFF)<br />
|
||
{<br />
|
||
printf("未找到无涯键鼠盒子\n");<br />
|
||
return 0;<br />
|
||
}<br />
|
||
lpDev=HKMOpen(dwDevId,0);<br />
|
||
if(lpDev==NULL)<br />
|
||
{<br />
|
||
printf("打开无涯键鼠盒子失败\n");<br />
|
||
return 0;<br />
|
||
}<br />
|
||
lpStr=HKMGetString(lpDev,1,false);<br />
|
||
if(lpStr!=NULL)<br />
|
||
printf("制造商:%S\n",lpStr);<br />
|
||
HKMClose(lpDev);</td>
|
||
</tr>
|
||
</table>
|
||
</body>
|
||
</html> |