added small usage examples
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3703 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
07eb9b6425
commit
38b693f19a
24 changed files with 618 additions and 23 deletions
|
@ -14,30 +14,47 @@ Creates a font and puts its handle into user_var. For more information about the
|
|||
|
||||
You can get the current font used by NSIS using the ^Font and ^FontSize \R{langstring}{LangString}s.
|
||||
|
||||
\c !include WinMessages.nsh
|
||||
\c GetDlgItem $$0 $HWNDPARENT 1
|
||||
\c CreateFont $1 "Times New Roman" "7" "700" /UNDERLINE
|
||||
\c SendMessage $0 ${WM_SETFONT} $1 1
|
||||
|
||||
\S2{detailprint} DetailPrint
|
||||
|
||||
\c user_message
|
||||
|
||||
Adds the string "user_message" to the details view of the installer.
|
||||
|
||||
\c DeteailPrint "this message will show on the installation window"
|
||||
|
||||
\S2{enablewindow} EnableWindow
|
||||
|
||||
\c hwnd (1|0)
|
||||
|
||||
Enables or disables mouse and keyboard input to the specified window or control. Possible states are 0 (disabled) or 1 (enabled).
|
||||
|
||||
\c GetDlgItem $0 $HWNDPARENT 1
|
||||
\c EnableWindow $0 0
|
||||
\c Sleep 1000
|
||||
\c EnableWindow $0 1
|
||||
|
||||
\S2{findwindow} FindWindow
|
||||
|
||||
\c user_var(hwnd output) windowclass [windowtitle] [windowparent] [childafter]
|
||||
|
||||
Searches for a window. Behaves like the win32 FindWindowEx(). Searches by windowclass (and/or windowtitle if specified). If windowparent or childafter are specified, the search will be restricted as such. If windowclass or windowtitle is specified as "", they will not be used for the search. If the window is not found, the user variable returned is 0. To accomplish old-style FindWindow behavior, use FindWindow with SendMessage.
|
||||
|
||||
\c FindWindow $0 "#32770" "" $HWNDPARENT
|
||||
\c FIndWindow $0 "my window class" "my window title"
|
||||
|
||||
\S2{getdlgitem} GetDlgItem
|
||||
|
||||
\c user_var(output) dialog item_id
|
||||
|
||||
Retrieves the handle of a control identified by item_id in the specified dialog box dialog. If you want to get the handle of a control on the inner dialog, first use FindWindow user_var(output) "#32770" "" $HWNDPARENT to get the handle of the inner dialog.
|
||||
|
||||
\c GetDlgItem $0 $HWNDPARENT 1 # next/install button
|
||||
|
||||
\S2{hidewindow} HideWindow
|
||||
|
||||
Hides the installer.
|
||||
|
@ -48,6 +65,12 @@ Hides the installer.
|
|||
|
||||
If HWND is a window, Gotos jump_if_window, otherwise, Gotos jump_if_not_window (if specified).
|
||||
|
||||
\c GetDlgItem $0 $HWNDPARENT 1
|
||||
\c IsWindow 0 +3
|
||||
\c MessageBox MB_OK "found a window"
|
||||
\c Goto +2
|
||||
\c MessageBox MB_OK "no window"
|
||||
|
||||
\S2{sendmessage} SendMessage
|
||||
|
||||
\c HWND msg wparam lparam [user_var(return value)] [/TIMEOUT=time_in_ms]
|
||||
|
@ -66,6 +89,10 @@ To send a string param, put STR: before the parameter, for example: "STR:Some st
|
|||
|
||||
Use /TIMEOUT=time_in_ms to specify the duration, in milliseconds, of the time-out period.
|
||||
|
||||
\c !include WinMessages.nsh
|
||||
\c FindWindow $0 "Winamp v1.x"
|
||||
\c SendMessage $0 ${WM_CLOSE} 0 0
|
||||
|
||||
\S2{setautoclose} SetAutoClose
|
||||
|
||||
\c true|false
|
||||
|
@ -90,22 +117,34 @@ Shows or hides the details, depending on which parameter you pass. Overrides the
|
|||
|
||||
Sets mode at which commands print their status. None has commands be quiet, listonly has status text only added to the listbox, textonly has status text only printed to the status bar, and both enables both (the default). For extracting many small files, textonly is recommended (especially on win9x with smooth scrolling enabled).
|
||||
|
||||
\c SetDetailsPrint none
|
||||
\c File "secret file.dat"
|
||||
\c SetDetailsPrint both
|
||||
|
||||
\S2{setctlcolors} SetCtlColors
|
||||
|
||||
\c hwnd [/BRANDING] [text_color] [transparent|bg_color]
|
||||
|
||||
Sets a background color and the text color for a static control, edit control, button or a dialog. Use GetDlgItem to get the handle (HWND) of the control. To make the control transparent specify "transparent" as the background color value. You can also specify /BRANDING with or without text color and background color to make the control completely gray (or any other color you choose). This is used by the branding text control in the MUI.
|
||||
|
||||
\c FindWindow $0 "#32770" "" $HWNDPARENT
|
||||
\c GetDlgItem $0 $0 1006
|
||||
\c SetCtlColors $0 0xFF0000 0x00FF00
|
||||
|
||||
\S2{setsilent} SetSilent
|
||||
|
||||
\c silent | normal
|
||||
|
||||
Sets the installer to silent mode or normal mode. See \R{asilentinstall}{SilentInstall} for more information about silent installations. Can only be used in \R{oninit}{.onInit}.
|
||||
|
||||
Sets the installer
|
||||
|
||||
\S2{showwindow} ShowWindow
|
||||
|
||||
\c hwnd show_state
|
||||
|
||||
Sets the visability of a window. Possible show_states are the same as \W{http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/showwindow.asp}{Windows ShowWindow} function. SW_* constants are defined in \L{../Include/WinMessages.nsh}{Include\\WinMessages.nsh}.
|
||||
|
||||
\c !include WinMessages.nsh
|
||||
\c GetDlgItem $0 $HWNDPARENT 1
|
||||
\c ShowWindow $0 ${SW_HIDE}
|
||||
\c Sleep 1000
|
||||
\c ShowWindow $0 ${SW_SHOW}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue