我正在努力将这个俄罗斯方块示例从 win32 包 github 页面转移到颤振应用程序。我想听“WM_KILLFOCUS”消息,如果颤振应用失去焦点,我可以执行事件 x。
目前我坚持这一点,这显然是行不通的。
void main() {
final wc = calloc<WNDCLASS>()..ref.lpfnWndProc = Pointer.fromFunction<WindowProc>(mainWindowProc, 0);
RegisterClass(wc);
runApp(const MyApp());
}
int mainWindowProc(int hwnd, int uMsg, int wParam, int lParam) {
print("called");
switch (uMsg) {
case WM_KILLFOCUS:
print("Lost focus");
break;
default:
return 0;
}
return 0;
}
因此,如果有人知道如何使其工作或一个好的(flutter0)示例应用程序,我将不胜感激。