2

I found that it's quite easy with nsDialogs to set the focus to a specific control:

${NSD_SETFOCUS} $myHWnd

But is there also a way to select all the text in that control, so that when the user starts typing, what is already there is overwritten?

fretje
  • 8,322
  • 2
  • 49
  • 61

1 Answers1

3

Turns out it's also quite easy using the standard NSIS function SendMessage. You can simply send the EM_SETSEL message with 0 and -1 as parameters:

SendMessage $myHWnd ${EM_SETSEL} 0 -1

This will select all the text in the textbox.

fretje
  • 8,322
  • 2
  • 49
  • 61