首页 > 解决方案 > 如何使用 Windows 句柄注册回调?

问题描述

我正在使用一个 C 库,它使用 Windows 回调来执行未经请求的消息传递。我不知道如何使用 Windows 句柄注册回调。

这是我尝试使用的函数的原型:

FWLIBAPI short WINAPI cnc_unsolicstart( unsigned short FlibHndl, short number, HWND hWnd, unsigned long msgno, short chkalive, short *bill );

它要求一个窗口句柄HWND hWnd,但我不知道如何用这个句柄注册一个回调。

这是我想由库调用的 Windows 回调函数:

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {}

我怎样才能把这一切联系在一起?

标签: cwindowshwnd

解决方案


推荐阅读