hy,
ich hab mein prog mit folgendem transparent gemacht:
' zunächst die benötigten API-Deklarationen
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_TRANSPARENT = &H20&
Private Sub Form_Load()
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
End Sub
Private Sub Form_Activate()
ChangeWndPrg Me.hwnd
End Sub
Private Sub Form_Load()
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
FrmPaint
End Sub
Private Sub Form_Terminate()
ResetWndPrg Me.hwnd
End Sub
Private Sub FrmPaint()
Dim ct As Control
On Error Resume Next
For Each ct In Form1.Controls
ct.SetFocus
SendMessage ct.hwnd, WM_PAINT, 0, 0&
Next
End Sub
Fügen Sie für das "Subclassing" der Form ein Modul in das Projekt ein und _
diesen Code:
' zunächst die benötigten API-Deklarationen
Public Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Public Declare Function CallWindowProc Lib "user32" Alias _
"CallWindowProcA" (ByVal lpPrevWndFunc As Long,
ByVal hwnd As Long, ByVal Msg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private OldWndPrg As Long
Private Const GWL_WNDPROC = (-4)
Public Const GWL_EXSTYLE = (-20)
Public Const WM_PAINT = &HF
Private Const WM_NCPAINT = &H85
Private Const WM_ERASEBKGND = &H14
Public Const WS_EX_TRANSPARENT = &H20&
' Fensterstil "transparent machen"
Public Sub ChangeWndPrg(ByVal hwnd As Long)
SetWindowLong hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT
OldWndPrg = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf WndPrg)
End Sub
' "alten" Fensterstil wiederherstellen
Public Sub ResetWndPrg(ByVal hwnd As Long)
SetWindowLong hwnd, GWL_WNDPROC, OldWndPrg
End Sub
' Nachricht "Neuzeichnen" (WM_PAINT) abfragen
Public Function WndPrg(ByVal hwnd As Long, _
ByVal uMsg As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
If uMsg <> WM_PAINT Then
WndPrg = CallWindowProc(OldWndPrg, hwnd, _
uMsg, wParam, ByVal lParam)
End If
End Function also ich hab das von nem tipp von dieser site. ich wollt dir eigentlich den link geben, aber ich find den tipp nich mehr. ich hab die anfangs- und endkomentare des autors weggelassen. falls du mal alles willst, dann schreib mir ne mail oder antworte einfach auf diesen tipp.
----------------------------------------------------------------
vb@rchiv =/= To boldly go where no programmer has gone before =/=
|