after many attempts, i finally found the correct win32 call, having a few problems getting it to work properly though:
' createtextarea.bmx
Strict
Extern "win32"
Function CreateCaret(hWnd,hBitmap:Byte Ptr,nWidth,nHeight)
Function ShowCaret(hWnd)
End Extern
Local window:TGadget
Local textarea:TGadget
window=CreateWindow("My Window",130,20,200,200,,15|WINDOW_ACCEPTFILES)
textarea=CreateTextArea(0,0,ClientWidth(window),ClientHeight(window)/2,window)
SetGadgetLayout textarea,1,1,1,1
SetGadgetText textarea,"a textarea gadget~none line~nandanother"
ActivateGadget textarea
Local hwnd,caret
hwnd=QueryGadget(textarea,QUERY_HWND)
While WaitEvent()
Print CurrentEvent.ToString()+" "+EventSourceHandle()
Select EventID()
Case EVENT_GADGETACTION,EVENT_GADGETSELECT
caret=CreateCaret(hwnd,Null,2,12)
ShowCaret(hwnd)
DebugLog "caret="+caret
Case EVENT_WINDOWCLOSE
End
Case EVENT_APPTERMINATE
End
End Select
Wend