CodePudding user response:
Obtains the window handle to the thread ID, because SetWindowsHOOK parameter is the thread IDCodePudding user response:
Don't quite understand, hook my blog to one thousand the examples do global can intercept the mouse or keyboard hooks, but intercept specified form, can intercept, the program can't intercepted PPT form hooks:=setWindowsHookEx (WH_cat, proc, HInstance, 0); Or hook:=setWindowsHookEx (WH_cat, proc, HInstance, PPPTPid); All this,CodePudding user response:
DLL code, under the great god give directions, do not enter the callback function
The function HookProc (nCode: Integer; WParam: wParam; LParam: lParam) : LRESULT; Stdcall;
The begin
{
Case wParam of
WM_MOUSEMOVE: info:='mouse position;
WM_LBUTTONDOWN: info:='press';
WM_LBUTTONUp: info:='let go';
end;
Info:=Format (" % s: % d, % d ", [info, PMouseHookStruct (lParam) ^. Pt. X, PMouseHookStruct (lParam) ^. Pt. Y]);
}
{through the message data is passed to the specified window}
Info:=IntToStr (wParam);
PostMessage (h, WM_MyMessage, 0, an Integer (PChar (info)));
Result:=CallNextHookEx (hook, nCode wParam, lParam);
end;
The function SetHook: Boolean; Stdcall;
Const
WH_MOUSE_LL=14;
Var h: HWND; Id: the Cardinal;
The begin
//powrpointView window handle to find
H:=FindWindow (' PPTFrameClass 'nil);
H:=FindWindowEx (h, 0, 'MDIClient, nil);
H:=FindWindowEx (h, 0, 'mdiClass, nil);
H:=FindWindowEx (h, 0, 'paneClassDC, nil);
Id=GetWindowThreadProcessId (h, nil);
Hook:=SetWindowsHookEx (WH_CALLWNDPROC, @ HookProc HInstance, id);
Result:=hook & lt;> 0;
end;
CodePudding user response:
Use spy++ grab news isCodePudding user response:
Do global mouse hook or keyboard hook, should be process in the memory space can't visit each other,Must be injected into dynamic link library own programs and other programs share a memory blocks to get information from another program,
CodePudding user response:
Do not understand... if you are convenient, can write a simple demo, thanks a lotCodePudding user response:
Hook window procedure, WH_CALLWNDPROC this Hook will check all message processingYou can directly replace the window procedure, to deal with authority, then the SetWindowLong replace the window procedure
CodePudding user response:
If just monitor the pages, I think you can change the way of thinking, using OLE programming, direct call PowerPoint to the corresponding API can not, only to EXCEL, for the operation of the PowerPoint didn'tCodePudding user response:
Or you write in a Powerpoint a VB code, the news directly to also canCodePudding user response:
PPT page turns, the window does not change, only change the content (page),CodePudding user response: