Skip to content
⌘ NSIS Forum Archive

Setting focus on cotrols

8 posts

Yurik#

Setting focus on cotrols

How to set focus on text edit control? I understand that I can obtain a handle for a control, but there's no function like SetFocus(handle)?

It is useful for setting cursor on text edit with incorrect user input.

Thanks.
deguix#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
Yurik#
Originally posted by deguix
http://forums.winamp.com/showthread....59#post1444459
This seems to be working with Modern UI (since I'm using MUI_INSTALLOPTIONS_DISPLAY. Maybe there're some another ways to specify an initial control?
deguix#
You mean, another way to specify the initial control for focus? The first field specifies the first control to have focus. If the control can't have focus (like labels) then the next control will have it.
Yurik#
Originally posted by deguix
You mean, another way to specify the initial control for focus? The first field specifies the first control to have focus. If the control can't have focus (like labels) then the next control will have it.
Sorry, I've missed 'not' word: I cannot make this way work. If I write something like

...
Call SetFocus
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioMyDlg.ini"

the focus is on the first focusable element, not on specified for SetFocus.
deguix#
You have to load the ini file first using !insertmacro MUI_INSTALLOPTIONS_INITDIALOG and then use !insertmacro MUI_INSTALLOPTIONS_SHOW to show it.