1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Imports System.Runtime.InteropServices
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim margins As MARGINS = New MARGINS
margins.cxLeftWidth = -1
margins.cxRightWidth = -1
margins.cyTopHeight = -1
margins.cyButtomheight = -1
'mettre toutes les valeurs à -1 pour la transparence de la fenêtre en entier
Dim hwnd As IntPtr = Me.Handle
Dim result As Integer = DwmExtendFrameIntoClientArea(hwnd, margins)
Catch ex As Exception
End Try
End Sub
#Region " Effet de transparence sous vista "
<StructLayout(LayoutKind.Sequential)> _
Public Structure MARGINS
Public cxLeftWidth As Integer
Public cxRightWidth As Integer
Public cyTopHeight As Integer
Public cyButtomheight As Integer
End Structure
<DllImport("dwmapi.dll")> _
Public Shared Function DwmExtendFrameIntoClientArea(ByVal hWnd As IntPtr, ByRef pMarinset As MARGINS) As Integer
End Function
'Le reste est dans form_load
#End Region
End Class |
Partager