I'm trying to get Pointer Win32 messages of a specific window, by a hook on WH_CALLWNDPROC, WH_CALLWNDPROCRET and WH_GETMESSAGE.
I use SetWindowsHookEx in a c++ dll to hook and receive messages.
unsigned long processID = 0;
unsigned long threadID = GetWindowThreadProcessId(hWnd, &processID);
g_hhkGetMsg = SetWindowsHookEx(WH_GETMESSAGE,
GetMsgProc,
g_hinstDLL,
threadID);
This works for many windows, but not for CoreWindow of UWP windows.
Each UWP app window has a structure like this: 
Hooking to ApplicationFrameWindow works correctly, but hooking to Windows.UI.Core.CoreWindow does not work. (SetWindowsHookEx shows success, but I don't get any messages in the callback)
However, Spy++ is able to capture the messages from the CoreWindow. (The CoreWindow receives WM_POINTER messages, so I need to subscribe to that window)
Thinking the issue might be on my code, I also tried the open source tool MyLiteSpy to see if that can capture messages from the CoreWindow. It can't capture anything, just like my sample code. (But MyLiteSpy is able to get messages from ApplicationFrameWindow of the same UWP app, and so can my code and Spy++)
Interestingly, this (old) blog post about Spy++ says that they use the same three hooks as me and MyLiteSpy, but it's getting messages that my code can't receive.
What is the difference here? Any idea why this is happening?
(Is Spy++ using hooks other than the three mentioned? The blog post is written in 2007, so things might have changed)



