#Include "window9.bi"

Function SetGadgetStyle(gadget As Integer, style As Integer , ExStyle As Bool=0, added As BOOL = 0) As Integer Export
	If ExStyle<>0 Then
		ExStyle = GWL_EXSTYLE
	Else
		ExStyle = GWL_STYLE
	EndIf
	If added = 0 Then
		Function = SetWindowLong(GadgetID(gadget),ExStyle,style)
	Else
		Function = SetWindowLong(GadgetID(gadget),ExStyle,style Or GetWindowLong(GadgetID(gadget),ExStyle))
	endif
End Function

Function SetWindowStyle(hwnd As HWND, style As Integer , ExStyle As Bool=0, added As BOOL = 0) As Integer Export
	If ExStyle<>0 Then
		ExStyle = GWL_EXSTYLE
	Else
		ExStyle = GWL_STYLE
	EndIf
	If added = 0 Then
		Function = SetWindowLong(hwnd,ExStyle,style)
	Else
		Function = SetWindowLong(hwnd,ExStyle,style Or GetWindowLong(hwnd,ExStyle))
	EndIf
End Function