Date: 02-16-2022
Return to Index
created by gbSnippets
'The most popular tag encryption, ID3, stores the Tag
'information in the last 128 bytes of the file:
'Tag:3, Title:30, Artist:30, Album:30, Year:4, Comment:30, Genre:1
'Grab the last 128 bytes. With ID3, the first three slots hold
'the string TAG if the file actually contains information.
'Compilable Example: (Jose Includes)
#Compile EXE
#Dim All
%Unicode=1
#Include "win32api.inc"
Type TagInfo
Tag As StringZ * 3
Songname As StringZ * 30
artist As StringZ * 30
album As StringZ * 30
year As StringZ * 4
comment As StringZ * 30
genre As StringZ * 1
End Type
%IDC_ListView = 500
Global hDlg As Dword 'main dialog handle
Global CurrentTag As TagInfo
Function PBMain() As Long
Dialog New Pixels, 0, "ListView Test",300,300,200,140,%WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 200, "Push",10,10,100,20
Control Add ListView, hDlg, 100, "", 10,40,180,80
ListView Insert Column hDlg, %IDC_ListView, 1, "Tag", 50, 0
ListView Insert Column hDlg, %IDC_ListView, 2, "File Name", 350, 0
ListView Insert Column hDlg, %IDC_ListView, 3, "Author", 350, 0
ListView Insert Column hDlg, %IDC_ListView, 4, "Title", 350, 0
ListView Set StyleXX hDlg, %IDC_ListView, %LVS_Ex_GridLines Or %LVS_Ex_FullRowSelect
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local ChosenLine, iResult As Long
Select Case Cb.Msg
Case %WM_Notify
Select Case Cb.NmId
Case %IDC_ListView
Select Case Cb.NmCode
Case %NM_Click
ListView Get Select hDlg, %IDC_ListView To iResult
End Select
End Select
End Select
End Function
Function GetTagInfo(fName$)
Local temp$
Open fName$ For Binary As #1
Seek #1, Lof(1) - 127
Get #1, CurrentTag
Close #1
End Function
http://www.garybeene.com/sw/gbsnippets.htm