Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何在wxWidgets中将键盘焦点设置为空窗口?_C++_Wxwidgets - Fatal编程技术网

C++ 如何在wxWidgets中将键盘焦点设置为空窗口?

C++ 如何在wxWidgets中将键盘焦点设置为空窗口?,c++,wxwidgets,C++,Wxwidgets,在WinAPI中,您可以调用全局函数SetFocus(HWND)将焦点设置为空窗口(忽略击键): wxWidgets具有wxWindow::SetFocus(void)虚拟成员函数,因此无法传递NULL。如何在wxWidgets中实现可移植的等价物:SetFocus(NULL)?在wxWidgets API中无法实现这一点(但不清楚为什么会有人想要这么做) 如果需要全局执行,可以通过在wxApp::FilterEvent()中检查相应的事件来忽略所有键 ::SetFocus(NULL);

在WinAPI中,您可以调用全局函数
SetFocus(HWND)
将焦点设置为空窗口(忽略击键):


wxWidgets具有
wxWindow::SetFocus(void)
虚拟成员函数,因此无法传递
NULL
。如何在wxWidgets中实现可移植的等价物:SetFocus(NULL)?

在wxWidgets API中无法实现这一点(但不清楚为什么会有人想要这么做)

如果需要全局执行,可以通过在
wxApp::FilterEvent()
中检查相应的事件来忽略所有键

::SetFocus(NULL);