Code is a little bit more, I directly uploaded to the baidu network backup
http://pan.baidu.com/s/1kT1dAUN
Option Explicit
'Hook Hook type
Public Const WH_CALLWNDPROC=4 'to the window of the message thread or system
Public Const WH_CALLWNDPROCRET=12 'window to return to the message thread or system
Public Const WH_CBT=5 'window change, focus set message thread or system such as
Whether Public Const WH_DEBUG=9 'perform other Hook Hook threads or system
Public Const WH_FOREGROUNDIDLE foreground program=11 'idle thread or system
Public Const WH_GETMESSAGE=3 'message threads in dropping to a message queue or system
Public Const WH_JOURNALPLAYBACK=1 'will be recorded message playback system
Public Const WH_JOURNALRECORD=0 'monitor and record the input message system
Public Const WH_KEYBOARD=2 'keyboard message thread or system
Public Const WH_MOUSE=7 '
the mouse message thread or systemPublic Const WH_MSGFILTER=1 'menu scroll bar, message dialog box thread or system
Public Const WH_SHELL shell=10 'message thread or system
All threads Public Const and WH_SYSMSGFILTER is=6 'menu scroll bar, message dialog system
Public Const WH_HARDWARE=8
Public Const SC_MINIMIZE=& amp; Minimize HF020 '
Public Const SC_MAXIMIZE=& amp; Maximize HF030 '
Public Const SC_NEXTWINDOW=& amp; HF040 & amp;
Public Const SC_PREVWINDOW=& amp; HF050 & amp;
Public Const SC_CLOSE=& amp; HF060 'closing
Public Const SC_MOUSEMENU=& amp; HF090 & amp;
Public Const SC_RESTORE=& amp; HF120 & amp;
Public Const GWL_WNDPROC=(4)
Public Const WM_WINDOWPOSCHANGING=& amp; H46
The Public Type POINT
X As Long
Y As Long
End Type
'Msg structure defines the passed to WH_CALLWNDPROC hook procedure CallWndProc message parameter,
The Public Type Msg
HWND As Long
The message As Long
WParam As Long
LParam As Long
Time As Long
Pt As POINT
End Type
The Public Type the Rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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
Public Declare Function GetWindowRectA Lib "user32" Alias "GetWindowRect (ByVal HWND As Long, lpRect As the Rect) As Long 'frame size
Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal LPFN As Long, ByVal hmod As Long, ByVal dwThreadID As Long) As Long
Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public Declare Function CallNextHookEx Lib "user32. DLL" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any Source, As Any, ByVal Length As Long)
Public Declare Sub API_ copy memory Lib "kernel32. DLL" Alias "RtlMoveMemory" (lpvDest As Msg, ByVal lpvSource As Long, ByVal cbCopy As Long)
Public Declare Sub CopyMemory_Long Lib "kernel32" Alias "RtlMoveMemory" (, Source Destination As Long As Long, ByVal Length As Long)
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal HWND As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Dim HookMsg As Msg, OldHook As Long, PosA OldWindowProc As Long As POINT
The Public Function HookWindowSize (ByVal PID As Long As Long
OldHook=SetWindowsHookEx (WH_CALLWNDPROC, AddressOf CallWinHookProc, GetModuleHandle (StrConv (" Aniu, "vbUnicode)), PID)
HookWindowSize=OldHook
End the Function
The Public Function UnHookWindowSize () As Long
UnHookWindowSize=IIf (UnhookWindowsHookEx (OldHook) & gt; 0, 1, 0)
End the Function
Private Function CallWinHookProc (ByVal mesage As Long, ByVal wParam As Long, ByVal lParam) As Long As Long
Dim PTR As Long
The Debug. Print mesage, wParam, lParam
API_ copy memory HookMsg, lParam LenB (HookMsg)
CopyMemory_Long PTR, HookMsg. Message, 4
If PTR=274 Then
The Select Case HookMsg. WParam
Case SC_MINIMIZE 'minimize message
MsgBox "minimize"
The Exit Function
Case SC_MAXIMIZE 'maximum message
MsgBox "window to maximize
"The Exit Function
Case SC_RESTORE 'Windows restore message
MsgBox "window reduction
"The Exit Function
Case SC_CLOSE 'window message
MsgBox "window"
The Exit Function
End the Select
End the If
CallWinHookProc=CallNextHookEx (OldHook mesage, wParam, lParam)
End the Function
Public Function BanWindowMove (ByVal HWND) As Long As Long
'OldWindowProc=GetWindowLong (HWND, GWL_WNDPROC)
OldWindowProc=SetWindowLong (HWND GWL_WNDPROC, AddressOf WindowProc)
BanWindowMove=IIf (OldWindowProc & gt; 0, 1, 0)
End the Function
Public Function EnableWindowMove (ByVal HWND) As Long As Long
EnableWindowMove=SetWindowLong (HWND GWL_WNDPROC, OldWindowProc)
End the Function
'window to ban mobile
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull