Re: [Win32Lib] wrap Media control?
- Posted by ghaberek (admin) Feb 09, 2009
- 1057 views
DanM said...
I haven't looked at EuCOM yet, Matt also mentioned it, my head is still spinning trying to wrap my brain around wxEuphoria.
So I'd be real happy if you were able to figure out how to make Media control usable via Win32Lib
Are you saying you're heading in that direction (hope, hope, hope!)
Here's the wrapped EuCOM file, for those interested (requires EuCOM and Win32Lib): wmp.ew (267 KB)
This is what I have so far (note the "now what" part)...
include Win32Lib.ew include wmp.ew without warning object PATH PATH = getenv("PATH") if sequence( PATH ) then PATH = w32split( PATH, ";" ) VOID = setSearchPaths( PATH ) end if constant icoMedia = extractIcon({ "wmp.dll", 7, 1 }) constant Main = create( Window, "Windows Media Player Demo", 0, Default, Default, 640, 480, 0 ) constant File = create( Menu, "&File", Main, 0, 0, 0, 0, 0 ) constant File_Open = create( MenuItem, "&Open...", File, 0, 0, 0, 0, 0 ) constant File_Sep1 = create( MenuItem, "-", File, 0, 0, 0, 0, 0 ) constant File_Exit = create( MenuItem, "E&xit", File, 0, 0, 0, 0, w32AUTOCLOSE ) constant WMPlayer = create_com_control( WindowsMediaPlayer_clsid_ix, getHandle(Main), 0, 0, 0, 0 ) setIcon( Main, icoMedia ) procedure Main_onResize( integer pSelf, integer pEvent, sequence pParams ) sequence rect rect = getClientRect( pSelf ) move_obj( WMPlayer, rect[1..4] ) end procedure setHandler( Main, w32HResize, routine_id("Main_onResize") ) procedure File_Open_onClick( integer pSelf, integer pEvent, sequence pParams ) sequence filename atom bstr filename = getOpenFileName( Main, "", {"All files (*.*)", "*.*"} ) if length( filename ) = 0 then return end if -- ...now what? end procedure setHandler( File_Open, w32HClick, routine_id("File_Open_onClick") ) WinMain( Main, Normal )
-Greg