The C API is able to send information, events, or requests to OpenKneeboard; it is not able to receive data from OpenKneeboard. It requires a dynamic library -
OpenKneeboard_CAPI64.dll. The implementation of this DLL changes in every version of OpenKneeboard, however the API is expected to remain stable.
- The DLL is installed and kept up to date in
- The header is available in
As the implementation changes with every release, you should dynamically load the DLL using
LoadLibraryW(), and find the function of interest with
I recommend that programs attempt to locate the DLL by:
- checking for the presence of an
OPENKNEEBOARD_CAPI_DLLenvironment variable; if present, use it as the full path to the DLL
- otherwise, check
%ProgramFiles%\OpenKneeboard\bin\. Program files should ideally be located with
SHGetKnownFolderPath(), but the
ProgramFilesenvironment variable can also be used when
OPENKNEEBOARD_CAPI void OpenKneeboard_send_utf8( const char* messageName, size_t messageNameByteCount, const char* messageValue, size_t messageValueByteCount); OPENKNEEBOARD_CAPI void OpenKneeboard_send_wchar_ptr( const wchar_t* messageName, size_t messageNameCharCount, const wchar_t* messageValue, size_t messageValueCharCount); #define OPENKNEEBOARD_CAPI_DLL_NAME_A /* varies */ #define OPENKNEEBOARD_CAPI_DLL_NAME_W /* varies */
OPENKNEEBOARD_CAPI_DLL_NAME_Awill be the filename as a C string literal, e.g.
OPENKNEEBOARD_CAPI_DLL_NAME_Wwill be the filename as a C wide-string literal, e.g.
See the messages documentation for information on supported messages.