View Full Version : How to display a codec propertie page in VB ?


Snakes
21st April 2003, 17:23
Hi there .
I coded a little player in VB and i would like to access some codec property page ,for example , the properties of the audio codec to select SPDIF output .

I use Directshow in my code , with automatic graph generation .
There is a sample of displaying a property page in the SDK but unfortunately it's in C++ :confused:

That's why i'm asking if it's possible or not to do that in VB .

Thanks .

DoC hEx
21st April 2003, 22:16
I got this from the DVX project source and it works for me for Video I don't know about Audio. You might have to chagne the 'vidc' to something else as I reckon 'vidc' could mean Video Codec.


'Stuff for the Codec Windows Pop-ups
Private Declare Function ICClose Lib "msvfw32.dll" (ByVal hic As Long) As Long
Private Declare Function ICOpen Lib "msvfw32.dll" (ByVal fccType As Long, ByVal fccHandler As Long, ByVal wMode As Long) As Long
Private Declare Function ICSendMessage Lib "msvfw32.dll" (ByVal hic As Long, ByVal msg As Long, ByVal dw1 As Long, ByVal dw2 As Long) As Long
Private Declare Function mmioStringToFOURCC Lib "winmm.dll" Alias "mmioStringToFOURCCA" (ByVal sz As String, ByVal uFlags As Integer) As Long

'Thanks go to the DVX Project for this peach of Code ;)
Public Function OpenCodecWin(ByVal CodecCode As String, ByVal Handled As Long) As Byte
Const DRV_USER As Integer = &H4000
Const ICM_RESERVED As Integer = DRV_USER + &H1000
Const ICM_CONFIGURE As Integer = (ICM_RESERVED + 10)
Const ICM_GETSTATE As Integer = (ICM_RESERVED + 0)
Const ICM_SETSTATE As Integer = (ICM_RESERVED + 1)

Dim fccType, fccHandler, hic As Long
Dim tmp As Integer

fccType = mmioStringToFOURCC("vidc", &H10)
'fccHandler = mmioStringToFOURCC("divx", &H10)
'fccHandler = mmioStringToFOURCC("xvid", &H10)

fccHandler = mmioStringToFOURCC(CodecCode, &H10)

hic = ICOpen(fccType, fccHandler, 0)
ICSendMessage hic, ICM_CONFIGURE, Handled, 0
ICClose hic
End Function

Snakes
24th April 2003, 17:32
Thanks ! i'll will give it a try but i think it won't work as i don't use thi way to play my videos ( i use the directshow method , not the " aviplay " one ) .
Anyway , thanks .

int 21h
24th April 2003, 18:19
That code posted opens the compression configuration, I think Snakes is looking for the decoding filter configuration...

Snakes
24th April 2003, 19:11
you're right Int 21h , for example , i use the elecard ( moonlight ) audio codec when reading a mpeg file and i would like to be able to open the codec property page to select Speakers or SPDIF output for example .

Snakes
26th April 2003, 20:49
I'm still stuck with that :( any clues ??

BlackSun
27th April 2003, 20:56
have fun, this is what I used in PowerDivX:
http://www.gdcl.co.uk/vb.htm

(website created by the former creator if DirectShow, very nice guy)

Snakes
28th April 2003, 13:06
A great Thanks to Blacksun :D
Thanks for your contribution i didn't find with a lot of google search :)