I tried to use pteGetSelection() but it only works for "Grids" & "Objects". What is exactly the function for me to return a value of which layer is selected right now in Data Palette? I also tried to find some leLSW* function, but I didn't find any possibilities.
pteGetSelection("Layers") only works if you have enabled the "Multiple selection" option on the palette Options form.
If you want the current entry layer, use leGetEntryLayer() .