VB写注册表启动项
Private Sub Form_Load()
Set w = CreateObject("wscript.shell")
w.regwrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe"
End Sub
相关文档:
1.用VB6判断文件存在妙法
在编程时经常会用到判断文件是否存在,比如对文件做读写操作前,或是判断密钥文件是否存在等。判断的方法有很多,有些方法虽很实用,但有点繁琐。其实还可以有更简单的方法,就是使用VB 6.0提供的FileSystemObject对象。
FileSystemObject对象不是VB内置对象,使用前必须首先选择[工程]&rar ......
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const a& = -1
Private Const b& = &H1
Private Const c& = &H2
Priva ......
将长路径转为短路径
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Function ShortPath(ByVal FileName As String) As String
Dim S As String
On Error GoTo exitFu ......
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click() '锁定鼠标 到某一位置
......
VB 长整型和字节数组的转换问题 (Long<>Byte)
Posted by JiaJia 17 March,2009 (0)Comment
用到的API声明:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Long2Byte
Dim TempLng As Long
Dim TempBytes(0 To 3) As Byte ......