Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
BOOL SetHook(DWORD dwThreadID, DWORD dwProcID)
{
	if (0 == dwThreadID)
	{
		return FALSE;
	}
	g_dwTarProcId = dwProcID;
	g_hHook = SetWindowsHookEx(WH_GETMESSAGE, GetMsgProc, 0, dwThreadID);

	return g_hHook != NULL;
}


g_hHook not NULL, but GetMsgProc not be called...
Posted
Updated 8-Aug-14 6:40am
v2
Comments
Richard MacCutchan 8-Aug-14 12:41pm    
Have you used your debugger to be certain that your proc is not called?
Richard MacCutchan 8-Aug-14 13:16pm    
Is this code running in a separate thread from your message pump?
jim greenq 8-Aug-14 13:28pm    
I use CreateRemoteThread function to Inject a process, and call SetWindowsHookEx function in my hook module's InitInstance function.I hope that you can undersdand what I say,I really not Good at English..
Richard MacCutchan 9-Aug-14 3:19am    
Sorry, but it's impossible to guess what is happening from that information. I can only suggest that you run some more tests.
jim greenq 9-Aug-14 8:54am    
Thank You!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



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