'c++ Magnifier, MagSetWindowTransform returning false
Ive setup two windows,
First window:
hwnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, wc.lpszClassName, skCrypt(_T("main window")), WS_POPUP | WS_CLIPCHILDREN, rect.left, rect.top, widthh, heightt, nullptr, nullptr, NULL, nullptr);
Second Window:
RegisterClassEx(&wc2);
magHwnd = CreateWindow(WC_MAGNIFIER, skCrypt(_T("gjinhoiuahsrohiua")), WS_VISIBLE | WS_CHILD,
a1-125, a2-125, //Center of screen
250, 250,
hwnd, //The first window
NULL, wc2.hInstance, NULL);
wc2:
WNDCLASSEX wc2 = {
sizeof(WNDCLASSEX),
CS_CLASSDC,
WndProc,
0L,
0L,
GetModuleHandle(NULL),
NULL,
NULL, NULL,
NULL,
_T("Magnifier"),
NULL
};
These two windows are working fine.
In my magnification function:
if (MagInitialize()) {
{ //Setting mag factor
MAGTRANSFORM matrix;
memset(&matrix, 0, sizeof(matrix)); //Clear matrix
//n = mag factor
matrix.v[0][0] = 2.5f;
matrix.v[1][1] = 2.5f;
matrix.v[2][2] = 1.f;
bool factorDone = MagSetWindowTransform(magHwnd, &matrix);
if (!factorDone) {
Beep(600, 600);
}
}
}
MagSetWindowTransform is always returning false, ive been looking into this for hours but im honestly stuck. Any help i would be thankful for
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
