Res5 писал(а):Форму, которая не берется в фокус.
Protected Overrides ReadOnly Property CreateParams As CreateParams
FireFenix писал(а):Зачем?
FireFenix писал(а):Неактивные фоновые/топмост окна - прерогатива вирусов
Res5 писал(а):Форму, которая не берется в фокус.
Imports Test.WindowStyles
Imports Test.ExtendedWindowStyles
<Flags>
Public Enum WindowStyles
WS_BORDER = &H800000
WS_CAPTION = &HC00000
WS_CHILD = &H40000000
WS_CHILDWINDOW = &H40000000
WS_CLIPCHILDREN = &H2000000
WS_CLIPSIBLINGS = &H4000000
WS_DISABLED = &H8000000
WS_DLGFRAME = &H400000
WS_GROUP = &H20000
WS_HSCROLL = &H100000
WS_ICONIC = &H20000000
WS_MAXIMIZE = &H1000000
WS_MAXIMIZEBOX = &H10000
WS_MINIMIZE = &H20000000
WS_MINIMIZEBOX = &H20000
WS_OVERLAPPED = &H0
WS_OVERLAPPEDWINDOW = WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
WS_POPUP = &H80000000
WS_POPUPWINDOW = WS_POPUP Or WS_BORDER Or WS_SYSMENU
WS_SIZEBOX = &H40000
WS_SYSMENU = &H80000
WS_TABSTOP = &H10000
WS_THICKFRAME = &H40000
WS_TILED = &H0
WS_TILEDWINDOW = WS_OVERLAPPED Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX
WS_VISIBLE = &H10000000
WS_VSCROLL = &H200000
End Enum
<Flags>
Public Enum ExtendedWindowStyles
WS_EX_ACCEPTFILES = &H10
WS_EX_APPWINDOW = &H40000
WS_EX_CLIENTEDGE = &H200
WS_EX_COMPOSITED = &H2000000
WS_EX_CONTEXTHELP = &H400
WS_EX_CONTROLPARENT = &H10000
WS_EX_DLGMODALFRAME = &H1
WS_EX_LAYERED = &H80000
WS_EX_LAYOUTRTL = &H400000
WS_EX_LEFT = &H0
WS_EX_LEFTSCROLLBAR = &H4000
WS_EX_LTRREADING = &H0
WS_EX_MDICHILD = &H40
WS_EX_NOACTIVATE = &H8000000
WS_EX_NOINHERITLAYOUT = &H100000
WS_EX_NOPARENTNOTIFY = &H4
WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE Or WS_EX_CLIENTEDGE
WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST
WS_EX_RIGHT = &H1000
WS_EX_RIGHTSCROLLBAR = &H0
WS_EX_RTLREADING = &H2000
WS_EX_STATICEDGE = &H20000
WS_EX_TOOLWINDOW = &H80
WS_EX_TOPMOST = &H8
WS_EX_TRANSPARENT = &H20
WS_EX_WINDOWEDGE = &H100
End Enum
Public Class Form1
Protected Overrides ReadOnly Property CreateParams As CreateParams
Get
Dim CP As CreateParams = MyBase.CreateParams
' VB.NET Defaults
'? CType(CP.Style, WindowStyles)
'WS_MAXIMIZEBOX Or WS_GROUP Or WS_SIZEBOX Or WS_SYSMENU Or WS_DLGFRAME Or WS_BORDER Or WS_CLIPCHILDREN Or WS_CLIPSIBLINGS Or WS_VISIBLE Or WS_CHILD {1456406528}
'? CType(CP.ExStyle, ExtendedWindowStyles)
'WS_EX_DLGMODALFRAME Or WS_EX_CONTROLPARENT Or WS_EX_APPWINDOW {327681}
' http://www.codeproject.com/Articles/3212/On-Screen-Displays-OSDs
'CP.Style = WS_VISIBLE Or WS_POPUP
'CP.ExStyle = WS_EX_LAYERED Or WS_EX_TOOLWINDOW Or WS_EX_TOPMOST Or WS_EX_TRANSPARENT
CP.ExStyle = CP.ExStyle Or WS_EX_TRANSPARENT Or WS_EX_TOPMOST
Return CP
End Get
End Property
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.Opacity = 0.8
End Sub
End Class
Public Class Form1
Protected Overrides ReadOnly Property CreateParams As CreateParams
Get
Dim CP As CreateParams = MyBase.CreateParams
Const WS_EX_TRANSPARENT As Integer = &H20, WS_EX_TOPMOST As Integer = &H8
CP.ExStyle = CP.ExStyle Or WS_EX_TRANSPARENT Or WS_EX_TOPMOST
Return CP
End Get
End Property
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.ShowInTaskbar = False
Me.Opacity = 0.8
End Sub
End Class
Res5 писал(а):Чтобы клик отслеживался глобально.
Res5 писал(а):А вот чтобы по окну под формой ничего не проходило, если клик попадает в граници формы.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 39