C++无法创建放大镜窗口
我试图制定放大程序,但是如果没有错误1407,我无法创建子窗口,子窗口也使主机Windows GUI消失了。
hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, wc.lpszClassName, skCrypt(_T("magnifier")), WS_POPUP | WS_CLIPCHILDREN, rect.left, rect.top, widthh, heightt, nullptr, nullptr, NULL, nullptr);
RegisterClassEx(&wc2);
magHwnd = CreateWindow(WC_MAGNIFIER, "a", WS_VISIBLE | WS_CHILD, 250, 250, 250, 250, hwnd, NULL, wc2.hInstance, NULL);
if (!magHwnd) {
MessageBox(NULL, std::to_string(GetLastError()).c_str(), "Window Creation", MB_OK);
}
编辑:第二个createWindow函数有效,直到我添加wc_magnifier标志
Im trying to make a magnification program, but I cannot create the child window without the error 1407, The child window also makes the host windows gui disappear.
hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, wc.lpszClassName, skCrypt(_T("magnifier")), WS_POPUP | WS_CLIPCHILDREN, rect.left, rect.top, widthh, heightt, nullptr, nullptr, NULL, nullptr);
RegisterClassEx(&wc2);
magHwnd = CreateWindow(WC_MAGNIFIER, "a", WS_VISIBLE | WS_CHILD, 250, 250, 250, 250, hwnd, NULL, wc2.hInstance, NULL);
if (!magHwnd) {
MessageBox(NULL, std::to_string(GetLastError()).c_str(), "Window Creation", MB_OK);
}
EDIT: the second CreateWindow function works until i add the WC_MAGNIFIER flag
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢帮助我解决这个问题的人。
我通过将WC2中的className更改为“放大镜”来解决此问题
Thank you to the people that helped me fix this.
I fixed this by changing the classname in wc2 to "Magnifier"