blitzmax ng hide boarders help!

BlitzMax Forums/BlitzMax Beginners Area/blitzmax ng hide boarders help!

Caton(Posted 2016) [#1]
Graphics 800,600
RemoveBorder()
Cls
Flip
WaitKey()

Function RemoveBorder()

	Local hWnd:Long = GetActiveWindow()

	Local tmp:Long = GetWindowLongA( hWnd, GWL_STYLE )
	tmp :~ WS_CAPTION

	SetWindowLongA( hWnd, GWL_STYLE, tmp )

End Function


the error says
Compile Error
Unable to convert from Byte Ptr to Long.



col(Posted 2016) [#2]
The issue is that NG uses a correct type for the window handle.
Also 'Long' in Blitzmax is a 64bit integer, but Long in c/c++ ( where the Get/SetWindowLong function originates from ) is compiler and OS implementation dependent, ultimately in this case it's from the Windows world which the Visual Studio compiler is designed around so should be 32bit - ie a Blitzmax 'Int'. Actually, this function has been deprecated in favour of the GetWindowLongPtr so that you can get/set pointer types. In the scenario that it's being used here it doesn't matter which you use so this code is correct...

Graphics 800,600
RemoveBorder()
Cls
Flip
WaitKey()

Function RemoveBorder()
	Local hWnd:Byte Ptr = GetActiveWindow()

	Local tmp:Int = GetWindowLongA( hWnd, GWL_STYLE )
	tmp :~ WS_CAPTION

	SetWindowLongA( hWnd, GWL_STYLE, tmp )
End Function