您的批评和鼓励都是我把编程无限办好的动力! 您编程时遇到困难,或遇到不顺心的事想发发牢骚尽管到这里来吧! 虽然本网力求全面,但也不能包罗万象,这些我筛选出的优秀网站连接就是对本站最好的补充! 学习编程当然也离不开书本了,这里收集大量编程书籍! 编程无限之源码超市,这里收集的代码令你意想不到的全面! 欢迎光临编程网校,这里专门收集VB/CB入门文章及技术文章! 欢迎光临编程无限!
     
       
 
当前位置:中文资料 >> 其他
自动更换墙纸的小软件
  资料类型: 其他 上传时间: 2001-02-21 阅读次数: 1479



自动更换墙纸的小软件


---- 这个小软件所用控件仅一列表框,两文本框,两标签,两命令及一定时控件而已。其界面如下:



---- 源代码:

Declare Function SystemParametersIn
fo Lib "user32" Alias "SystemParametersInfoA"
(ByVal uAction As Long, ByVal uParam As Long,
ByVal lpvParam As Any, ByVal fuWinIni As Long)
As Long


Dim flag As Boolean
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = &H1
'update Win.ini Constant
Const SPIF_SENDWININICHANGE = &H2
'update Win.ini and tell everyone

Private Sub CmdCancel_Click()
flag = False
Textpath = ""
Textintval = ""
Listfile.Clear
End Sub

Private Sub CmdOK_Click()
Dim temp As String
temp = Textpath.Text
If temp = "" Then End
If Right$(temp, 1) < > "" Then
temp = temp + ""
End If
Listfile.Tag = temp
temp = temp + "*.bmp"
temp = Dir$(temp)
While temp < > ""
Listfile.AddItem temp
temp = Dir$
Wend
Listfile.AddItem "None"
Show
Listfile.ListIndex = 0
If Listfile.List(0) = "None" Then
flag = False
Else
flag = True
End If
End Sub

Private Sub Form_Load()
flag = False
Timer1.Interval = Val(Textintval.Text)
End Sub

Private Sub Timer1_Timer()
Dim temp As String
Dim bmpfile As String
If flag Then
temp = Listfile.Tag
bmpfile = temp + Listfile.List(Listfile.ListIndex)
SystemParametersInfo SPI_SETDESKWALLPAPER,
0, bmpfile, SPIF_UPDATEINIFILE
If Listfile.ListIndex = Listfile.ListCount - 1 Then
Listfile.ListIndex = 0
End If
Listfile.ListIndex = Listfile.ListIndex + 1
End If
End Sub

---- (本程序开发环境:Win98,VB6.0)


推荐给朋友 点 评( 0 ) 返回前页 关闭此页
   
  本类最热文章排名:
  1.制作VB安装程序问答(一)
2.走进VB6啃一块骨头
3.做成一个时间限制的测试版
4.用VB创建Excel报表
5.自动装入注册设置
6.自己编程模拟 MouseEnter,MouseExit 事件
7.再谈VB程序的加密
8.自动卷动TextBox
9.制作VB安装程序问答(二)
10.VB编程的必备技巧
   
   
  评论:
 
 
 

 

关于本站 版权声明 联系方法
编程无限 V4.1 Copyright © 1999-2008 21code.com

京ICP备05006938号