What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » VB Help

VB Help
Author: Message:
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. Huh?  VB Help
Ok I've been going at this for about an hour now and it's driveing me nuts. So I'll ask here. :P

I want to be able to search text on a selected listview item and if that text contains .mp3 then do bla bla. So this is what I got so far

If listFiles2.SelectedItems(0).Text = ".mp3" then
Bla bla bla

Now I know this will not work because thats saying that the text in the selected item is .mp3 then do bla bla bla, but what I really want is it to say If selected item text has .mp3 in it then do bla bla bla.


This post was edited on 06-21-2005 at 04:47 PM by DJeX.
[Image: top.gif]
06-21-2005 04:46 PM
Profile PM Web Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: VB Help
Use InStr function:

If InStr(listFile2.SelectedItems(0).Text,".mp3")<>0 Then
blah blah blah
End If

When InStr returns 0, it means listFile2.SelectedItems(0).Text does not contain ".mp3".
06-21-2005 05:05 PM
Profile PM Web Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. RE: VB Help
Thanks man it worked great!

Now maybe you could help me include WMP in my program :P

I can't seem to get the the controls by useing WMP.controls.play() or any other control. I'm useing the new WMP 10 dll so i'm not to sure.

This post was edited on 06-21-2005 at 05:18 PM by DJeX.
[Image: top.gif]
06-21-2005 05:16 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: VB Help
code:
WMP.Controls.play
06-21-2005 05:32 PM
Profile E-Mail PM Find Quote Report
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. RE: VB Help
:dodgy: gee I thought I said that dident work..... :P

That will only work for the old versions of WMP.
[Image: top.gif]
06-21-2005 05:43 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: VB Help
quote:
Originally posted by Mnjul
Use InStr function:

If InStr(listFile2.SelectedItems(0).Text,".mp3")<>0 Then
blah blah blah
End If

When InStr returns 0, it means listFile2.SelectedItems(0).Text does not contain ".mp3".
I'd recommend using Right$() to get the last 3-4 characters and compare with that.

If it's filenames of course.

This post was edited on 06-21-2005 at 07:11 PM by RaceProUK.
[Image: spartaafk.png]
06-21-2005 07:10 PM
Profile PM Web Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
Status: Online
RE: VB Help
For playing music, I would recommend using the mciSendString API.

Example:

code:
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, _
                                                                              Optional ByVal lpstrReturnString As String = 0, _
                                                                              Optional ByVal uReturnLength As Long = 0, _
                                                                              Optional ByVal hwndCallback As Long = 0) As Long

Private Sub Form_Load()
    mciSendString "open """ & "C:\test.mp3" &  """ type MPEGvideo alias PutWhatYouWantHere ", ByVal 0&, 0, ByVal 0&

    mciSendString "play PutWhatYouWantHere", ByVal 0&, 0, ByVal 0&
End Sub

Private Sub Form_Unload()
    mciSendString "close PutWhatYouWantHere", ByVal 0&, 0, ByVal 0&
End Sub





[/code]Note: All "PutWhatYouWantHere" must be same or, it wont work!
YouTube closed-captions ripper (also allows you to download videos!)
06-21-2005 07:24 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On