level 13
gujlg
楼主
实现窗体透明,代码如下,可以实现,但当我移动窗体后,就不能在透明了。Option ExplicitPrivate Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPrivate Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As LongPrivate Const WS_EX_LAYERED = &H80000Private Const GWL_EXSTYLE = (-20)Private Const LWA_ALPHA = &H2Private Const LWA_COLORKEY = &H1Private Sub Form_Load()Me.BackColor = RGB(66, 66, 66)rtn = GetWindowLong(hWnd, GWL_EXSTYLE)rtn = rtn Or WS_EX_LAYEREDSetWindowLong Me.hWnd, GWL_EXSTYLE, rtnSetLayeredWindowAttributes Me.hWnd, RGB(66, 66, 66), i, LWA_COLORKEYEnd Sub
2007年03月18日 11点03分
1