页面上的图像 – 从文件

OutFile "ICO_DLL-test.exe"
!include nsDialogs.nsh
Page custom CreatePage

Function CreatePage
nsDialogs::Create 1018
Pop $0

; i* : ID的图标 - 从可执行文件(.exe),或DLL

 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "explorer.exe", i 0) i.R0'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "mydocs.dll", i 0) i.R1'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 17) i.R2'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 32) i.R3'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 31) i.R4'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 34) i.R5'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 71) i.R6'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 113) i.R7'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 116) i.R8'
 System::Call 'shell32::ExtractIcon(i $HWNDPARENT, t "shell32.dll", i 130) i.R9'

 ${NSD_CreateIcon} 0u 0u 30u 30u "icon1"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R0
 ${NSD_CreateIcon} 40u 0u 30u 30u "icon2"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R1
 ${NSD_CreateIcon} 80u 0u 30u 30u "icon3"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R2
 ${NSD_CreateIcon} 120u 0u 30u 30u "icon4"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R3
 ${NSD_CreateIcon} 160u 0u 30u 30u "icon5"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R4
 ${NSD_CreateIcon} 0u 40u 30u 30u "icon6"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R5
 ${NSD_CreateIcon} 40u 40u 30u 30u "icon7"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R6
 ${NSD_CreateIcon} 80u 40u 30u 30u "icon8"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R7
 ${NSD_CreateIcon} 120u 40u 30u 30u "icon9"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R8
 ${NSD_CreateIcon} 160u 40u 30u 30u "icon10"
 Pop $0
 SendMessage $0 ${STM_SETIMAGE} ${IMAGE_ICON} $R9

 nsDialogs::Show

 System::Call 'user32::DestroyIcon(iR0)'
 System::Call 'user32::DestroyIcon(iR1)'
 System::Call 'user32::DestroyIcon(iR2)'
 System::Call 'user32::DestroyIcon(iR3)'
 System::Call 'user32::DestroyIcon(iR4)'
 System::Call 'user32::DestroyIcon(iR5)'
 System::Call 'user32::DestroyIcon(iR6)'
 System::Call 'user32::DestroyIcon(iR7)'
 System::Call 'user32::DestroyIcon(iR8)'
 System::Call 'user32::DestroyIcon(iR9)'
FunctionEnd

Section
SectionEnd
THE END
喜欢就支持一下吧
点赞14 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容