VB 将Form1窗口设置成,鼠标点击时Form1窗口不被激活,意思就是点击Form1等于点击Form1下面的窗口


Form1 只能显示,不能操作,鼠标点击无效
你说的跟桌面歌词效果(即鼠标穿透窗体)相同吧。

下面的亏态代码是参考网上人家的,经过测试了。具销陵源体位置忘记了,还请原作者见谅了。

在标准模块里:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const WS_EX_TRANSPARENT As Long = &H20&
Private Const GWL_EXSTYLE = (-20)

'汪缺实现鼠标穿透窗体
Public Function SetMouseIn(ByVal hWnd As Long, Optional cMouse As Boolean = True) As Long
Dim r As Long
r = GetWindowLong(hWnd, GWL_EXSTYLE)
If cMouse = True Then
r = r Or WS_EX_LAYERED
r = r Or WS_EX_TRANSPARENT
Else
r = r And Not WS_EX_TRANSPARENT
End If
SetWindowLong hWnd, GWL_EXSTYLE, r
End Function
Private Sub Form_Load()
Form1.Enabled = False
End Sub
找到那个窗口的句柄,将消息传递过去就好了