- . void *, C, . , VB.NET, . , , .
, , BOOL. , , BOOL :
<DllImport("dwmapi.dll")> _
Private Shared Function DwmSetWindowAttribute(ByVal hwnd As IntPtr, _
ByVal attr As Integer, ByRef attrValue As Boolean, _
ByVal attrSize As Integer) As Integer
End Function
, :
Private Const DWMWA_TRANSITIONS_FORCEDISABLED As Integer = 3
Then you need to change the place where you call this function, the window can be created several times, but the Load event is fired only once. You must call it immediately after creating the window. Adding error handling so you can diagnose runtime problems:
Protected Overrides Sub OnHandleCreated(ByVal e As System.EventArgs)
MyBase.OnHandleCreated(e)
If Environment.OSVersion.Version.Major >= 6 Then
Dim hr = DwmSetWindowAttribute(Me.Handle, _
DWMWA_TRANSITIONS_FORCEDISABLED, True, 4)
If hr < 0 Then Marshal.ThrowExceptionForHR(hr)
End If
End Sub
Worked well when I tested it.
source
share