c++ Cannot create magnifier window

114 views Asked by At

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

1

There are 1 answers

0
jwjwjwjwjwjwyes On BEST ANSWER

Thank you to the people that helped me fix this. I fixed this by changing the classname in wc2 to "Magnifier"