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



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

大家可以给些意见...

可以设置6个时间点...[em48]
搜索更多相关主题的帖子: MP3 控件 闹钟 
2005-07-14 19:14
dragon311
Rank: 1
等 级:新手上路
帖 子:92
专家分:0
注 册:2005-3-27
收藏
得分:0 
能把代码发上来吗?

奋斗成就未来~~
2005-07-17 23:37
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
leon2
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:731
专家分:0
注 册:2005-3-18
收藏
得分:0 
我想问一下,是不是一调用了 InitCommonControls 这个 API 函数,程序的所有控件就会改成 xp 风格?我把它调到我的程序里没用啊,谢谢了。
2005-07-18 21:32
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
sjbcl224
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-8-12
收藏
得分:0 
不知道楼主还来不来看这个帖子
我想在自制闹钟里面加个东西
就是到我设定的时间时候弹出一个对话框,提示我当天的任务
应该不是很难吧
我VB没学好  没办法  希望楼主可以帮我个忙
我要把他合到我们的软件中去做个提示
2005-08-16 19:23
sjbcl224
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2005-8-12
收藏
得分:0 
最好给原文件  或者是原代码
2005-08-16 19:25
快速回复:自制闹钟...NO MP3控件
数据加载中...
 
   



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

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