Hi there!
For my grade 12 summative project, I decided that I wanted to make an mp3/wma player. At the moment, I have the basics(play, stop with a browse function).
I would like to list all of my mp3s and wmas from a fixed folder in the list control, and by clicking a song and then play, would play the song selected.

I tried to use insert item:

Code:

m_Songs.InsertItem(0,"H:\\My Documents\\Music\\*.mp3");

but it just inserted a string. I have only had minimal class time using MFC functions and codes, but I would really like to be able to do this.

I want to make it near the bottom of the screen, but it always shows up at the top.

I dont neccicarily need code written, but if someone can explain to me what I would need to do or even functions to try, that would be wonderful.

January 19th, 2011, 10:40 AM

VictorN

Re: CListCrtl playing MP3s

Quote:

Originally Posted by TarnishedHearts

Hi there!
For my grade 12 summative project, I decided that I wanted to make an mp3/wma player. At the moment, I have the basics(play, stop with a browse function).
I would like to list all of my mp3s and wmas from a fixed folder in the list control, and by clicking a song and then play, would play the song selected.

I tried to use insert item:

Code:

m_Songs.InsertItem(0,"H:\\My Documents\\Music\\*.mp3");

but it just inserted a string. I have only had minimal class time using MFC functions and codes, but I would really like to be able to do this.

I want to make it near the bottom of the screen, but it always shows up at the top.

The return value of MCIWndCreate is HWND (window handle)
You can use ::MoveWindow or ::SetWondowPos APIs to change this player window position: just pass the returned handle (m_Timer) as window handle and other necessary parameters (see MSDN for details).

January 19th, 2011, 11:01 AM

Skizmo

Re: CListCrtl playing MP3s

Quote:

but it just inserted a string.

Because that is what you asked it to do ;). You can use the CFileFind class to find files from a pattern (*.mp3 for example). After that you can insert the found files one by one in the listcontrol.

January 21st, 2011, 10:24 AM

TarnishedHearts

Re: CListCrtl playing MP3s

Okay, Ive been trying to use ::MoveWindow and ::SetWindowPos, but nothing seems to work. Maybe I'm doing something wrong, but m_Timer doesn't react to pointers, ::'s or .'s.
So then I tried this: