Меня интересует, как сделать чтобы он работал и с BorderStyle 0 - None У меня из опытов моих ничего не выходит, может есть у кого более мощный модуль?
Модуль
- Код: Выделить всё
Option Explicit
Public Const GWL_WNDPROC = (-4)
Public Const WM_SYSCOMMAND = &H112
Public Const MF_SEPARATOR = &H800&
Public Const MF_CALLBACKS = &H8000000
Public Declare Function AppendMenuA Lib "user32" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Public Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
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 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
Global p&
Public Function Handler&(ByVal h&, ByVal m&, ByVal w&, ByVal l&)
If m = WM_SYSCOMMAND Then If w = &HF Then MsgBox "xxx-xxx-xxx", vbInformation
' &HF - идентификатор добавленой комманды, _
он может быть любым...
Handler = CallWindowProc(p, h, m, w, l)
End Function