View Single Post
Old 23rd June 2010, 04:02   #5
Senior Member
jiake's Avatar
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
You may use the System plugin to create one:
Before creating, first you should get the position of another control and calculate a position using the gotten coordinate for the new control.

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $1 $0 control_id
!insertmacro GetDlgItemRect $1 $2 $3 $4 $0 $1
IntOp $2 $2 + 15
!insertmacro CreateLinker "View my site" $1 $2 50 8 $0 1600 ""

Maybe you would destroy some control and put yours there:
GetDlgItem $1 $0 control_id
System::Call 'User32::DestroyWindow(i r1)'

Some macro written by bluenet:

ButtonLinker plugin is a joint one with the ButtonEvent and the Linker plugin.
In the following macro, you may replace it with the linker plugin.

PHP Code:
Exch $R0 ;HWND
    Exch $R1 
;handle of control
    Push $R2
::Call /NOUNLOAD "*(i, i, t, i, i, i, i, i, i, i, i) i.s"
Pop $R2
::Call /NOUNLOAD 'User32::GetWindowRect(i, i) i (R1, R2)'
System::Call /NOUNLOAD 'User32::ScreenToClient(i, i) i (R0, R2)'
IntOp $R1 $R2 ;sizeof(LPPOINT)*8
::Call /NOUNLOAD 'User32::ScreenToClient(i, i) i (R0, R1)'
Exch 2
    Pop $R0
    Pop $R1
::Call /NOUNLOAD "*$R2(i .s, i .s, i .s, i .s)"
System::Free $R2
    Exch 4
    Pop $R2
PHP Code:
::Call /NOUNLOAD 'Kernel32::GetModuleHandle(t) i (0) .s'
::Call 'User32::CreateWindowEx(i,t,t,i,i,i,i,i,i,i,i,v) i (0,"STATIC","${TEXT}",0x54000000,${LEFT},${TOP},${WIDTH},${HEIGHT},${HWNDPARENT},${CTLID},s,0) .s'
Exch $R0
    Push $R1
    CreateFont $R1 
$(^Font) $(^FontSize)
SendMessage $R0 ${WM_SETFONT$R1 0
    GetDlgItem $R2 
ButtonLinker::CreateLinker /NOUNLOAD $R2 ${LINKADD}
Pop $R2
    Pop $R1
    Pop $R0
jiake is offline   Reply With Quote