Roger Lipscombe
Roger Lipscombe

Reputation: 91895

How do I find out who called SendMessage?

I'm attempting to debug a problem with my Windows installation. The details don't particularly matter, but I'm looking for the answer to the following question:

explorer.exe receives a WM_SETTINGCHANGE message. In WinDbg, I can break at the appropriate WndProc. How do I find out who sent the message? That is: is there any way to trace this back to the process that called SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, ...)?

Upvotes: 5

Views: 1260

Answers (2)

EdChum
EdChum

Reputation: 394269

This blog post may help you perform RPC debugging: http://kobyk.wordpress.com/2008/06/07/remote-procedure-call-debugging/

You will need to enable RPC state gathering: http://msdn.microsoft.com/en-us/library/ff542974.aspx

Upvotes: 0

Deanna
Deanna

Reputation: 24283

Windows messages are anonymous. Your calling app has no way to determine where they come from unless the message defines some way to identify the sender (which would be easily faked)

Upvotes: 1

Related Questions