Complimenting the author of a textbook
I would think you don't even need to go into much detail: just the fact that you have found the author's work sufficiently helpful that you want to express thanks... will be enough, I think.
That is, ... perhaps contrary to the fake myth that textbook and course-notes writers have large, expressive fan clubs... mostly one feels that one is speaking to the void, with no response. (Nowadays even to keep track of IP addresses of hits on one's site seems to require an extra load of various things equivalent to "Google Analytics", which slow things down enormously, so are not usabe... I remember the relatively-better-old days when I could see the IP addresses of people who hit my web pages...)
I myself do make a point of communicating to people whose writing is especially good, at all levels, especially if it's not "heroic, prize-winning" glamor stuff, but is simply very, very good.
We, collectively, should do more of this, I think.
Sure. Writing a book is a huge amount of work, and everyone likes to hear that their work has been useful to someone. If anything, this is probably more true for books than for papers, since books are typically less useful for career advancement, and are often written with more altruistic motives.
Just be sincere; don't fawn or go over the top. If there are specific aspects of the book that were helpful, mention them specifically. If you have suggestions for improvement, it's fine to mention them too.
Where a textbook differs from a paper is that it is by definition a compilation of work (of others) and generally doesn't contain original research. Therefore, you are right to think about approaching this differently from complimenting a paper.
While it doesn't happen often (and really should happen more often) complimenting or thanking anyone for any kind of effort is a positive thing. You should keep in mind, though, what work actually went into the production of this work. In case of a textbook the majority of the work goes into the selection and parsing of materials to cover which is an entirely separate skillset from research, which you may have corresponded about in the past - and is in fact closer to designing a course on the subject. Therefore, you should slant your praise accordingly.
That said, there are really no 'wrong' ways to do this.