vb设置窗体不可移动
Option Explicit
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, Optional ByVal wFlags As Long = 0&) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Dim i As Boolean
Function SetWindowMoveAble(ByVal hWnd As Long, Optional ByVal MoveAble As Boolean = True) As Boolean
'function: SetWindowMoveAble
' params:
' hWnd: 一个顶级窗口句柄
' MoveAble: 是否可移动
' result: 与参数 Moveable 的设置一样,否则即为失败
Dim mhandle As Long
If MoveAble Then _
GetSystemMenu hWnd, 1&: _
DrawMenuBar hWnd _
Else _
mhandle = GetSystemMenu(hWnd, 0&): _
SetWindowMoveAble = DeleteMenu(mhandle, &HF010&)
End Function
Private Sub Command1_Click()
SetWindowMoveAble hWnd, i
i = Not i
End Sub
转自:http://topic.csdn.net/u/20091202/13/66015bdf-6b87-4268-8e9d-dccf45f7ae52.html?15976
相关文档:
Public Declare Function VarPtrArray Lib "msvbvm60.dll" Alias "VarPtr" (Var() As Any) As Long
Public Declare Function VarPtrStringArray Lib "msvbvm60.dll" Alias "VarPtr" (Var() As Any) As Long
取对象地址: ObjPtr
取OLE对象的地址: OLE_NAME.LpOleObject
取函数地址: AddressOf
取字符串地址: StrPtr
取 ......
Option Explicit
Public Function ascii2Char(strInput As String) As String
Dim i As Integer
Dim strTemp As String
Dim nPos As Integer
Dim nValue As Integer
i = 1
nPos = InStr(i, strInput, "&#", vbTextCompare)
While (nPos > 0)
ascii2Char = ascii2Char + Left(st ......
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" ( _
ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
......
'*************************************************************************
**说 明:永远的魔灵 by icecept(郭卫)
'**创 建 人:icecept(魔灵)
'**日 期:2009-11-15 20:27:03
'**修 改 人:icecept(魔灵)
'**版 本:V1.0.0
'**E-mail :icecept@163.com QQ:543375508
'**网 ......