I change extended window style from 0 to WS_EX_NOREDIRECTIONBITMAP by calling
SetWindowLong(wnd, GWL_EXSTYLE, WS_EX_NOREDIRECTIONBITMAP);
the return value is zero which means the function failed and GetLastError() returns 87 indicates "the parameter is incorrect".
any idea what's wrong with my code?
SetWindowLong()
can return 0 on success if the previous value was 0. You could probably juggleSetLastError()
s to check for an explicit failure, but it's probably better to assume the function cannot fail...WS_EX_LAYERED
withSetWindowLongPtr
, the docs forSetLayeredWindowAttributes
even say that you can do it.