hxcpp icon indicating copy to clipboard operation
hxcpp copied to clipboard

im trying to make the window transparent

Open nintendofan44 opened this issue 2 years ago • 1 comments

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

nintendofan44 avatar Jun 02 '22 01:06 nintendofan44

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.

hughsando avatar Jun 03 '22 02:06 hughsando