
常用软件类: |
|杀毒安全 | |联络聊天 | |网络软件 | |多媒体类 | |系统工具 | |图形图像 | |系统工具 | |应用软件 | |行业软件 |
开发设计类: |
|动画制作 | |图像处理 | |3D设计 | |操作系统 | |站长学院 | |网络相关 | |WEB设计 | |数据库类 | |程序开发 |
| 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 Sub Command1_Click() Dim lReturn As Long ’添加到桌面 lReturn = fCreateShellLink("..\..\Desktop", "Shortcut to Calculator", "c:\windows\calc.exe", "") ’添加到程序组 lReturn = fCreateShellLink("", "Shortcut to Calculator", "c:\windows\calc.exe", "") ’添加到启动组 lReturn = fCreateShellLink("\Startup", "Shortcut to Calculator", "c:\windows\calc.exe", "") End Sub |
| 在注册档 HKEY_LOCAL_MACHINE 中找到以下机码 \Software\Microsoft\Windows\CurrentVersion\Run 新增一个字串值,包括二个部份 1. 名称部份:自己取名,可设定为 AP 名称。 2. 资料部份:则是包含 ’全路径档案名称’ 及 ’执行参数’ 例如: Value Name = Notepad Value Data = c:\windows\notepad.exe |
| Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0 End If End Sub |
| Private Sub Text1_KeyPress(KeyAscii As Integer) Dim sTemplate As String sTemplate = "!@#$%^&*()_+-=" ’用来存放不接受的字符 If InStr(1, sTemplate, Chr(KeyAscii)) > 0 Then KeyAscii = 0 End If End Sub |
| Private Sub Text1_GotFocus() Text1.SelStart = 0 Text1.SelLength = Len(Text1) End Sub |
| Dim Flag As Boolean Flag = Fun_FloppyDrive("A:") If Flag = False Then MsgBox "A:驱没有准备好,请将磁盘插入驱动器!", vbCritical ’------------------------------- ’函数:检查软驱中是否有盘的存在 ’------------------------------- Private Function Fun_FloppyDrive(sDrive As String) As Boolean On Error Resume Next Fun_FloppyDrive = Dir(sDrive) <> "" End Function |
| Option Explicit Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long Private Sub Command1_Click() mciExecute "set cdaudio door open" ’弹出光驱 Label2.Caption = "弹 出" End Sub Private Sub Command2_Click() Label2.Caption = "关 闭" mciExecute "set cdaudio door closed" ’合上光驱 Unload Me End End Sub |
| Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal ProcessID As Long, ByVal ServiceFlags As Long) As Long Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long ’请你试试 Ctrl+Alt+Del 是不是你的程序隐藏了 Private Sub Command1_Click() i = RegisterServiceProcess(GetCurrentProcessId, 1) End Sub |
[1] [2] [3] [4] [5] [6] [7] 下一页