Quote Originally Posted by szlamany
oops - here's the link...

http://www.vbforums.com/showthread.php?p=1975442

Although I know nothing about VBA...

As I said the callback procedure in your post only detects when the subclassed Application is activated or deactivated by checking the value of the uMsg and WParam .It doesn't actually retrieve the application being activated.

According to the Documentation, If the Subclassed Application is being deactivated ie WParam=False then lParam is the identifier of the thread that owns the window being activated which is what I want to know.

In theory this should work but I just can't make it work :

I have searched this board and found a sugested solution using the RegisterShellHookWindow which I have tried implementing in EXCEL but I have been unsucceful so far.

Any help anyone ?

Thanks.