当前位置: 网学 > 编程文档 > VB > 正文

Win95系统API函数大揭秘

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
As Long
lpClass As String
hkeyClass As Long
dwHotKey As Long
hIcon As Long
hProcess As Long
End Type
Public Const SEE_MASK_INVOKEIDLIST = &HC
Public Const SEE_MASK_NOCLOSEPROCESS = &H40
Public Const SEE_MASK_FLAG_NO_UI = &H400

Declare Function ShellExecuteEX Lib "shell32.dll" Alias "ShellExecuteEx" _
(SEI As SHELLEXECUTEINFO) As Long
Public Function ShowProperties(FileName As String, OwnerhWnd As Long) As Long
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
.cbSize = Len(SEI)
.fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
.hwnd = OwnerhWnd
.lpVerb = "properties"
.lpFile = FileName
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = 0
.hInstApp = 0
.lpIDList = 0
End With
r = ShellExecuteEX(SEI)
ShowProperties = SEI.hInstApp
End Function
? 设置墙纸
墙纸是显示在桌面的图片或图像,是Win95的一个重要窗口。你可以通过改变列表中的文件来选择多
姿多采的墙纸。墙纸为Win95蒙上了一披美丽的面纱,我们可以利用SystemParametersInfo函数来揭开
它的“神秘面纱”并亲手为她营造异样的风采。
在窗体中增加List1控件,窗体加入如下代码:
Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA"
(ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long)
As Long
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = &H1 ''update Win.ini Constant
Const SPIF_SENDWININICHANGE = &H2 ''update Win.ini and tell everyone
Private Sub Form_Load()
Dim Temp As String
Temp = InputBox("Please Input A Directory", "Changer", "C:\WINDOWS\")
If Temp = "" Then End ''Cancel clicked
If Right$(Temp, 1) <> "\" Then Temp = Temp + "\"
List1.Tag = Temp
Temp = Temp + "*.bmp" ''Set the file filter (path + *.BMP)
Temp = Dir$(Temp)
Do While Temp$ <> ""
Temp = Dir$
    If Temp = "" Then Exit Do
List1.AddItem Temp
Loop
List1.AddItem "(None)"
Show
List1.SetFocus
List1.ListIndex = 0
End Sub
Private Sub list1_dblclick()
Dim Temp As String
Dim BMPFile As String
Temp = Tag
If List1.Text = "(None)" Then
BMPFile = "(none)"
Else
BMPFile = Temp + (List1)
End If
SystemParametersInfo SPI_SETDESKWALLPAPER, 0, ByVal BMPFile, SPIF_UPDATEINIFILE
End Sub

Private Sub List1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then list1_dblclick
End Sub
马上试试,当场把你的墙纸改变啦(不变不收钱)!爽吧!
? 建立快捷键
Win95中快捷方式提供了对常用程序和文档的访问捷径,你可以为桌面或文件夹中的任何程序、文档
或打印机添加快捷方式。VB5中利用fCreateShellLink函数可以为常用程序和文档快速建立建立快捷键。
fCreateShellLink的声明为:
Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal lpstrFolderName As String,
ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String)
As Long
LpstrFolderName设置快捷方式的文件夹名称,lpstrLinkName设置快捷方式的标题名称,lpstrLinkPath
设置快捷方式所指向的应用程序的目录及文件名。简而

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号