Skip to content
⌘ NSIS Forum Archive

Help Button

22 posts

hanenjom#

Help Button

Please can you help me,

i need to add a Help Button, and in my Result i need to have a window (.ini), i have a solution
HelpButton::show /NOUNLOAD "232,231" "Help" "Dialog" "/file=C:\NSIS\.....\file.ini" wrap 20
but i hve in result the .ini in lines no a window.
how can i change the HelpButton.dll to display my file.ini.


think you
Afrow UK#
The window only displays text. You can't have it showing a custom page. If you want to have a custom page with help information on it, either put it in another executable and extract and run it or add a custom page and only show it when your help button is pressed (don't need HelpButton for this).

Stu
hanenjom#
think for your answers,

but my problem is "how could I call a page from a help button that will contain components such as GroupBox and Label".


Please help me
Afrow UK#

  1. Add a help button (if it's via Resource Hacker then use ButtonEvent plug-in on it)
  2. On click, set a global Var (i.e. $ShowHelp) to 1
  3. Jump to your help page


In your help page's show function, call Abort if $ShowHelp != 1. Also ensure you reset $ShowHelp to 0 when you leave the help page.

The only issue really is that when you enter the help page, the back or next buttons won't take you back to where you were when you clicked the Help button. For that reason to be honest it'd be easier to have a pop-up.

Stu
hanenjom#
Re

Hi, in fact am little bit confused here, the pop-up you mentioned earlier you mean a message_box or a whole custom page? cause this last one always ,as you know ,contains the three useless button, (next,back and cancel ).
thnks
Afrow UK#
If you want a custom page pop-up, use nsWindows (as mentioned already) which is a modified version of nsDialogs. The other option as I said would be to bundle another NSIS EXE which has one custom page and extract and run that (probably messier than nsWindows).

Stu
jiake#
Create a pop-up dialog with web control, list view and tree view with checkboxes.


See this example script.
hanenjom#
button to close

Please i need a button to close my custom popup , and return to the origin page.
i create the button, but i have a problem with the event to add on to close.
can you help me please?
thx
jiake#
In this example I use $0 multiple times for dialog handle and other controls. If you want to send message to dialog handle, make sure the value of the variable for dialog's handle in dialog creation function is always the same, use the variable only once.

nsWindows::Create $HWNDPARENT 0 ${WS_VISIBLE}|${WS_SYSMENU}|${WS_CAPTION} "Pop-up dialog" 1018
Pop $0 # handle of dialog

If you use $0 for dialog handle, the variable wouldn't be used again in all event funtions of controls on this dialog. I think you should know.
hanenjom#
re

hi,

please, I still can not find how to leave the window and return to the calling page via the button 😕.

I need your help.

thx.
hanenjom#
hi,

please, I still can not find how to leave the window and return to the calling page via the button .

I need your help.

thx.
Afrow UK#
In your button event use:
SendMessage $handle ${WM_CLOSE} 0 0
Where $handle has been mentioned already.

Stu
hanenjom#
re

Hi

I try to do this for my close button

Function help
${NSW_CreateButton} 50% 84% 10% 5% "OK"
Pop $R1

${NSW_OnClick} $R1 CloseCustomDialog

nsWindows::Show
FunctionEnd

Function CloseCustomDialog

SendMessage $HWNDPARENT ${WS_CLOSE} 0 0

FunctionEnd

and it's still not working 😐

Please help me.
Afrow UK#
It's WM_CLOSE not WS_CLOSE. Where did you get WS_CLOSE from? You should be seeing a compiler warning "unknown variable/constant "{WS_CLOSE}" detected, ignoring" if you haven't defined WS_CLOSE. Don't ignore ANY compiler warnings.

Stu
Afrow UK#
That's because you're using $HWNDPARENT which is a handle to the NSIS window. You want the handle returned from nsWindow::Create as we have already explained.

Stu
hanenjom#
re

thx for your answers, now i can close my Dialog.

juste my problem is how retur to the parent window?

I have a custom page, when i click in my help button i lost my custom page , she disappears.

how could I stay on the same custom page during the call and help when I close my dialog?

can you help me please.
hanenjom#
hi, please i use the help button , but i have a problem,
when I click in my help button I lost my parent page and I have a other page,
how can I still in my parent Page.
my parent page is a custom page.

I use this code :
when i click in my button help i call "CreateHelpButton"

Function CreateHelpButton

nsDialogs::Create 1018
Pop $0

StrCmp $0 error 0 +2
Abort
call CreateCustomDialog

nsDialogs::Show

FunctionEnd

Function CreateCustomDialog

Pop $0
nsWindows::Create $0 0 ${WS_VISIBLE}|${WS_SYSMENU}|${WS_CAPTION} "Help dialog" 1018
Pop $1

${NSW_SetWindowSize} $1 500 350
${NSW_CenterWindow} $1 $HWNDPARENT

StrCmp $1 error 0 +2
Abort

EnableWindow $0 0

${NSW_CreateGroupBox} 3% 4% 90% 10% "blabal"
Pop $R0
${NSW_CreateLabel} 8% 8% 70% 5% "blabal"
Pop $R1

${NSW_CreateGroupBox} 3% 19% 90% 10% "blabal"
Pop $R2
${NSW_CreateLabel} 8% 23% 70% 5% "blabal"
Pop $R3

${NSW_CreateGroupBox} 3% 34% 90% 10% "blabal"
Pop $R4
${NSW_CreateLabel} 8% 38% 70% 5% "blabal"
Pop $R5

${NSW_CreateGroupBox} 3% 49% 90% 10% "blabal"
Pop $R6
${NSW_CreateLabel} 8% 53% 70% 5% "blabal"
Pop $R7

${NSW_CreateGroupBox} 3% 64% 90% 10% "blabal"
Pop $R8
${NSW_CreateLabel} 8% 68% 70% 5% " blabal"
Pop $R9

${NSW_CreateButton} 50% 84% 10% 5% "OK"
Pop $R1

${NSW_OnClick} $R1 CloseCustomDialog
nsWindows::Show
FunctionEnd

Function CloseCustomDialog

SendMessage $1 ${WM_CLOSE} 0 0

FunctionEnd