Trying to make the main window transparent with SetLayeredWindowAttributes but I keep getting error 87 (ERROR_INVALID_PARAMETER/The parameter is incorrect)
I dont know if this is to do with the COLORREF 'structure' or not and it should be a pointer so if so the structure is not looking like a structure commonly used so if this is the issue how do I fix it? The example should make the window complete transparent.
Using a random dll to deal with transparency then I can restore transparency no problem with:
Code:
User32 [COLOR="#FF0000"]=[/COLOR] Library[COLOR="#FF0000"].[/COLOR]Load([COLOR="#800080"]"user32.dll"[/COLOR]) Kernel32 [COLOR="#FF0000"]=[/COLOR] Library[COLOR="#FF0000"].[/COLOR]Load([COLOR="#800080"]"kernel32.dll"[/COLOR]) [COLOR="#0000FF"]local[/COLOR] x [COLOR="#FF0000"]=[/COLOR] User32[COLOR="#FF0000"].[/COLOR]GetWindowLongA(Application[COLOR="#FF0000"].[/COLOR]GetWndHandle()[COLOR="#FF0000"],[/COLOR]-[COLOR="#000000"]20[/COLOR]) [COLOR="#0000FF"]if[/COLOR] Bitwise[COLOR="#FF0000"].[/COLOR]And(x[COLOR="#FF0000"],[/COLOR]0x00080000) [COLOR="#FF0000"]==[/COLOR] 0x00080000 [COLOR="#0000FF"]then[/COLOR] [COLOR="#0000FF"]if[/COLOR] User32[COLOR="#FF0000"].[/COLOR]SetLayeredWindowAttributes(Application[COLOR="#FF0000"].[/COLOR]GetWndHandle()[COLOR="#FF0000"],[/COLOR][COLOR="#000000"]0[/COLOR][COLOR="#FF0000"],[/COLOR][COLOR="#000000"]0[/COLOR][COLOR="#FF0000"],[/COLOR]0x00000002) [COLOR="#FF0000"]==[/COLOR] [COLOR="#000000"]0[/COLOR] [COLOR="#0000FF"]then[/COLOR] Dialog[COLOR="#FF0000"].[/COLOR]Message([COLOR="#800080"]"Error Code"[/COLOR][COLOR="#FF0000"],[/COLOR]Kernel32[COLOR="#FF0000"].[/COLOR]GetLastError()) [COLOR="#0000FF"]else[/COLOR] Dialog[COLOR="#FF0000"].[/COLOR]Message([COLOR="#800080"]"OK"[/COLOR][COLOR="#FF0000"],[/COLOR][COLOR="#800080"]""[/COLOR]) [COLOR="#0000FF"]end[/COLOR] [COLOR="#0000FF"]else[/COLOR] Dialog[COLOR="#FF0000"].[/COLOR]Message([COLOR="#800080"]"Error"[/COLOR][COLOR="#FF0000"],[/COLOR][COLOR="#800080"]"No WS_EX_LAYERED"[/COLOR]) [COLOR="#0000FF"]end[/COLOR]
Using a random dll to deal with transparency then I can restore transparency no problem with:
Code:
User32[COLOR="#FF0000"].[/COLOR]SetLayeredWindowAttributes(Application[COLOR="#FF0000"].[/COLOR]GetWndHandle()[COLOR="#FF0000"],[/COLOR][COLOR="#000000"]0[/COLOR][COLOR="#FF0000"],[/COLOR][COLOR="#000000"]255[/COLOR][COLOR="#FF0000"],[/COLOR]0x00000002)
Comment