Click here to Skip to main content
15,886,799 members

Hooking CListCtrl for a MFC application.

doubts.vc asked:

Open original thread
Hi,
I was trying to write a hook for an application using the SetWindowsHookEx.
I created a DLL and hooked to the application by statically linking to it.
I was getting proper notifications for the button and edit controls etc. But when i tried for CListCtrl/CListView it is not working. I get a lot of messages. But i cant get anything meaning full out of it.
When i checked with spy++ also it is not showing CLitstCtr. Is there a way to get the messages from CListCtr?

My intention is to log all the events happening on a CListCtrl in my application.
I have event handlers for handling the event properly. My code is simple . Create a DocView application with CListView as the view class. make it report style and have some items in it. Create a dll which export functions to hook the application. These exposed dll function will be calling SetWindowsHookEx .
eg:
SetWindowsHookEx(WH_GETMESSAGE,
(HOOKPROC)msghook,
hInst,
0);
Here msghook is the function which i use for finding the messages. Inside the function we convert lparam to get the message (LPMSG msg = (LPMSG)lParam;)
I get proper messages for normal controls. But for CListCrel there is noting which i can use.
Is there any way to hook a CListView

WBR,
Sourabh
Tags: C++, VC++, MFC

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900