VB里我发现有的PAI函数在用的时候都得定义常数比如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
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 17:46:02
VB里我发现有的PAI函数在用的时候都得定义常数比如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
VB里我发现有的PAI函数在用的时候都得定义常数比如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 LongPrivate Const a& = -1Private Const b& = &H1Private Const c& = &H2Private Sub Form_Load()SetWindowPos Me.hwnd,a,0,0,0,0,b Or cEnd Sub这个函数主要功能是让窗体置顶那么这里面的Private Const c& = &H2和其他几个这些个都是必须要的吗?另外就是他赋的值都有什么特殊的意义吗?可以换成别的数值吗、》
VB里我发现有的PAI函数在用的时候都得定义常数比如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
可写成:SetWindowPos(Me.hwnd,-1,0,0,0,0,3)
将a写成-1为置顶,-2为恢复窗口原始状态
其中 b or c的意思你看函数啊,对应的是wFlags,包含了旗标的一个整数.