There are several options:
Winspector
This is a program in which I used most of these Spy ++-like programs, it has all the functions that I needed, and it worked flawlessly on my developer's machine, although it has been quite a while since I used it. And the official site for some reason does not work ( http://www.windows-spy.com/ ), but, fortunately, you can get the version from softpedia: http://www.softpedia.com/get/Security/Security about related / winspector.shtml

Winpy
I used this program for debugging, and finding out what messages were sent to different windows, it worked pretty well and was a good alternative to Spy ++, in addition, it is free. You can download it here: http://www.catch22.net/software/winspy

SpyStudio from Nectra
I have never tried this program, but it seems to do what you ask for, and it is free. It can be found here: http://www.nektra.com/products/spystudio-api-monitor/

(source: nektra.com )
Winid
From what I heard, WinID should be able to do almost the same thing, but I never tried the program myself. You can download it here: http://www.dennisbabkin.com/php/download.php?what=WinID this program is not compatible with Windows Vista though (and probably not Windows 7 either).
Difficult option
If you have something innovative, you may want to create your own utility, although this is most likely not what you need, but if it is, you can check these pages of the project code:
All this is much like the Spy ++ program that comes with Visual Studio. And last but not least, you can find other programs in this thread: I want Spy ++, but I don't have Visual Studio
source share