|
例子里的频道比较少,需要的自己添加上就可以了
- import win.ui;
- import win.ui.menu;
- import com.flash;
- import win.util.tray;
- /*DSG{{*/
- var winform = win.form(text="FM";left=0;top=0;right=62;bottom=19;border="none";exmode="none";mode="popup";parent=...;topmost=1)
- winform.add(
- flashBox={cls="custom";left=0;top=0;right=420;bottom=45;edge=1;hide=1;z=1}
- )
- /*}}*/
- winform.show(false); //隐藏窗口
- var flash = com.flash( winform.flashBox );
- flash.movie = "http://www.cnr.cn/images2015/livePlayer_black_2014.swf?liveDataURL=http://www.cnr.cn/player2013/liveData1014.xml&defaultID=10&isAutoPlay=true"
- flash.play()
-
- var tray = win.util.tray(winform)
- tray.message = 0xACCF/*_WM_TRAYMESSAGE*/
- tray.tip = "FM" //设置鼠标提示
- winform.wndproc = {
- [0xACCF/*_WM_TRAYMESSAGE*/ ] = function(hwnd,message,wParam,lParam){
- if( lParam = 0x205/*_WM_RBUTTONUP*/ ){
- var pt = ::POINT();
- ::User32.GetCursorPos(pt);
-
- //弹出托盘菜单以前,一定要前置主窗口中,不然不点击菜单不会消失
- win.setForeground(winform.hwnd)
- winform.popmenu.popup(pt.x,pt.y,true )
- }
- }
- }
- winform.popmenu = win.ui.popmenu(winform);//创建弹出菜单
- winform.popmenu.add(
- text = '文艺之声—CNR';
- bitmapCheckd = "\res\1.bmp";
- proc = function(id){
- flash.movie = "http://www.cnr.cn/images2015/livePlayer_black_2014.swf?liveDataURL=http://www.cnr.cn/player2013/liveData1014.xml&defaultID=10&isAutoPlay=true"
- flash.play()
- for(i=1;winform.popmenu.count();1){
- winform.popmenu.check(i,false)//关闭除所有checked图标
- }
- winform.popmenu.check(id-4999);//默认id从5000开始,winform.popmenu.check参数从1开始,所以5000-1
- });
- winform.popmenu.add(
- text = '文艺之声—蜻蜓';
- bitmapCheckd = "\res\1.bmp";
- proc = function(id){
- flash.movie = "http://g.alicdn.com/de/prismplayer-flash/1.2.16/PrismPlayer.swf?vurl=http://lhttp.qingting.fm/live/395/64k.mp3&autoPlay=true&showBarTime=99999999"
- flash.play()
- for(i=1;winform.popmenu.count();1){
- winform.popmenu.check(i,false)//关闭除所有checked图标
- }
- winform.popmenu.check(id-4999);//默认id从5000开始,winform.popmenu.check参数从1开始,所以5000-1
- });
- winform.popmenu.add();//分隔线
- winform.popmenu.add(
- text = '相声小品—CNR';
- bitmapCheckd = "\res\1.bmp";
- proc = function(id){
- flash.movie = "http://www.cnr.cn/images2015/livePlayer_black_2014.swf?liveDataURL=http://www.cnr.cn/player2013/liveData1014.xml&defaultID=19&isAutoPlay=true"
- flash.play()
- for(i=1;winform.popmenu.count();1){
- winform.popmenu.check(i,false)//关闭除所有checked图标
- }
- winform.popmenu.check(id-4998); //默认id从5000开始,但因分隔线也算一个id,所以需要根据实际情况-2
- });
- winform.popmenu.add(
- text = '相声小品—蜻蜓';
- bitmapCheckd = "\res\1.bmp";
- proc = function(id){
- flash.movie = "http://g.alicdn.com/de/prismplayer-flash/1.2.16/PrismPlayer.swf?vurl=http://lhttp.qingting.fm/live/4990/64k.mp3&autoPlay=true&showBarTime=99999999"
- flash.play()
- for(i=1;winform.popmenu.count();1){
- winform.popmenu.check(i,false)//关闭除所有checked图标
- }
- winform.popmenu.check(id-4998); //默认id从5000开始,但因分隔线也算一个id,所以需要根据实际情况-2
- });
- winform.popmenu.add();//分隔线
- winform.popmenu.add(
- text = '静音';
- bitmapCheckd = "\res\1.bmp";
- proc = function(id){
- flash.movie = "http://g.alicdn.com/de/prismplayer-flash/1.2.16/PrismPlayer.swf"
- flash.play()
- for(i=1;winform.popmenu.count();1){
- winform.popmenu.check(i,false)//关闭除所有checked图标
- }
- winform.popmenu.check(id-4997); //默认id从5000开始,前面两组分割线,所以-3
- });
- winform.popmenu.add();//分隔线
- winform.popmenu.add('&Exit',function(id){ tray.delete();winform.close(); })
- return win.loopMessage();
复制代码 |
|