Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   How to access a SysListView32 control (http://forums.winamp.com/showthread.php?t=319407)

jiake 24th May 2010 07:16

How to access a SysListView32 control
 
1 Attachment(s)
I write a script to create a SysListView32 control using nsDialogs, but it could only show a box. I want to insert columns and items into it, but after read the Messages of SysListView32 control at MSDN, I know that I must use API to access this control as some of the messages need "the pointer to an LVCOLUMN structure that contains the attributes of the new column".
http://forums.winamp.com/attachment....1&d=1274685598
I don't know how to use System plug-in to access it. I hope that nsDialogs provide more controls support, such as msctls_trackbar32, SysListView32, SysTreeView32 etc. in future.
PHP Code:

!include "MUI2.nsh"
;!include "UsefulLib.nsh"

Name "List View"
OutFile SysListView32.exe
InstallDir $TEMP

ShowInstDetails Show

Page custom CreatePage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

Section Install

SectionEnd

Function CreatePage

    
!insertmacro MUI_HEADER_TEXT "List view control" "A SysListView32 control created by nsDialogs plugin"

    
nsDialogs::Create 1018
    Pop 
$0
    
${If} $== error
        Abort
    
${EndIf}
    
    ${
NSD_CreateLabel0u 0u 300u 8u "Please specify the target folder where to install this software:"
    
Pop $1
    
${NSD_CreateFileRequest0u 12u 232u 12u "D:\TTPlayer"
    
Pop $2
    
${NSD_CreateBrowseButton240u 12u 60u 12u "&Browse..."
    
Pop $3
    
${NSD_OnClick} $3 DirSelect
    
${NSD_CreateGroupBox0u 28u 300u 112u "Drive space:"
    
Pop $4
    
!define IDC_LISTVIEW        1600
    
!define LVS_REPORT          0x00000001
    
!define LVS_SINGLESEL       0x00000004
    
!define LVM_SETBKCOLOR      0x00001001
    
!define LVM_INSERTITEM      0x00001007
    
!define LVM_INSERTCOLUMN    0x0000101B
    
!define LVM_SETCOLUMNWIDTH  0x0000101E
    
Using nsDialogs
    nsDialogs
::CreateControl /NOUNLOAD SysListView32 ${DEFAULT_STYLES}|${WS_TABSTOP}|${LVS_REPORT}|${LVS_SINGLESEL} ${WS_EX_CLIENTEDGE5u 40u 290u 95u "ListView"
    
Pop $5
    
Using Win32 API
    
# FindWindow $0 "#32770" "" $HWNDPARENT
    # System::Call 'kernel32::GetModuleHandle(i 0) i.r5'
    # System::Call 'user32::CreateWindowEx(i ${WS_EX_CLIENTEDGE}, t "SysListView32", t "", i ${DEFAULT_STYLES}|${WS_TABSTOP}|${LVS_REPORT}|${LVS_SINGLESEL}, i 8, i 65, i 434, i 154, i $0, i ${IDC_LISTVIEW}, i r5, i 0) i.r5'
    
SendMessage $${LVM_SETBKCOLOR0 0xC7EDCC
    nsDialogs
::Show
FunctionEnd

Function DirSelect

    
${NSD_GetText} $2 $R0
    nsDialogs
::SelectFolderDialog "$(^DirBrowseText)" "$R0"
    
Pop $R0
    
${IfNot$R0 == error
        
${NSD_SetText} $2 $R0
    
${EndIf}

FunctionEnd 


Animaether 24th May 2010 10:54

until somebody abstracts the System plugin calls to manipulate these, you might be easier off with either http://nsis.sourceforge.net/EmbeddedLists_plug-in or http://nsis.sourceforge.net/InstallOption****plug-in

jiake 1st July 2010 02:29

1 Attachment(s)
Hey, a person (username gfm688) in Dreams8.com write it to access the ListView control, and I made a demo using it:
http://forums.winamp.com/attachment....chmentid=47188

JohaViss 1st July 2010 09:08

Hi Jiake,

This looks great.:cool:
Any chance to provide the source to this?

jiake 1st July 2010 12:21

Quote:

Originally Posted by JohaViss (Post 2676676)
Hi Jiake,

This looks great.:cool:
Any chance to provide the source to this?

See this thread:
http://forums.winamp.com/showthread.php?p=2676715


All times are GMT. The time now is 17:52.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.