hxcpp
hxcpp copied to clipboard
im trying to make the window transparent
but the code crashes
var setWindowLong:cpp.Function< Pointer< Void > ->
Int ->
UInt -> Int, cpp.abi.Winapi> =
Function.getProcAddress("User32.dll", "SetWindowLongA");
var setLayeredWindowAttributes:cpp.Function< Pointer< Void > ->
UInt ->
UInt ->
UInt -> Int, cpp.abi.Winapi> =
Function.getProcAddress("User32.dll", "SetLayeredWindowAttributes");
var getActiveWindow:cpp.Function< Pointer< Void > ->
Pointer< Void >, cpp.abi.Winapi> =
Function.getProcAddress("User32.dll", "GetActiveWindow");
var handle = getActiveWindow(null);
setWindowLong(handle, -20, 0x00080000);
setLayeredWindowAttributes(handle, 0, 0, 0x00000001);
help me please im using flixel i put this code on the main function on my program's main.hx
cpp.Pointer is a wrapper that provides some haxe-like abilities to raw pointers. You could try cpp.Star, eg, cpp.Star<cpp.Void>
which is closer to native cpp. You can check the generated code to see if it is what you expect.