Hi,

is there a way to modify the headers of an explorer folder view using
scripting ?
For example, I want to have my music folders displya artist name, album,
album date etc
Of course I cannot "aplly to all folders" : these settings are nonsense for
photos or system files
And doing it manually is impossible : far too many folders

So I would like to be able to have a script ( or any other way) to apply
some settings to all subloders of current folder
( best would be to read settings of current folder and have them applied to
sublfolders ...)

Possible or MI7 ?

TIA !

Re: Adjust explorer column headers via scripting by Alexander

Alexander
Fri Aug 18 05:02:42 CDT 2006

MoiMeme schrieb:

> is there a way to modify the headers of an explorer folder view using
> scripting ?
> For example, I want to have my music folders displya artist name, album,
> album date etc
> Of course I cannot "aplly to all folders" : these settings are nonsense for
> photos or system files
> And doing it manually is impossible : far too many folders
>
> So I would like to be able to have a script ( or any other way) to apply
> some settings to all subloders of current folder
> ( best would be to read settings of current folder and have them applied to
> sublfolders ...)
>
> Possible or MI7 ?

MI7.
There is afaik no scripting-interface for what you want to achieve.
All you can do, is to change the viewmode of an explorer-instance
from list to details or whatever.
Adding, moving, adjusting columns needs the non-scriptable Shell-API
around the IColumnProvider & SHCOLUMNID :-(

MfG,
Alex

Re: Adjust explorer column headers via scripting by MoiMeme

MoiMeme
Fri Aug 18 06:44:55 CDT 2006

:--(( !

Thanks.

"Alexander Mueller" <millerax@hotmail.com> a écrit dans le message de news:
%23$NYz1qwGHA.5044@TK2MSFTNGP05.phx.gbl...
> MoiMeme schrieb:
>
>> is there a way to modify the headers of an explorer folder view using
>> scripting ?
>> For example, I want to have my music folders displya artist name, album,
>> album date etc
>> Of course I cannot "aplly to all folders" : these settings are nonsense
>> for photos or system files
>> And doing it manually is impossible : far too many folders
>>
>> So I would like to be able to have a script ( or any other way) to apply
>> some settings to all subloders of current folder
>> ( best would be to read settings of current folder and have them applied
>> to sublfolders ...)
>>
>> Possible or MI7 ?
>
> MI7.
> There is afaik no scripting-interface for what you want to achieve.
> All you can do, is to change the viewmode of an explorer-instance
> from list to details or whatever.
> Adding, moving, adjusting columns needs the non-scriptable Shell-API
> around the IColumnProvider & SHCOLUMNID :-(
>
> MfG,
> Alex



Re: Adjust explorer column headers via scripting by mr_unreliable

mr_unreliable
Fri Aug 18 16:03:51 CDT 2006

hi MoiMeme,

As Alexander has said, it can't be done.

But Wait! This is scripting, and anything is possible with
"a little work".

Here's a suggestion. When you want to show your music files,
instead of using (windows) explorer -- use InternetExplorer
(or an HTA, the same thing).

That way, you can make up an html/dhtml page to show your
music files the way you want. As a "first attempt", you
might just use a simple html table. Set up the table
headers to be the column identifiers you want, and then
fill in the rest with your data (from your music folder).

You could do an even better job using of emulating windows
explorer by using a "ListView" control on your IE page --
which is what windows explorer itself uses to show you the
contents of a folder. There are several actX listview controls
around which you can instantiate on your fake (html) explorer
page. And the listview controls will be more flexible, but
harder to program, than an html table.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)


MoiMeme wrote:
> Hi,
>
> is there a way to modify the headers of an explorer folder view using
> scripting ?
> For example, I want to have my music folders displya artist name, album,
> album date etc
> Of course I cannot "aplly to all folders" : these settings are nonsense for
> photos or system files
> And doing it manually is impossible : far too many folders
>
> So I would like to be able to have a script ( or any other way) to apply
> some settings to all subloders of current folder
> ( best would be to read settings of current folder and have them applied to
> sublfolders ...)
>
> Possible or MI7 ?
>
> TIA !
>
>

Re: Adjust explorer column headers via scripting by mr_unreliable

mr_unreliable
Fri Aug 18 16:13:39 CDT 2006

hi MoiMeme,

As Alexander has said, it can't be done.

But Wait! This is scripting, and anything is possible with
"a little work".

Here's a suggestion. When you want to show your music files,
instead of using (windows) explorer -- use InternetExplorer
(or an HTA, the same thing).

That way, you can make up an html/dhtml page to show your
music files the way you want. As a "first attempt", you
might just use a simple html table. Set up the table
headers to be the column identifiers you want, and then
fill in the rest with your data (from your music folder).

You could do an even better job of emulating windows
explorer by using a "ListView" control on your IE page --
which is what windows explorer itself uses to show you the
contents of a folder. There are several actX listview controls
around which you can instantiate on your fake (html) explorer
page. And the listview controls will be more flexible, but
harder to program, than an html table.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)


MoiMeme wrote:
> Hi,
>
> is there a way to modify the headers of an explorer folder view using
> scripting ?
> For example, I want to have my music folders displya artist name, album,
> album date etc
> Of course I cannot "aplly to all folders" : these settings are nonsense for
> photos or system files
> And doing it manually is impossible : far too many folders
>
> So I would like to be able to have a script ( or any other way) to apply
> some settings to all subloders of current folder
> ( best would be to read settings of current folder and have them applied to
> sublfolders ...)
>
> Possible or MI7 ?
>
> TIA !
>
>

(fake) windows explorer, using HTA (ie) by mr_unreliable

mr_unreliable
Sun Aug 20 13:08:27 CDT 2006

This is a multi-part message in MIME format.
--------------010200060209000406080905
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

The attachment is an HTA app file, made up to crudely resemble
windows explorer -- and to show the (music?) files in a folder.

The fake explorer uses a listview control, just as the REAL
windows explorer does. There are various listview controls
available, the one used here is from vb6 as found in mscomctl.ocx.
If you have vb6 installed, or any vb6 app installed you can most
likely find this ocx on your system. You could also use the vb5
version (comctl32.ocx) if you have that. Even if you don't have
some version of the vb compiler, or some vb app installed, you may
be able to find one of the above ocx's on one of the dll download
sites. Also, some pc suppliers will have pre-loaded the vb
common control dll's/ocx's when they deliver their systems to you.
Finally, there are other listview controls out there. For example,
Steve McMahon offers a listview control that is "better"
(more features) than microsoft's.

http://www.vbaccelerator.com/home/VB/Code/Controls/ListView/article.asp

If you try this, you may note that there are no icons for each
file or folder, as windows explorer provides. For this, you
need an imagelist control to work with the listview control.
That requires a "two-pass" process, whereby you scan what's in
the folder and look up (in the registry) what icons to use.
Then there may be some further adjustments necessary to get
the "right size" icon (16x16). Then you set up the imagelist
to contain the icons to use. I believe this is "do-able" from
script -- there is an imagelist control in the ocx -- but
I considered that to be "out-of-the-scope-of-this-project"
(as they say in the business world).

And yes, there is no menubar or toolbar of the sort to be
found with windows explorer. However, there are countless
html/dhtml menubars and toolbars to be found on the various
web development sites. So if you really need one, they are
easy to find.

After all those caveats, is there really any value here?
Could be, if you are looking to display your folder (music,
or any other folder for that matter) in some non-standard way.

The folder displayed by this hta (my documents \ my music)
is built into the code, but easy enough to change. For
more flexibility, one may wish to make the folder a
(command line) parameter.

cheers, jw

--------------010200060209000406080905
Content-Type: text/plain;
name="fakeExplorer_(forMusic).hta.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="fakeExplorer_(forMusic).hta.txt"

<HTML>
<HEAD>
<HTA:APPLICATION ID="ohta" APPLICATIONNAME="testListView"
WINDOWSTATE="normal" SCROLL = "no" BORDERSTYLE="normal" BORDER="thin"
CAPTION="yes" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" ICON="mru.ico"
SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" VERSION="1.0" >

<TITLE> &nbsp;&nbsp; &lt&lt Testing ListView Control w/HTA script &gt&gt </TITLE>

<SCRIPT LANGUAGE="vbScript">
<!--

Option Explicit

' --- global constants ---
Const sMsgBoxCaption = " < Fake Windows Explorer Demo > "
Const wdDlg = 600, htDlg = 400, leftDlg = 100, topDlg = 100
'
Const lvwReport = 3 ' listview "report" format
Const lvwColumnRight = 1 ' align data to the right
'
Dim sMusicFolderSpec ' as string (used in click event handler)

Sub dlgInit() ' dialog initialization
Dim wshShell ' as object

' MsgBox("dialog initialization called")

' do a little adjusting of my size and location...
window.ResizeTo wdDlg,htDlg
window.MoveTo leftDlg,topDlg

' reposition the statusbar to the bottom of the dialog...
With Document.getElementById("statusbar").style
.backgroundcolor = "silver"
.position = "absolute"
.left = 5
.top = Document.Body.clientHeight - 25
.width = Document.Body.clientWidth - 10
End With

With window.document.getElementById("etchedEdge").style
.position = "absolute"
.left = 8
.top = Document.Body.clientHeight - 32
End With

' initialize the listview control...
With oLVW
.Width = Document.Body.clientWidth - 20 ' fit the listview into the dialog
.Height = Document.Body.clientHeight - 35 - 50

.Font.Name = "MS Sans Serif"
.Font.Size = 8
.Font.Bold = False

.View = lvwReport
.ColumnHeaders.Add , , "Name", 250
.ColumnHeaders.Add , , "Size", 80, lvwColumnRight
.ColumnHeaders.Add , , "Type", 80, lvwColumnRight
.ColumnHeaders.Add , , "Modified", 125, lvwColumnRight
End With

' construct path to the music folder of choice (or, look to arguments)...
Set wshShell = CreateObject("WScript.Shell")
sMusicFolderSpec = wshShell.SpecialFolders("MyDocuments") & "\My Music"
Document.title = " Contents of: " & sMusicFolderSpec


Call PopulateListView(sMusicFolderSpec) ' from music folder

End Sub


Sub PopulateListView(sFolderPath)
Dim fso ' as object
Dim oMusicFolder ' as folder object
Dim colFiles, colSubFolders ' as collection(s) (files, folders)
Dim myFile, mySubFolder ' as file,subfolder object
Dim curItem ' as file/folder object

Set fso = CreateObject("Scripting.FileSystemObject")
if NOT (fso.FolderExists(sFolderPath)) Then ' validity check
MsgBox sFolderPath & " is an invalid path" & vbCrLf & _
" this app will terminate now", vbCritical, sMsgBoxCaption
self.Close
End If

Set oMusicFolder = fso.GetFolder(sFolderPath) ' get folder object

Set colFiles = oMusicFolder.Files ' file collection
Set colSubFolders = oMusicFolder.SubFolders ' folder collection

' statusbar message...
Document.getElementById("statusbar").Value = _
" there are: " & CStr(colFiles.Count) & " files in this folder" _
& " (and " & CStr(colSubFolders.Count) & " subfolders too)... "

' fill in the listview entries...
For Each mySubFolder in colSubFolders
' .Add(index, key, text, icon, smallIcon)
Set curItem = oLVW.ListItems.Add( , , mySubFolder.Name)
With curItem
.SubItems(1) = "" ' leave the size blank
.SubItems(2) = mySubFolder.Type ' extension
.SubItems(3) = mySubFolder.DateLastModified
End With
Next

For Each myFile in colFiles
' .Add(index, key, text, icon, smallIcon)
Set curItem = oLVW.ListItems.Add( , , myFile.Name)
With curItem
.SubItems(1) = CStr(myFile.Size\1000) & "KB"
.SubItems(2) = myFile.Type ' extension
.SubItems(3) = myFile.DateLastModified
End With
Next

End Sub


Sub oLVW_Click() ' listview click event handler
Dim selListItem ' as LV item
Dim nReply ' as integer

Set selListItem = oLVW.SelectedItem

Select Case selListItem.SubItems(2) ' what was the item-type selected?
Case "File Folder" : MsgBox("repopulating listbox not supported") : Exit Sub
Case "mp3 file"
nReply = MsgBox("You selected: " & selListItem.Text & vbCrLf & _
" Would you like to play it now", vbQuestion Or vbYesNo, _
sMsgBoxCaption)

if (nReply = vbYes) then PlayTheSelection(selListItem.Text)

Case Else : MsgBox("unsupported file type") : Exit Sub
End Select
End Sub


Sub PlayTheSelection(sSelectedItem)
Dim sSaveStatusMsg ' as string
Dim sPathToSelection
Const bWaitOnReturn = True
Dim wshShell ' as object

sSaveStatusMsg = Document.getElementById("statusbar").Value

sPathToSelection = sMusicFolderSpec & "\" & sSelectedItem

Document.getElementById("statusbar").Value = " Now Playing: " & sPathToSelection

' assume mp3 (for now) and play it...
Set wshShell = CreateObject("WScript.Shell")
' note: wrap the path in quotes, in case of BLANKS in the path ("""" is ONE dq)...
wshShell.Run """" & sPathToSelection & """",, bWaitOnReturn

' assume music player finished, restore statusmsg and return
Document.getElementById("statusbar").Value = sSaveStatusMsg

End Sub

//-->
</SCRIPT>

</HEAD>

<BODY bgcolor="silver" scroll=no onload="dlgInit()" language="vbScript">
<FONT FACE="verdana,arial,helvetica" SIZE=1>
<A HREF="#" ONCLICK="self.close()">Your html/dhtml toolbar goes here...</A>
</FONT><hr>

<!-- this is the vb6 listview control, as found in mscomctl.ocx -->
<OBJECT ID="oLVW" WIDTH=0 HEIGHT=0
CLASSID="CLSID:BDD1F04B-858B-11D1-B16A-00C0F0283628">
</OBJECT>

<hr id="etchedEdge">
<font face="MS Sans Serif" size=2>
<input type=text id="statusbar" align=absbottom
value=" please stand by while the files are being enumerated... ">
<center><BUTTON onclick="self.close()" style="visibility: hidden; "> Close this Dialog </BUTTON></center>
</font>
</BODY>
</HTML>

--------------010200060209000406080905
Content-Type: image/x-icon;
name="Mru.ico"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="Mru.ico"

AAABAAEAICAEAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD/
/wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AA7u7u7u4AAAAAAAAAAAAO7u7u7u7u7uAAAAAAAAAA7u7u7u7u7u7uAAAAAAAADu7u7u7u7u
7u7uAAAAAAAA7u7u7gAA7u7u7gAAAAAADu7u4AAAAAAO7u7gAAAAAA7u7gAAAAAAAO7u4AAA
AAAO7u4AAAAAAADu7uAAAAAADu7uAAAAAAAA7u7gAAAAAO7u7gAAAAAAAO7u7gAAAADu7u4A
AAAAAADu7u4AAAAA7u7gAAAAAAAADu7uAAAAAO7u4AAAAAAAAA7u7gAAAADu7uAAAAAAAAAO
7u4AAAAA7u7gAAAAAAAADu7uAAAAAO7u4AAAAAAAAA7u7gAAAADu7uAAAAAAAAAO7u4AAAAA
7u7gAAAAAAAADu7uAAAAAO7u4AAAAAAAAA7u7gAAAADu7uAAAAAAAAAO7u4AAAAA7u7gAAAA
AAAADu7uAAAAAO7u4AAAAAAAAA7u7gAAAADu7uAAAAAAAAAO7u4AAADu7u7u4AAAAAAO7u7u
7gAA7u7u7uAAAAAADu7u7u4AAO7u7u7gAAAAAA7u7u7uAADu7u7u4AAAAAAO7u7u7gAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////8AD//8A
AP/+AAB//AAAP/gAAB/wAAAP8AGAD/AP+A/wH/gP4B/4B+Af+AfgH/gH4B/4B+A//AfgP/wH
4D/8B+A//AfgP/wH4D/8B+A//AfgP/wH4D/8B+A//AeAD/ABgA/wAYAP8AGAD/ABgA/wAYAP
8AH//////////w==
--------------010200060209000406080905--

Re: (fake) windows explorer, using HTA (ie) by MoiMeme

MoiMeme
Tue Aug 22 15:36:53 CDT 2006

Thanks a lot for these infos.
For your info, I have got an anwser in microsoft.public.windowsxp.customize
by Keith Miller who has written ascript allowing to do it
Have tried it and it works ( done minor mods on smal folder structure as a
test)
Post is dated Aug 18,2006 at 23:11
Original thread posted Aug 15,2006 at 23:37 by AO with thread title
"customize folder CONTENTS in windows explorer"
Will test run your contribution as well
Thanks for taking the time to investigate the question !!
Regards
Phil

"mr_unreliable" <kindlyReplyToNewsgroup@notmail.com> a écrit dans le message
de news: ewUWvLIxGHA.5064@TK2MSFTNGP06.phx.gbl...
> The attachment is an HTA app file, made up to crudely resemble
> windows explorer -- and to show the (music?) files in a folder.
>
> The fake explorer uses a listview control, just as the REAL
> windows explorer does. There are various listview controls
> available, the one used here is from vb6 as found in mscomctl.ocx.
> If you have vb6 installed, or any vb6 app installed you can most
> likely find this ocx on your system. You could also use the vb5
> version (comctl32.ocx) if you have that. Even if you don't have
> some version of the vb compiler, or some vb app installed, you may
> be able to find one of the above ocx's on one of the dll download
> sites. Also, some pc suppliers will have pre-loaded the vb
> common control dll's/ocx's when they deliver their systems to you.
> Finally, there are other listview controls out there. For example,
> Steve McMahon offers a listview control that is "better"
> (more features) than microsoft's.
>
> http://www.vbaccelerator.com/home/VB/Code/Controls/ListView/article.asp
>
> If you try this, you may note that there are no icons for each
> file or folder, as windows explorer provides. For this, you
> need an imagelist control to work with the listview control.
> That requires a "two-pass" process, whereby you scan what's in
> the folder and look up (in the registry) what icons to use.
> Then there may be some further adjustments necessary to get
> the "right size" icon (16x16). Then you set up the imagelist
> to contain the icons to use. I believe this is "do-able" from
> script -- there is an imagelist control in the ocx -- but
> I considered that to be "out-of-the-scope-of-this-project"
> (as they say in the business world).
>
> And yes, there is no menubar or toolbar of the sort to be
> found with windows explorer. However, there are countless
> html/dhtml menubars and toolbars to be found on the various
> web development sites. So if you really need one, they are
> easy to find.
>
> After all those caveats, is there really any value here?
> Could be, if you are looking to display your folder (music,
> or any other folder for that matter) in some non-standard way.
>
> The folder displayed by this hta (my documents \ my music)
> is built into the code, but easy enough to change. For
> more flexibility, one may wish to make the folder a
> (command line) parameter.
>
> cheers, jw
>


--------------------------------------------------------------------------------


> <HTML>
> <HEAD>
> <HTA:APPLICATION ID="ohta" APPLICATIONNAME="testListView"
> WINDOWSTATE="normal" SCROLL = "no" BORDERSTYLE="normal" BORDER="thin"
> CAPTION="yes" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" ICON="mru.ico"
> SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" VERSION="1.0" >
>
> <TITLE> &nbsp;&nbsp; &lt&lt Testing ListView Control w/HTA script &gt&gt
> </TITLE>
>
> <SCRIPT LANGUAGE="vbScript">
> <!--
>
> Option Explicit
>
> ' --- global constants ---
> Const sMsgBoxCaption = " < Fake Windows Explorer Demo > "
> Const wdDlg = 600, htDlg = 400, leftDlg = 100, topDlg = 100
> '
> Const lvwReport = 3 ' listview "report" format
> Const lvwColumnRight = 1 ' align data to the right
> '
> Dim sMusicFolderSpec ' as string (used in click event handler)
>
> Sub dlgInit() ' dialog initialization
> Dim wshShell ' as object
>
> ' MsgBox("dialog initialization called")
>
> ' do a little adjusting of my size and location...
> window.ResizeTo wdDlg,htDlg
> window.MoveTo leftDlg,topDlg
>
> ' reposition the statusbar to the bottom of the dialog...
> With Document.getElementById("statusbar").style
> .backgroundcolor = "silver"
> .position = "absolute"
> .left = 5
> .top = Document.Body.clientHeight - 25
> .width = Document.Body.clientWidth - 10
> End With
>
> With window.document.getElementById("etchedEdge").style
> .position = "absolute"
> .left = 8
> .top = Document.Body.clientHeight - 32
> End With
>
> ' initialize the listview control...
> With oLVW
> .Width = Document.Body.clientWidth - 20 ' fit the listview into the
> dialog
> .Height = Document.Body.clientHeight - 35 - 50
>
> .Font.Name = "MS Sans Serif"
> .Font.Size = 8
> .Font.Bold = False
>
> .View = lvwReport
> .ColumnHeaders.Add , , "Name", 250
> .ColumnHeaders.Add , , "Size", 80, lvwColumnRight
> .ColumnHeaders.Add , , "Type", 80, lvwColumnRight
> .ColumnHeaders.Add , , "Modified", 125, lvwColumnRight
> End With
>
> ' construct path to the music folder of choice (or, look to arguments)...
> Set wshShell = CreateObject("WScript.Shell")
> sMusicFolderSpec = wshShell.SpecialFolders("MyDocuments") & "\My Music"
> Document.title = " Contents of: " & sMusicFolderSpec
>
>
> Call PopulateListView(sMusicFolderSpec) ' from music folder
>
> End Sub
>
>
> Sub PopulateListView(sFolderPath)
> Dim fso ' as object
> Dim oMusicFolder ' as folder object
> Dim colFiles, colSubFolders ' as collection(s) (files, folders)
> Dim myFile, mySubFolder ' as file,subfolder object
> Dim curItem ' as file/folder object
>
> Set fso = CreateObject("Scripting.FileSystemObject")
> if NOT (fso.FolderExists(sFolderPath)) Then ' validity check
> MsgBox sFolderPath & " is an invalid path" & vbCrLf & _
> " this app will terminate now", vbCritical, sMsgBoxCaption
> self.Close
> End If
>
> Set oMusicFolder = fso.GetFolder(sFolderPath) ' get folder object
>
> Set colFiles = oMusicFolder.Files ' file collection
> Set colSubFolders = oMusicFolder.SubFolders ' folder collection
>
> ' statusbar message...
> Document.getElementById("statusbar").Value = _
> " there are: " & CStr(colFiles.Count) & " files in this folder" _
> & " (and " & CStr(colSubFolders.Count) & " subfolders too)... "
>
> ' fill in the listview entries...
> For Each mySubFolder in colSubFolders
> ' .Add(index, key, text, icon, smallIcon)
> Set curItem = oLVW.ListItems.Add( , , mySubFolder.Name)
> With curItem
> .SubItems(1) = "" ' leave the size blank
> .SubItems(2) = mySubFolder.Type ' extension
> .SubItems(3) = mySubFolder.DateLastModified
> End With
> Next
>
> For Each myFile in colFiles
> ' .Add(index, key, text, icon, smallIcon)
> Set curItem = oLVW.ListItems.Add( , , myFile.Name)
> With curItem
> .SubItems(1) = CStr(myFile.Size\1000) & "KB"
> .SubItems(2) = myFile.Type ' extension
> .SubItems(3) = myFile.DateLastModified
> End With
> Next
>
> End Sub
>
>
> Sub oLVW_Click() ' listview click event handler
> Dim selListItem ' as LV item
> Dim nReply ' as integer
>
> Set selListItem = oLVW.SelectedItem
>
> Select Case selListItem.SubItems(2) ' what was the item-type selected?
> Case "File Folder" : MsgBox("repopulating listbox not supported") :
> Exit Sub
> Case "mp3 file"
> nReply = MsgBox("You selected: " & selListItem.Text & vbCrLf & _
> " Would you like to play it now", vbQuestion Or vbYesNo, _
> sMsgBoxCaption)
>
> if (nReply = vbYes) then PlayTheSelection(selListItem.Text)
>
> Case Else : MsgBox("unsupported file type") : Exit Sub
> End Select
> End Sub
>
>
> Sub PlayTheSelection(sSelectedItem)
> Dim sSaveStatusMsg ' as string
> Dim sPathToSelection
> Const bWaitOnReturn = True
> Dim wshShell ' as object
>
> sSaveStatusMsg = Document.getElementById("statusbar").Value
>
> sPathToSelection = sMusicFolderSpec & "\" & sSelectedItem
>
> Document.getElementById("statusbar").Value = " Now Playing: " &
> sPathToSelection
>
> ' assume mp3 (for now) and play it...
> Set wshShell = CreateObject("WScript.Shell")
> ' note: wrap the path in quotes, in case of BLANKS in the path ("""" is
> ONE dq)...
> wshShell.Run """" & sPathToSelection & """",, bWaitOnReturn
>
> ' assume music player finished, restore statusmsg and return
> Document.getElementById("statusbar").Value = sSaveStatusMsg
>
> End Sub
>
> //-->
> </SCRIPT>
>
> </HEAD>
>
> <BODY bgcolor="silver" scroll=no onload="dlgInit()" language="vbScript">
> <FONT FACE="verdana,arial,helvetica" SIZE=1>
> <A HREF="#" ONCLICK="self.close()">Your html/dhtml toolbar goes
> here...</A>
> </FONT><hr>
>
> <!-- this is the vb6 listview control, as found in mscomctl.ocx -->
> <OBJECT ID="oLVW" WIDTH=0 HEIGHT=0
> CLASSID="CLSID:BDD1F04B-858B-11D1-B16A-00C0F0283628">
> </OBJECT>
>
> <hr id="etchedEdge">
> <font face="MS Sans Serif" size=2>
> <input type=text id="statusbar" align=absbottom
> value=" please stand by while the files are being enumerated... ">
> <center><BUTTON onclick="self.close()" style="visibility: hidden; ">
> Close this Dialog </BUTTON></center>
> </font>
> </BODY>
> </HTML>
>