Hi,
I am using a hook with the WH_CALLWNDPROCRET flag to intercept a hwnd's procedure messages and intercept WM_INPUT and WM_PAINT, but I am having problems with it.
I cast the LPARAM to a CWPRETSTRUCT pointer according to msdn: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nc-winuser-hookproc
But unfortunately, the "message" member in the struct is not used the same way as in a normal procedure callback function: https://docs.microsoft.com/en-us/windows/win32/winmsg/using-window-procedures
It's either that or it is garbage data.
Am I using it wrong? would you mind creating a small code example that could help me? Or pointing out my errors, I would really appreciate it.
This is the code I'm using: https://pastebin.com/DNZhUP4m
Thanks in advance,
Chinomso Nosiri.
with window procedure message like WM_PAINT which has a value of 15, it
is called
repeatedly, no?
However, I am getting 32 and 132 and I do not know what cases these are.
they do not match any of the window proc messages.
And the docs contain vague info about that the struct will actually hold:
But for the unforeseeable future, I still want to know what was wrong
here.
I was able to resolve the problem last night via subclassing the window procedure function
Chinomso,
with window procedure message like WM_PAINT which has a value of 15, itThat fully depends on what you do with the window you created. My full
is called
repeatedly, no?
list (from creation of the dialog upto closing it) only shows it twice.
Though you can "force" the message, simply by (partially) covering-and-uncovering your window.
I think the recommended way to get a WM_PAINT message is by using InvalidateRect,
though there are no doubt other ways.
Since Vista there is apparently a thing called Desktop Window Manager, all the
windows are actually stored and the DWM puts them all together
appropriately.
See https://en.wikipedia.org/wiki/Desktop_Window_Manager .
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 64:00:50 |
Calls: | 8,354 |
Calls today: | 14 |
Files: | 13,159 |
Messages: | 5,893,801 |
Posted today: | 1 |