Is there a way to get a return string value from TTaskDialog like a Pin number . I can't see a way.
While, yes, TTaskDialog is very configurable, its really just an "information" dialog meant to show some info to the user, not to ask her for anything.
What you do have is quite a lot of simple "dialogs" in the Dialogs unit, each more or less specialized in getting some kind info from the user: InputBox, InputCombo, InputQuery, PasswordBox, QuestionDialog, .... and for most of them you just have to do something like, for example:
MyString := InputBox('Name', 'Please, enter your name:', '')
which will do basically the same than Handoko's code, though it's not quite as configurable as you wanted.
But since you tried InputQuery I guess you knew it already