#include once "window9.bi"

Sub PanelGadgetSetCursel(ByVal gadget As long, ByVal item As Long) Export
	dim as Long iOldItem = SendMessage(Cast(hwnd,GadgetID(gadget)),4875,0,0)
	Dim As TC_ITEM TI
	TI.mask=TCIF_PARAM
	SendMessage(GadgetID(gadget),TCM_GETITEM,iOldItem,Cast(LPARAM,@TI))
	dim as Hwnd oldWin = Cast(HWND,TI.LPARAM)
	ShowWindow(oldWin , 0)
	SendMessage(GadgetID(gadget),TCM_GETITEM,item,Cast(LPARAM,@TI))
	dim as Hwnd newWin = Cast(HWND,TI.LPARAM)
	SendMessage(Cast(hwnd,GadgetID(gadget)),4876,item,0)
	ShowWindow(newWin , 1)
End Sub

Function PanelGadgetGetCursel(ByVal gadget As Long) As Long Export
	Function= SendMessage(Cast(hwnd,GadgetID(gadget)),4875,0,0)
End Function
