|
|
#1 |
|
Member
Join Date: Sep 2003
Posts: 69
|
Mui Button Focus
I would like to draw the focus to the cancel button when the user arrives at the License Page. Is there any way to do this?
Thanks, JAS |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2003
Location: Toronto, Canada
Posts: 227
|
Should be able to do it getting the window handle of the cancel button and then send a WM_SETFOCUS message using SendMessage.
Something like, PHP Code:
|
|
|
|
|
|
#3 |
|
Member
Join Date: Sep 2003
Posts: 69
|
Well, I tried this in LicenseShow:
GetDlgItem $R0 105 1 SendMessage $R0 WM_SETFOCUS 0 0 But it didn't work. It might be that the call to GetDlgItem is wrong. I am not sure what to use for the "dialog" parameter. I used the number id of the three button dialog from the resource file. Also, the docs say something about "if you want the handle of a control on the inner dialog..." and I don't understand what the inner dialog is. Any help would be appreciated. |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Use $HWNDPARENT as dialog. For example:
GetDlgItem $0 $HWNDPARENT 1 NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#5 |
|
Member
Join Date: Sep 2003
Posts: 69
|
Still doesn't work. This is what I have now:
Function LicenseShow GetDlgItem $R0 $HWNDPARENT 2 SendMessage $R0 WM_SETFOCUS 0 0 FunctionEnd But the focus still stays on the memo that shows the license text. Any other ideas? JAS |
|
|
|
|
|
#6 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
${WM_SETFOCUS} instead of WM_SETFOCUS
|
|
|
|
|
|
#7 |
|
Member
Join Date: Sep 2003
Posts: 69
|
This is what I have now:
Function LicenseShow GetDlgItem $R0 $HWNDPARENT 2 SendMessage $R0 ${WM_SETFOCUS} 0 0 FunctionEnd But it's still not working. JAS |
|
|
|
|
|
#8 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
WM_SETFOCUS is actually a notification. To set the focus on a certain button, you should call the SetFocus API using the System plug-in.
http://msdn.microsoft.com/library/de...s/setfocus.asp |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|