Old 17th December 2007, 09:23   #1
andryou
Junior Member
 
Join Date: Dec 2007
Posts: 3
PassDialog - Password SetFocus Problem

Hi all,

I'd like to know how I can set focus to the password box (I am using the password-only parameter).

PHP Code:
!define IDC_PASSWORD 1211
...
Function 
PasswordPageShow

 
!insertmacro MUI_HEADER_TEXT "Enter Password" "Enter your password to continue."

 
PassDialog::InitDialog /NOUNLOAD Password /HEADINGTEXT "Enter a password"
  
Pop $R0 # Page HWND

  
GetDlgItem $R1 $R0 ${IDC_PASSWORD}
  
SendMessage $R1 ${EM_SETPASSWORDCHAR178 0

 PassDialog
::Show

FunctionEnd 
Thanks!

I've searched through the forums, and tried the System::Call "user32::SetFocus(i r1, i 0x0007, i,i)i" code, but it doesn't seem to work.

I am using the PassDialog plugin: http://nsis.sourceforge.net/PassDialog_plug-in
andryou is offline   Reply With Quote
Old 17th December 2007, 20:11   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You passed SetFocus the wrong parameter and some extra unnecessary parameters. It's R1 and not r1 and the 3 extra parameters shouldn't be there.
code:
System::Call user32::SetFocus(iR1)

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 18th December 2007, 05:08   #3
andryou
Junior Member
 
Join Date: Dec 2007
Posts: 3
kichik,

Many thanks, I appreciate the reply =] Unfortunately, the code doesn't work, it still doesn't set focus to the password box.

Attached is my script. Can you please let me know where to place it?

Thanks!
Attached Files
File Type: nsi copy of mount.nsi (1.2 KB, 320 views)
andryou is offline   Reply With Quote
Old 18th December 2007, 21:23   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You override $R0 in your script with the HWND of the Next button. You also got IDC_PASSWORD wrong. It's 1214 and not 1211.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 19th December 2007, 02:04   #5
andryou
Junior Member
 
Join Date: Dec 2007
Posts: 3
That did it, thanks!
andryou is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump