
import win.ui; 
import win.ui.menu;
import win.ole.image;
import win.mm;
/*DSG{{*/ begin
winform = win.form( bgcolor=14215660;right=350;exmode="";cls="AFORM";left=0;bottom=250;text="winsound库测试";style=0;top=0;title="AAuto Form" )

winform.add( 
button2={ bgcolor=14215660;color=0;cls="button";multiline=1;acceptfiles=1;tabstop=1;visible=true;right=205;left=104;bottom=137;z=0;top=107;transparent=1;text="MessageBeep" };
button3={ bgcolor=14215660;color=0;cls="button";multiline=1;acceptfiles=1;tabstop=1;visible=true;right=205;left=104;bottom=189;z=1;top=159;transparent=1;text="button3" };
button1={ bgcolor=14215660;color=0;cls="button";multiline=1;acceptfiles=1;tabstop=1;visible=true;right=205;left=104;bottom=81;z=2;top=51;transparent=1;text="Beep" }
)
end /*}}*/

winform.wndproc = function(hwnd,message,wparam,lparam){
select(message) {//判断消息类型
	case 0x201/*_WM_LBUTTONDOWN*/ {//鼠标按下
	
	}
	case 0x202/*_WM_LBUTTONUP*///鼠标弹起
	{ }
	case 0x3/*_WM_MOVE*/ //鼠标移动
	{ }
	case 0x10/*_WM_CLOSE*///窗口关闭消息
	{ }
	case 0x205/*_WM_RBUTTONUP*///鼠标右键弹起消息
	{
	//winform.popmenu.popup(::LOWORD(lparam), ::HIWORD(lparam));//弹出菜单
	}
	else
	{ }
}
}//endproc
winform.button3.oncommand = function(id,event){
	//win.msgbox( winform.button3.text );
	win.mm.playSound("SystemStart",_NULL,_SND_ALIAS | _SND_ASYNC);
	win.delay(2500);
	win.mm.playSound("c:\\windows\\media\\ringin.wav", _NULL, _SND_FILENAME | _SND_ASYNC);
	//无返回值则继续调用默认回调函数
}//endproc

winform.button2.oncommand = function(id,event){
	//win.msgbox( winform.button2.text );
	win.mm.msgBeep(0xFFFFFFFF);//不发声，自定义一下播放的声音。控制面板-》声音和音频设备-》声音
	//无返回值则继续调用默认回调函数
}//endproc

winform.button1.oncommand = function(id,event){
	//win.msgbox( winform.button1.text );
	//win.mm.Beep(800,1000);
	var t=800;
win.mm.Beep(330, t);
win.mm.Beep(392, t);
win.mm.Beep(262, t*2);
win.mm.Beep(294, t);
win.mm.Beep(330, t);
win.mm.Beep(196, t*2);
win.mm.Beep(262, t);
win.mm.Beep(294, t);
win.mm.Beep(330, t);
win.mm.Beep(392, t);
win.mm.Beep(294, t*4);

	//无返回值则继续调用默认回调函数
}//endproc






winform.show(true) 
win.loopMessage( winform );
