Questions tagged [setwindowshookex]

Use this tag to better reference questions related to SetWindowsHookEx. This function installs an application-defined hook procedure into a hook chain.

Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.

C# Syntax

HHOOK WINAPI SetWindowsHookEx(
  _In_ int       idHook,
  _In_ HOOKPROC  lpfn,
  _In_ HINSTANCE hMod,
  _In_ DWORD     dwThreadId
);

To find more informatoin :

241 questions
0
votes
1 answer

SetWindowsHookEx, identifying the windows dialog where the mouse is pointing

This is another question I have related to setWindowsHookEx, I have written small Application to hook dll into windows calculator applicatio. Basically, exe application inject the dll into calculator and it monitors all the mouse down events…
KItis
  • 5,476
  • 19
  • 64
  • 112
0
votes
1 answer

Blocking windows mouse click using SetWindowsHookEx()

I have written an application to hook some procedure onto a new process to monitor mouse down events and to disable mouse down events on the new process. As of now, I am able to capture to mouse down events coming to this process and I am trying to…
KItis
  • 5,476
  • 19
  • 64
  • 112
0
votes
1 answer

SetWindowsHookEx returns null when hooking to specific thread

I have written following two applications (dll,exe) to hook a dll into putty in order to listen to keyboard events. One application is Dll application which contains the hook method (meconnect). #include "stdafx.h" #include #include…
KItis
  • 5,476
  • 19
  • 64
  • 112
0
votes
1 answer

How to detect if a key has been pressed using VC++

So I am trying to make a keylogger and so obviously I need to get the last character that was entered in order to do this. So far I have been trying to use SetWindowsHookEx() but that hasnt been working, I made the callback function and everything…
sharpchain
  • 355
  • 2
  • 7
  • 15
0
votes
1 answer

Accessing WPF From Unmanaged C++ Code

Background I am currently trying to develop some test software that needs to be notified of window creation and activation events across the desktop, respond to these and walk widget trees in order to read all available text on those windows. This…
0
votes
1 answer

Hook from SetWindowsHookEx freezes process and don't get executed

I tried to hook keyboard of one process, but code of hook don't get executed and process freezes when I press any key. I based my code on following post: How to hook external process with SetWindowsHookEx and WH_KEYBOARD Here is my code of…
0
votes
0 answers

Get data from hook procedure?

I have C++ DLL, that implements CTB_HOOK and c# app, from which I P/Invoke this DLL. The system calls the function below when messages to hooked thread are intercepted (before activating, creating, destroying, minimizing, maximizing, moving, or…
0
votes
1 answer

How do i prevent a mouse from sending input to DirectInput game?

This question was originally about how to trap mouse events, which i solved after a lot of research using SetWindowsHookEx with C++. Problem is, its working for me on Windows, it works in applications, but it doesnt work in games. can somebody help…
MarkosDarkin
  • 315
  • 3
  • 20
0
votes
0 answers

SetWindowsHookEx from static library

I'm trying to install a hook to intercept mouse and keyboard from a library to an executable. If I build the library as a Dynamically Loaded Library everything works fine, but when the I build the library as a static library it doesn't work. To…
zeb
  • 1,105
  • 2
  • 9
  • 32
0
votes
1 answer

VB6 mouse hook to capture a control a user clicks

I have a keyboard hook that listens for [shift] + [F12] key button press to activate an edit mode in my program. By edit mode, I mean that any form that is inactive in the program window is disabled and focus is set to the active window.…
AgotSdev
  • 31
  • 6
0
votes
1 answer

How could I set a global hook by a GUI without UAC prompt on Win7?

I want to set a global hook by SetWindowsHookEx. The hook is wrapped in hook.dll and is registered by a GUI window app.exe. Everything works fine on window NT/xp. But on Win7, how could I start app.exe process without UAC prompt and it can…
Kevin Hou
  • 1
  • 6
0
votes
2 answers

Detect application windows

I use CBT Windows Hook to detect window creation/deletion/min-max/move-size events. I works well, but I need to filter whose events coming from normal widgets. Practically I need to being notified by CBT hook only for those windows that the user…
Luca
  • 11,646
  • 11
  • 70
  • 125
0
votes
1 answer

Retrieve process- or thread-id of global keypress using SetWindowsHookEx

I've got a specific application which I can find using Process.GetProcesses() and filtering by ProcessName. I'd like to filter out all keypress-events of that process, unfortunately one can only pass a optional thread-id to SetWindowsHookEx as…
isHuman
  • 125
  • 9
0
votes
0 answers

Outlook 2013 and Windows key hook using SetWindowsHookEx

I'm trying to build a single key shortcut for Outlook following the code from here: http://blogs.msdn.com/b/vsod/archive/2010/04/08/using-shortcut-keys-to-call-a-function-in-an-office-add-in.aspx It works fine for outlook 2010 but for outlook 2013…
MariusP
  • 17
  • 5
0
votes
2 answers

Capturing active window title failed when WPF application's control focused

I am trying to add to my time tracker window caption tracking using SetWindowsHookEx, but it is works only partially. Here is my code I using to provide subscribers with coresponding event: public class Hooks { #region DllImport delegate…
Alex G.P.
  • 9,609
  • 6
  • 46
  • 81