vb 锁定鼠标到某一位置
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() '锁定鼠标 到某一位置
Dim r As RECT
r.Left = 100: r.Top = 100
r.Right = 100: r.Bottom = 100
ClipCursor r
End Sub
Private Sub Command2_Click() '解除锁定
ClipCursor ByVal 0&
End Sub
'原帖地址:
http://fy5388.blog.163.com/blog/static/5649953720091127115554104/
相关文档:
1.用VB6判断文件存在妙法
在编程时经常会用到判断文件是否存在,比如对文件做读写操作前,或是判断密钥文件是否存在等。判断的方法有很多,有些方法虽很实用,但有点繁琐。其实还可以有更简单的方法,就是使用VB 6.0提供的FileSystemObject对象。
FileSystemObject对象不是VB内置对象,使用前必须首先选择[工程]&rar ......
据说vb6中,字 符串以以UNICODE方式存储,所以
Private Type UDT
lngM1 As Long
lngM2 As Long
strM3 As String * 18
strM4 As String * 8
lngM5 As Long
End Type
Private Sub Command4_Click()
Dim tmp As UDT
With tmp
.lngM1 = 1
.lngM2 = 2
' .str ......
DB2ConnectionString
b2str = "Provider=MSDASQL.1;Password=a$sk6G7;Persist Security Info=True;User ID=DBA;Data Source=ConDB2SFXXK"
AccessConnectonString
accessstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DMSJK.mdb;Jet OLEDB:database password=" ......
将长路径转为短路径
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 ......