数字板压力测试是指通过模拟极端工作环境和条件,评估数字板在各种负载下的性能、稳定性和可靠性。这项测试对于确保产品能够承受实际使用中的挑战至关重要。
5.8 Manager Packet Hook Functions
These functions allow manager applications to monitor, record, and play back sequences of tablet packets.
### 5.8.1 WTMgrPacketHook (仅适用于16位)
Syntax: `WTHOOKPROC WTMgrPacketHook(hMgr, fInstall, nType, lpFunc)`
This function installs or removes a packet hook function.
- **hMgr HMGR**: Identifies the caller as a manager application.
- **fInstall BOOL**: Specifies whether to install (non-zero) or remove (zero) the specified hook.
- **nType int**: Specifies which type of packet hook should be installed. It can take one of these values:
- `WTH_PLAYBACK`: Installs a playback hook function.
- `WTH_RECORD`: Installs a recording hook function.
- **lpFunc WTHOOKPROC**: Is the procedure-instance address for the hook function to install.
When installing, if successful, returns the procedure-instance address of any previously installed hooks (returns NULL if none). If unsuccessful, returns negative one. The application or library should save this value in its data segment; it is used by `WTPacketHookDefProc`.
When uninstalling, if successful, returns the passed lpFunc argument; otherwise, returns NULL.
This function is non-portable and has been superseded by WTMgrPacketHookEx and WTMgrPacketUnhook.
### 5.8.2 WTMgrPacketHookEx
Syntax: `HWTHOOK WTMgrPacketHookEx(hMgr, nType, lpszModule, lpszHookProc)`
This function installs a packet hook function.
- **hMgr HMGR**: Identifies the caller as a manager application.
- **nType int**: Specifies which type of packet hook should be installed. It can take one of these values:
- `WTH_PLAYBACK`: Installs a playback hook function.
- `WTH_RECORD`: Installs a recording hook function.
- **lpszModule LPCTSTR**: Points to the null-terminated string that names the DLL module containing the new hook function.
- **lpszHookProc LPCSTR**: Points to the null-terminated string naming the new hook function.
If successful, returns the handle of installed hook; otherwise, returns NULL.
Packet hooks are a shared resource. Installing a packet hook affects all applications using this interface. All Wintab functions must be exported functions residing in a DLL module.
#### WTH_PLAYBACK
Wintab calls the playback hook whenever an event packet is requested to supply previously recorded packets for compatible contexts. The function should copy an event packet into the buffer pointed by lParam and not modify it. It returns time (in milliseconds) that Wintab waits before processing messages, calculated from timestamps of current and previous packets.
#### WTH_RECORD
The interface calls this hook when a packet is processed from the contexts queue to record for later playback. The function should save a copy of the packet without modifying it; once control returns to Wintab, message continues being processed.
### 5.8.3 WTMgrPacketUnhook
Syntax: `BOOL WTMgrPacketUnhook(hHook)`
This function removes a hook installed by WTMgrPacketHookEx.
- **hHook HWTHOOK**: Identifies the hook function to be removed.
Returns non-zero if successful, zero otherwise.
### 5.8.4 WTMgrPacketHookDefProc (仅适用于16位)
Syntax: `LRESULT WTMgrPacketHookDefProc(nCode, wParam, lParam, lplpFunc)`
This function passes hook information to the next packet hook in a chain of such hooks installed by applications.
- **nCode int**: Specifies how the message should be processed.
- **wParam WPARAM**: Specifies word parameter of the message being processed.
- **lParam LPARAM**: Points to long parameter of the message being processed.
- **lplpFunc WTHOOKPROC FAR *:** Points to memory location containing `WTHOOKPROC` returned by `WTMgrPacketHook`.
This function is non-portable and has been superseded by WTMgrPacketHookNext.
### 5.8.5 WTMgrPacketHookNext
Syntax: `LRESULT WTMgrPacketHookNext(hHook, nCode, wParam, lParam)`
Passes hook information to the next packet hook in a chain of such hooks.
- **hHook HWTHOOK**: Identifies current hook.
- **nCode int**: Specifies code passed to current hook function.
- **wParam WPARAM**: Specifies `wParam` value for message being processed.
- **lParam LPARAM**: Points to long parameter of the message being processed.