| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1899 人关注过本帖
标题:自制闹钟...NO MP3控件
取消只看楼主 加入收藏
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
 问题点数:0 回复次数:11 
自制闹钟...NO MP3控件
dNDzpaID.rar (20.57 KB) 自制闹钟...NO MP3控件



可以播放MP3,WAV,MID,WMA...

大家可以给些意见...

可以设置6个时间点...[em48]
搜索更多相关主题的帖子: MP3 控件 闹钟 
2005-07-14 19:14
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
终于有人看了..

代码可以发啊...不过有点乱,自己研究下~~

代码绝对可以..

你看过界面,猜猜控件只的那个吧~~

等下

快上课了……
2005-07-18 14:03
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 

FORM1代码: '------------------------------------------------------------ '------------------------------------------------------------ '------------------------------------------------------------ '------------------------------------------------------------ '------------------------------------------------------------ '控件的XP风格,对程序只有美化作用.完全可以不要 ^_^ Private Declare Sub InitCommonControls Lib "comctl32.dll" () Private Sub Form_Initialize() InitCommonControls End Sub '------------------------------------------------------------ '------------------------------------------------------------ '------------------------------------------------------------ Private Sub Combo1_Click() h.Text = "" m.Text = "" h.Enabled = True m.Enabled = True Label7.Caption = "" End Sub

Private Sub Command4_Click() Dim OpenFile As OPENFILENAME Dim lReturn As Long Dim sFilter As String OpenFile.lStructSize = Len(OpenFile) OpenFile.hwndOwner = Form1.hwnd OpenFile.hInstance = App.hInstance sFilter = "音频格式" & Chr$(0) & "*.mp3;*.wav;*.mid;*.midi;*.wma" & Chr$(0) OpenFile.lpstrFilter = sFilter OpenFile.nFilterIndex = 1 OpenFile.lpstrFile = String(257, 0) OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1 OpenFile.lpstrFileTitle = OpenFile.lpstrFile OpenFile.nMaxFileTitle = OpenFile.nMaxFile OpenFile.lpstrTitle = "选择音乐文件" OpenFile.flags = cdlOFNNoChangeDir And cdlOFNPathMustExist lReturn = GetOpenFileName(OpenFile) On Error GoTo Err sound.Text = OpenFile.lpstrFile mfn = GetShortFileName(OpenFile.lpstrFileTitle) Text1.Text = mfn Err: Text1.Text = mfn End Sub

Private Sub Command5_Click() Label6.Visible = False Command5.Visible = False End Sub

Private Sub Command1_Click() h.Enabled = False m.Enabled = False Label7.Caption = "闹铃" & vbCrLf & vbCrLf & "设置" & vbCrLf & vbCrLf & "成功" If combo1.ListIndex = 0 Then ring1.Caption = h.Text & ":" & m.Text & ":" & "00" sound1.Text = Text1.Text End If If combo1.ListIndex = 1 Then ring2.Caption = h.Text & ":" & m.Text & ":" & "00" sound2.Text = Text1.Text End If If combo1.ListIndex = 2 Then ring3.Caption = h.Text & ":" & m.Text & ":" & "00" sound3.Text = Text1.Text End If If combo1.ListIndex = 3 Then ring4.Caption = h.Text & ":" & m.Text & ":" & "00" sound4.Text = Text1.Text End If If combo1.ListIndex = 4 Then ring5.Caption = h.Text & ":" & m.Text & ":" & "00" sound5.Text = Text1.Text End If If combo1.ListIndex = 5 Then ring6.Caption = h.Text & ":" & m.Text & ":" & "00" sound6.Text = Text1.Text End If End Sub

Private Sub Command2_Click() h.Text = "" m.Text = "" h.Enabled = True m.Enabled = True Label7.Caption = "" End Sub

Private Sub Command3_Click() End End Sub

Private Sub Form_Load() Label2.Caption = Format(Now, "hh:mm:ss") combo1.ListIndex = 0 End Sub

Private Sub Timer1_Timer() Label2.Caption = Format(Now, "hh:mm:ss")

If Label2.Caption = ring1.Caption Then t% = mciSendString("play " + sound1.Text + " from " + Str(0), 0&, 0, 0) End If If Label2.Caption = ring2.Caption Then t% = mciSendString("play " + sound2.Text + " from " + Str(0), 0&, 0, 0) End If If Label2.Caption = ring3.Caption Then t% = mciSendString("play " + sound3.Text + " from " + Str(0), 0&, 0, 0) End If If Label2.Caption = ring4.Caption Then t% = mciSendString("play " + sound4.Text + " from " + Str(0), 0&, 0, 0) End If If Label2.Caption = ring5.Caption Then t% = mciSendString("play " + sound5.Text + " from " + Str(0), 0&, 0, 0) End If If Label2.Caption = ring6.Caption Then t% = mciSendString("play " + sound6.Text + " from " + Str(0), 0&, 0, 0) End If End Sub


快上课了……
2005-07-18 14:06
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 

dlg(CODE): Option Explicit Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _ "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long Type OPENFILENAME lStructSize As Long hwndOwner As Long hInstance As Long lpstrFilter As String lpstrCustomFilter As String nMaxCustFilter As Long nFilterIndex As Long lpstrFile As String nMaxFile As Long lpstrFileTitle As String nMaxFileTitle As Long lpstrInitialDir As String lpstrTitle As String flags As Long nFileOffset As Integer nFileExtension As Integer lpstrDefExt As String lCustData As Long lpfnHook As Long lpTemplateName As String End Type '-------------------------------------------------------- otherModule(CODE): '------------------------------------------------------------------ '------------------------------------------------------------------ '--------------------------XP控件风格------------------------------ Declare Sub InitCommonControls Lib "comctl32.dll" () '------------------------------------ '------------------------------------ '添加模块,做以下声明: '------------------------------------ '------------------------------------ Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrRetumString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'------------------------------------ '------------------------------------ '====================================取長文件名的短文件名======================================== Public Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Public Function GetShortFileName(ByVal FileName As String) As String Dim rc As Long Dim ShortPath As String Const PATH_LEN& = 164 ShortPath = String$(PATH_LEN + 1, 0) rc = GetShortPathName(FileName, ShortPath, PATH_LEN) GetShortFileName = Left$(ShortPath, rc) End Function 'mfn = GetShortFileName(CommonDialog1.FileName) '取短文件名


快上课了……
2005-07-18 14:08
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
不是的.还要一个文件....网上都是这样的....


快上课了……
2005-07-20 12:56
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
不过我的是资源文件...

快上课了……
2005-07-20 12:56
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
和我播放的原理是一样,,,你在TIMER事件加..

if timer$=你要的时间,,,,then

msgbox "你要提示什么?",,"提示"

快上课了……
2005-08-16 19:31
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
闹钟关键在定时...响你可以换成任意事情,,,,

快上课了……
2005-08-16 22:40
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
托盘和热键部分已经做好了...可是还没应用到这个上,,,,,,

我IE7.0晕~我邮箱不支持上传...汗~

快上课了……
2005-08-17 23:47
slore
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1108
专家分:0
注 册:2005-7-1
收藏
得分:0 
bPifMiDG.rar (15.7 KB) 自制闹钟...NO MP3控件


快上课了……
2005-08-18 00:13
快速回复:自制闹钟...NO MP3控件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.051852 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved