I would start with Programming Windows by Charles Petzold.
Not all windows can have selected text. Maybe you are interested only in textbox, listbox, or editbox windows. There are SelctionStart and SelectedText properties for these kinbds of windows. Google might help here.
Thanks for the post.
Maybe anyone have this book in electronic format ? :)
I'm interested not only in textbox'es, but anywhere in window.
Maybe I'll change the question.
Text is only what I need, but I, first of all, want know if anything is selected at all.