📄 jwawinable.pas
字号:
// that for a call to TrackPopupMenu(), a client will see EVENT_SYSTEM_MENUSTART
// followed almost immediately by EVENT_SYSTEM_MENUPOPUPSTART for the popup
// being shown.
//
EVENT_SYSTEM_MENUPOPUPSTART = $0006;
{$EXTERNALSYM EVENT_SYSTEM_MENUPOPUPSTART}
EVENT_SYSTEM_MENUPOPUPEND = $0007;
{$EXTERNALSYM EVENT_SYSTEM_MENUPOPUPEND}
//
// EVENT_SYSTEM_CAPTURESTART
// EVENT_SYSTEM_CAPTUREEND
// Sent when a window takes the capture and releases the capture.
//
EVENT_SYSTEM_CAPTURESTART = $0008;
{$EXTERNALSYM EVENT_SYSTEM_CAPTURESTART}
EVENT_SYSTEM_CAPTUREEND = $0009;
{$EXTERNALSYM EVENT_SYSTEM_CAPTUREEND}
//
// EVENT_SYSTEM_MOVESIZESTART
// EVENT_SYSTEM_MOVESIZEEND
// Sent when a window enters and leaves move-size dragging mode.
//
EVENT_SYSTEM_MOVESIZESTART = $000A;
{$EXTERNALSYM EVENT_SYSTEM_MOVESIZESTART}
EVENT_SYSTEM_MOVESIZEEND = $000B;
{$EXTERNALSYM EVENT_SYSTEM_MOVESIZEEND}
//
// EVENT_SYSTEM_CONTEXTHELPSTART
// EVENT_SYSTEM_CONTEXTHELPEND
// Sent when a window enters and leaves context sensitive help mode.
//
EVENT_SYSTEM_CONTEXTHELPSTART = $000C;
{$EXTERNALSYM EVENT_SYSTEM_CONTEXTHELPSTART}
EVENT_SYSTEM_CONTEXTHELPEND = $000D;
{$EXTERNALSYM EVENT_SYSTEM_CONTEXTHELPEND}
//
// EVENT_SYSTEM_DRAGDROPSTART
// EVENT_SYSTEM_DRAGDROPEND
// Sent when a window enters and leaves drag drop mode. Note that it is up
// to apps and OLE to generate this, since the system doesn't know. Like
// EVENT_SYSTEM_SOUND, it will be a while before this is prevalent.
//
EVENT_SYSTEM_DRAGDROPSTART = $000E;
{$EXTERNALSYM EVENT_SYSTEM_DRAGDROPSTART}
EVENT_SYSTEM_DRAGDROPEND = $000F;
{$EXTERNALSYM EVENT_SYSTEM_DRAGDROPEND}
//
// EVENT_SYSTEM_DIALOGSTART
// EVENT_SYSTEM_DIALOGEND
// Sent when a dialog comes up and just before it goes away.
//
EVENT_SYSTEM_DIALOGSTART = $0010;
{$EXTERNALSYM EVENT_SYSTEM_DIALOGSTART}
EVENT_SYSTEM_DIALOGEND = $0011;
{$EXTERNALSYM EVENT_SYSTEM_DIALOGEND}
//
// EVENT_SYSTEM_SCROLLINGSTART
// EVENT_SYSTEM_SCROLLINGEND
// Sent when beginning and ending the tracking of a scrollbar in a window,
// and also for scrollbar controls.
//
EVENT_SYSTEM_SCROLLINGSTART = $0012;
{$EXTERNALSYM EVENT_SYSTEM_SCROLLINGSTART}
EVENT_SYSTEM_SCROLLINGEND = $0013;
{$EXTERNALSYM EVENT_SYSTEM_SCROLLINGEND}
//
// EVENT_SYSTEM_SWITCHSTART
// EVENT_SYSTEM_SWITCHEND
// Sent when beginning and ending alt-tab mode with the switch window.
//
EVENT_SYSTEM_SWITCHSTART = $0014;
{$EXTERNALSYM EVENT_SYSTEM_SWITCHSTART}
EVENT_SYSTEM_SWITCHEND = $0015;
{$EXTERNALSYM EVENT_SYSTEM_SWITCHEND}
//
// EVENT_SYSTEM_MINIMIZESTART
// EVENT_SYSTEM_MINIMIZEEND
// Sent when a window minimizes and just before it restores.
//
EVENT_SYSTEM_MINIMIZESTART = $0016;
{$EXTERNALSYM EVENT_SYSTEM_MINIMIZESTART}
EVENT_SYSTEM_MINIMIZEEND = $0017;
{$EXTERNALSYM EVENT_SYSTEM_MINIMIZEEND}
//
// Object events
//
// The system AND apps generate these. The system generates these for
// real windows. Apps generate these for objects within their window which
// act like a separate control, e.g. an item in a list view.
//
// For all events, if you want detailed accessibility information, callers
// should
// * Call AccessibleObjectFromWindow() with the hwnd, idObject parameters
// of the event, and IID_IAccessible as the REFIID, to get back an
// IAccessible* to talk to
// * Initialize and fill in a VARIANT as VT_I4 with lVal the idChild
// parameter of the event.
// * If idChild isn't zero, call get_accChild() in the container to see
// if the child is an object in its own right. If so, you will get
// back an IDispatch* object for the child. You should release the
// parent, and call QueryInterface() on the child object to get its
// IAccessible*. Then you talk directly to the child. Otherwise,
// if get_accChild() returns you nothing, you should continue to
// use the child VARIANT. You will ask the container for the properties
// of the child identified by the VARIANT. In other words, the
// child in this case is accessible but not a full-blown object.
// Like a button on a titlebar which is 'small' and has no children.
//
//
EVENT_OBJECT_CREATE = $8000; // hwnd + ID + idChild is created item
{$EXTERNALSYM EVENT_OBJECT_CREATE}
EVENT_OBJECT_DESTROY = $8001; // hwnd + ID + idChild is destroyed item
{$EXTERNALSYM EVENT_OBJECT_DESTROY}
EVENT_OBJECT_SHOW = $8002; // hwnd + ID + idChild is shown item
{$EXTERNALSYM EVENT_OBJECT_SHOW}
EVENT_OBJECT_HIDE = $8003; // hwnd + ID + idChild is hidden item
{$EXTERNALSYM EVENT_OBJECT_HIDE}
EVENT_OBJECT_REORDER = $8004; // hwnd + ID + idChild is parent of zordering children
{$EXTERNALSYM EVENT_OBJECT_REORDER}
//
// NOTE:
// Minimize the number of notifications!
//
// When you are hiding a parent object, obviously all child objects are no
// longer visible on screen. They still have the same "visible" status,
// but are not truly visible. Hence do not send HIDE notifications for the
// children also. One implies all. The same goes for SHOW.
//
EVENT_OBJECT_FOCUS = $8005; // hwnd + ID + idChild is focused item
{$EXTERNALSYM EVENT_OBJECT_FOCUS}
EVENT_OBJECT_SELECTION = $8006; // hwnd + ID + idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
{$EXTERNALSYM EVENT_OBJECT_SELECTION}
EVENT_OBJECT_SELECTIONADD = $8007; // hwnd + ID + idChild is item added
{$EXTERNALSYM EVENT_OBJECT_SELECTIONADD}
EVENT_OBJECT_SELECTIONREMOVE = $8008; // hwnd + ID + idChild is item removed
{$EXTERNALSYM EVENT_OBJECT_SELECTIONREMOVE}
EVENT_OBJECT_SELECTIONWITHIN = $8009; // hwnd + ID + idChild is parent of changed selected items
{$EXTERNALSYM EVENT_OBJECT_SELECTIONWITHIN}
//
// NOTES:
// There is only one "focused" child item in a parent. This is the place
// keystrokes are going at a given moment. Hence only send a notification
// about where the NEW focus is going. A NEW item getting the focus already
// implies that the OLD item is losing it.
//
// SELECTION however can be multiple. Hence the different SELECTION
// notifications. Here's when to use each:
//
// (1) Send a SELECTION notification in the simple single selection
// case (like the focus) when the item with the selection is
// merely moving to a different item within a container. hwnd + ID
// is the container control, idChildItem is the new child with the
// selection.
//
// (2) Send a SELECTIONADD notification when a new item has simply been added
// to the selection within a container. This is appropriate when the
// number of newly selected items is very small. hwnd + ID is the
// container control, idChildItem is the new child added to the selection.
//
// (3) Send a SELECTIONREMOVE notification when a new item has simply been
// removed from the selection within a container. This is appropriate
// when the number of newly selected items is very small, just like
// SELECTIONADD. hwnd + ID is the container control, idChildItem is the
// new child removed from the selection.
//
// (4) Send a SELECTIONWITHIN notification when the selected items within a
// control have changed substantially. Rather than propagate a large
// number of changes to reflect removal for some items, addition of
// others, just tell somebody who cares that a lot happened. It will
// be faster an easier for somebody watching to just turn around and
// query the container control what the new bunch of selected items
// are.
//
EVENT_OBJECT_STATECHANGE = $800A; // hwnd + ID + idChild is item w/ state change
{$EXTERNALSYM EVENT_OBJECT_STATECHANGE}
EVENT_OBJECT_LOCATIONCHANGE = $800B; // hwnd + ID + idChild is moved/sized item
{$EXTERNALSYM EVENT_OBJECT_LOCATIONCHANGE}
EVENT_OBJECT_NAMECHANGE = $800C; // hwnd + ID + idChild is item w/ name change
{$EXTERNALSYM EVENT_OBJECT_NAMECHANGE}
EVENT_OBJECT_DESCRIPTIONCHANGE = $800D; // hwnd + ID + idChild is item w/ desc change
{$EXTERNALSYM EVENT_OBJECT_DESCRIPTIONCHANGE}
EVENT_OBJECT_VALUECHANGE = $800E; // hwnd + ID + idChild is item w/ value change
{$EXTERNALSYM EVENT_OBJECT_VALUECHANGE}
EVENT_OBJECT_PARENTCHANGE = $800F; // hwnd + ID + idChild is item w/ new parent
{$EXTERNALSYM EVENT_OBJECT_PARENTCHANGE}
EVENT_OBJECT_HELPCHANGE = $8010; // hwnd + ID + idChild is item w/ help change
{$EXTERNALSYM EVENT_OBJECT_HELPCHANGE}
EVENT_OBJECT_DEFACTIONCHANGE = $8011; // hwnd + ID + idChild is item w/ def action change
{$EXTERNALSYM EVENT_OBJECT_DEFACTIONCHANGE}
EVENT_OBJECT_ACCELERATORCHANGE = $8012; // hwnd + ID + idChild is item w/ keybd accel change
{$EXTERNALSYM EVENT_OBJECT_ACCELERATORCHANGE}
implementation
const
user32 = 'user32.dll';
{$IFDEF DYNAMIC_LINK}
var
_GetGUIThreadInfo: Pointer;
function GetGUIThreadInfo;
begin
GetProcedureAddress(_GetGUIThreadInfo, user32, 'GetGUIThreadInfo');
asm
mov esp, ebp
pop ebp
jmp [_GetGUIThreadInfo]
end;
end;
{$ELSE}
function GetGUIThreadInfo; external user32 name 'GetGUIThreadInfo';
{$ENDIF DYNAMIC_LINK}
{$IFDEF DYNAMIC_LINK}
var
_GetWindowModuleFileNameW: Pointer;
function GetWindowModuleFileNameW;
begin
GetProcedureAddress(_GetWindowModuleFileNameW, user32, 'GetWindowModuleFileNameW');
asm
mov esp, ebp
pop ebp
jmp [_GetWindowModuleFileNameW]
end;
end;
{$ELSE}
function GetWindowModuleFileNameW; external user32 name 'GetWindowModuleFileNameW';
{$ENDIF DYNAMIC_LINK}
{$IFDEF DYNAMIC_LINK}
var
_GetWindowModuleFileNameA: Pointer;
function GetWindowModuleFileNameA;
begin
GetProcedureAddress(_GetWindowModuleFileNameA, user32, 'GetWindowModuleFileNameA');
asm
mov esp, ebp
pop ebp
jmp [_GetWindowModuleFileNameA]
end;
end;
{$ELSE}
function GetWindowModuleFileNameA; external user32 name 'GetWindowModuleFileNameA';
{$ENDIF DYNAMIC_LINK}
{$IFDEF UNICODE}
{$IFDEF DYNAMIC_LINK}
var
_GetWindowModuleFileName: Pointer;
function GetWindowModuleFileName;
begin
GetProcedureAddress(_GetWindowModuleFileName, user32, 'GetWindowModuleFileNameW');
asm
mov esp, ebp
pop ebp
jmp [_GetWindowModuleFileName]
end;
end;
{$ELSE}
function GetWindowModuleFileName; external user32 name 'GetWindowModuleFileNameW';
{$ENDIF DYNAMIC_LINK}
{$ELSE}
{$IFDEF DYNAMIC_LINK}
var
_GetWindowModuleFileName: Pointer;
function GetWindowModuleFileName;
begin
GetProcedureAddress(_GetWindowModuleFileName, user32, 'GetWindowModuleFileNameA');
asm
mov esp, ebp
pop ebp
jmp [_GetWindowModuleFileName]
end;
end;
{$ELSE}
function GetWindowModuleFileName; external user32 name 'GetWindowModuleFileNameA';
{$ENDIF DYNAMIC_LINK}
{$ENDIF}
{$IFDEF DYNAMIC_LINK}
var
_BlockInput: Pointer;
function BlockInput;
begin
GetProcedureAddress(_BlockInput, user32, 'BlockInput');
asm
mov esp, ebp
pop ebp
jmp [_BlockInput]
end;
end;
{$ELSE}
function BlockInput; external user32 name 'BlockInput';
{$ENDIF DYNAMIC_LINK}
{$IFDEF DYNAMIC_LINK}
var
_SendInput: Pointer;
function SendInput;
begin
GetProcedureAddress(_SendInput, user32, 'SendInput');
asm
mov esp, ebp
pop ebp
jmp [_SendInput]
end;
end;
{$ELSE}
function SendInput; external user32 name 'SendInput';
{$ENDIF DYNAMIC_LINK}
{$IFDEF DYNAMIC_LINK}
var
_NotifyWinEvent: Pointer;
procedure NotifyWinEvent;
begin
GetProcedureAddress(_NotifyWinEvent, user32, 'NotifyWinEvent');
asm
mov esp, ebp
pop ebp
jmp [_NotifyWinEvent]
end;
end;
{$ELSE}
procedure NotifyWinEvent; external user32 name 'NotifyWinEvent';
{$ENDIF DYNAMIC_LINK}
{$IFDEF DYNAMIC_LINK}
var
_SetWinEventHook: Pointer;
function SetWinEventHook;
begin
GetProcedureAddress(_SetWinEventHook, user32, 'SetWinEventHook');
asm
mov esp, ebp
pop ebp
jmp [_SetWinEventHook]
end;
end;
{$ELSE}
function SetWinEventHook; external user32 name 'SetWinEventHook';
{$ENDIF DYNAMIC_LINK}
{$IFDEF DYNAMIC_LINK}
var
_UnhookWinEvent: Pointer;
function UnhookWinEvent;
begin
GetProcedureAddress(_UnhookWinEvent, user32, 'UnhookWinEvent');
asm
mov esp, ebp
pop ebp
jmp [_UnhookWinEvent]
end;
end;
{$ELSE}
function UnhookWinEvent; external user32 name 'UnhookWinEvent';
{$ENDIF DYNAMIC_LINK}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -