Archive: Navigating the cursor to nxt field on pressing enter


Navigating the cursor to nxt field on pressing enter
I have a custom page with 3 Dir Request field.while pressing tab from 1st field the focus is going to the dir requst (i.e in the same field to the ...icon)and not the next dir request field.Is it possible to bring the focus to next field


You can set the z-order of the controls using the System plug-in. The z-order sets the tab order of the controls. For example, to reverse the tab order of Field 6, use:

!define SWP_NOSIZE          0x0001
!define SWP_NOMOVE 0x0002
!define SWP_NOACTIVATE 0x0010

ReadINISTr $0 "$PLUGINSDIR\test.ini" "Field 6" "HWND"
ReadINISTr $1 "$PLUGINSDIR\test.ini" "Field 6" "HWND2"
System::Call "user32::SetWindowPos(i $0, i $1, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

Tab order
Is it possible to set the tab order forDir Request Field in NSIS


changing the tab order of the default buttons
Is it possible to change the tab order of the default buttons in a custom page.

I have a custom page with 3 dir request and 1 check box.
the default buttons are cancel back and install.

Now whether it's possible to set the taborder from 3rd dir request to install then to cancel and next to 1st dir request hwnd2.


I've merged all of your threads into this one thread. Don't open so many threads for the same question.

Now, back to the topic, you can use the method I've shown above to change the tab order. That applies to the Cancel, Back and Next buttons as well.


thanks for u'r reply.I got u'r answer and i was able to change the z-order for the fields in my custom page.but, i d'nt know how to change the default button's z-order .if u can plz reply me.


Use the following to get the HWND of the buttons, and then use the same System::Call line, only with those HWNDs, to set the tab order.

GetDlgItem $0 $HWNDPARENT 1 # next button
GetDlgItem $1 $HWNDPARENT 2 # cancel button
GetDlgItem $3 $HWNDPARENT 3 # back button

Hi i tried a lot but not able to change the order for default buttons.Here is my code please help.

From configdir the focus is going to appdirsel but i want the focus to go to the default button.

ReadINISTr $appdir "$PLUGINSDIR\setupscreen.ini" "Field 3" "HWND"
ReadINISTr $appdirsel "$PLUGINSDIR\setupscreen.ini" "Field 3" "HWND2"
ReadINISTr $datadir "$PLUGINSDIR\setupscreen.ini" "Field 5" "HWND"
ReadINISTr $datadirsel "$PLUGINSDIR\setupscreen.ini" "Field 5" "HWND2"
ReadINISTr $configdir "$PLUGINSDIR\setupscreen.ini" "Field 7" "HWND"
ReadINISTr $configdirsel "$PLUGINSDIR\setupscreen.ini" "Field 7" "HWND2"
ReadINISTr $chkbox "$PLUGINSDIR\setupscreen.ini" "Field 8" "HWND"

GetDlgItem $instbtn $HWNDPARENT 1 # next button
GetDlgItem $cnclbtn $HWNDPARENT 2 # cancel button
GetDlgItem $bkbtn $HWNDPARENT 3 # back button
MessageBox MB_ICONEXCLAMATION|MB_OK "$instbtn $cnclbtn $bkbtn"

System::Call "user32::SetWindowPos(i $datadir, i $appdir, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $configdir, i $datadir, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $instbtn, i $configdir, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $appdirsel, i $instbtn, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $datadirsel, i $appdirsel, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $configdirsel, i $datadirsel, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $chkbox, i $configdirsel, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $bkbtn, i $chkbox, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $cnclbtn, i $bkbtn, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

System::Call "user32::SetWindowPos(i $appdir, i $cnclbtn, i 0, i 0, i 0, \
i 0, i ${SWP_NOSIZE}|${SWP_NOMOVE}|${SWP_NOACTIVATE})"

For that, you must make $configdir the last in the tab-order of the custom dialog. After the last control in the custom dialog is reached, it should go to the buttons.


u mean to say that we can't mix the custom dialogs tab order with the default buttons.

the order is like this

appdir->datadir->configdir->instbtn->appdirsel->datadirsel->configdirsel->chkbox->bkbtn->cnclbtn->appdir.

please reply soon.


Is there any possibility to incccrease the custom page size?
Please do help.I want to change the size os the custom page.


No, you can't mix them, as far as I can remember. At least not without a plug-in that'd handle WM_NEXTDLGCTL manually.

You can increase the custom page size by editing the UI file using Resource Hacker. However, that'd change the size of all dialogs in the installer.