Attribute VB_Name
=
"
Module1
"
Option Explicit
Private Declare Function RegisterShellHook() Function RegisterShellHook Lib "Shell32" Alias "#181" (ByVal hwnd As Long, ByVal nAction As Long) As Long 'use in 98
Private Declare Function RegisterShellHookWindow()Function RegisterShellHookWindow Lib "user32" (ByVal hwnd As Long) As Long 'use in NT5
Private Declare Function RegisterWindowMessage()Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Private Declare Function SetWindowLong()Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowText()Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function CallWindowProc()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
Private Declare Function RegisterServiceProcess()Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
'Powered by barenx
'Private Const HSHELL_WINDOWCREATED = 1 ' 系统级的窗体被创建
'Private Const HSHELL_WINDOWDESTROYED = 2 ' 系统级的窗体即将被关闭
'Private Const HSHELL_ACTIVATESHELLWINDOW = 3 ' SHELL 的主窗体将被激活(本例未用)
'Private Const HSHELL_WINDOWACTIVATED = 4 ' 系统级的窗体被激活
'Private Const HSHELL_GETMINRECT = 5 ' 窗体被最大化或最小化(本例未用)
'Private Const HSHELL_REDRAW = 6 ' Windows 任务栏被刷新(本例未用)
'Private Const HSHELL_TASKMAN = 7 ' 任务列表的内容被选中(本例未用)
'Private Const HSHELL_LANGUAGE = 8 ' 中英文切换或输入法切换(本例未用)
'MSDN
'wParam lParam
'HSHELL_GETMINRECT A pointer to a SHELLHOOKINFO structure.
Option Explicit
Private Declare Function RegisterShellHook() Function RegisterShellHook Lib "Shell32" Alias "#181" (ByVal hwnd As Long, ByVal nAction As Long) As Long 'use in 98
Private Declare Function RegisterShellHookWindow()Function RegisterShellHookWindow Lib "user32" (ByVal hwnd As Long) As Long 'use in NT5
Private Declare Function RegisterWindowMessage()Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long
Private Declare Function SetWindowLong()Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowText()Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function CallWindowProc()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
Private Declare Function RegisterServiceProcess()Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
'Powered by barenx
'Private Const HSHELL_WINDOWCREATED = 1 ' 系统级的窗体被创建
'Private Const HSHELL_WINDOWDESTROYED = 2 ' 系统级的窗体即将被关闭
'Private Const HSHELL_ACTIVATESHELLWINDOW = 3 ' SHELL 的主窗体将被激活(本例未用)
'Private Const HSHELL_WINDOWACTIVATED = 4 ' 系统级的窗体被激活
'Private Const HSHELL_GETMINRECT = 5 ' 窗体被最大化或最小化(本例未用)
'Private Const HSHELL_REDRAW = 6 ' Windows 任务栏被刷新(本例未用)
'Private Const HSHELL_TASKMAN = 7 ' 任务列表的内容被选中(本例未用)
'Private Const HSHELL_LANGUAGE = 8 ' 中英文切换或输入法切换(本例未用)
'MSDN
'wParam lParam
'HSHELL_GETMINRECT A pointer to a SHELLHOOKINFO structure.