Need curly buttons
Using UMUI . I need oval shaped buttons instead of rectangle. Please advise
5 posts
!addincludedir "."
!addplugindir "."
!include "LogicLib.nsh"
!include "MUI2.nsh"
!include "winMessages.nsh"
!include "nsDialogs.nsh"
OutFile "test.exe"
Section
SectionEnd
Var dialog
Var hwnd
Var null
Var hwnd_listbox
Var hwnd_bitmap
Var res_bmp
Page Custom customPage
Function customPage
nsDialogs::Create 1018
Pop $dialog
/* Unpack bitmap files in advance */
InitPluginsDir
SetOutPath "$PluginsDir"
File "a.bmp"
File "b.bmp"
${NSD_CreateBitmap} 25% 0 190 171 ""
Pop $hwnd_bitmap
${NSD_SetImage} $hwnd_bitmap "$PluginsDir\a.bmp" $res_bmp
nsDialogs::SetUserData $hwnd_bitmap "a.bmp"
${NSD_OnClick} $hwnd_bitmap custompage.bitmap.onclick
nsDialogs::Show
${NSD_FreeImage} $res_bmp
FunctionEnd
Function custompage.bitmap.onclick
Pop $hwnd
/* Get control's rect on screen */
System::Call "*(i, i, i, i) i .r1"
System::Call "User32::GetWindowRect(i, i) i ($hwnd, r1) .r2"
System::Call "*$1(i, i, i, i) i (.r2, .r3, .r4, .r5)"
/* Get mouse cursor's position on screen */
System::Call "*(l, l) i .r6"
System::Call "User32::GetCursorPos(i) i (r6) .r7"
System::Call "*$6(i, i) i (.r7, .r8)"
/* Derive mouse cursor position relative to control */
IntOp $0 $7 - $2
IntOp $1 $8 - $3
/* Do something with that cursor position information here, perhaps */
/* MessageBox MB_OK "Cursor position relative to control: $0x$1" */
nsDialogs::GetUserData $hwnd_bitmap "a.bmp"
Pop $0
${Select} $0
${Case} "a.bmp"
StrCpy $1 "b.bmp"
${Default}
StrCpy $1 "a.bmp"
${EndSelect}
${NSD_FreeImage} $res_bmp
${NSD_SetImage} $hwnd_bitmap "$PluginsDir\$1" $res_bmp
nsDialogs::SetUserData $hwnd_bitmap "$1"
FunctionEnd
!insertmacro MUI_LANGUAGE "English"