tags:

views:

346

answers:

2

My problem is "how to know which menu item is clicked in visual studio 2005". i wrote some code using hook for monitoring WM_MENUSELECT..it is working fine for notepad,visual c++6.0 applications but when i use this code for VS-2005 it is not woking(these type of msgs are not generating when i click menuitem in VS2005)..

is there any other way to achive this...

please help me on this..i am really getting irritating becoz i am struggling from last one month...

any help is greatly appreciated...

A: 

WM_MENUSELECT is a message from a Windows component. The same message is used, whether you're using C, C++, Delphi or any other language. A trivial difference like VC++6 and VC++8 won't matter. XP or Vista could matter, but I'd doubt it.

Now, it's possible that the actual cause of your difference is a different MFC version or something like that, but without code that would be speculating.

MSalters
+1  A: 

Any time you assume anything about how other people's software is implemented, you run the risk that they did something unusual or otherwise contrary to your expectations. There is no perfect solution here.

Having said that, you could try hooking WM_COMMAND messages instead of WM_MENUSELECT. That's more likely to be used by alternative toolbar/menu implementations.

Dewb