CWnd.wndTopMost是做什么用的?
在定义中,我发现它是:
static AFX_DATA const CWnd wndTopMost;宏AFX_DATA如何影响此行?
这段代码:
this->wndTopMost.SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);返回错误
'CWnd::SetWindowPos' : cannot convert 'this' pointer from 'const CWnd' to 'CWnd &'为什么它需要引用?此方法返回为空。
发布于 2014-10-20 19:12:28
wndTopMost仅用于SetWindowPos的第一个参数。此变量用于在此窗口之后按Z顺序插入窗口。
在内部,它只是一个具有值-1的特殊句柄(查看here
使用这个技巧(const CWnd),没有人可以做你尝试过的事情。
如果你真的想对最上面的窗口做一些事情,你必须用GetTopWindow,GetActiveWindow或其他函数来检索句柄。
https://stackoverflow.com/questions/26462091
复制相似问题