Thanks for your reply ben,
what i understood from your post is it is difficult to get
menu text bcox so many actions cause WM_COMMAND. but as i learn from msdn
LOWORD of wParam will give the menu identifier.and i found from spy++ that
each menu contains unique identier..by comparing this identifier i thought to
know which menu item is clicked..
(using WH_GETMESSAGE).
i am trying to hook wordpad..any how i got some idea...when i visited the
menu item(wm_menuselect trap with WH_CALLWNDPROC) and got the menu
information.
Here i got one big problem...
when i tried the same code of VS2005 and sql server 2005 it is not
generating any WH_MENUSELECT..then my code become useless...how can we get
the menu item text?
My intesion is:
i want to write menu item text when the user clicks menu
item in any open application(like VS2005 or SQL2005 or MS-Word etc). Please
tell me how can i achive this..which msg i have to trap? which hook i have to
use?(FYI wm_menuselect is not generating in vs2005). i have little bit
knowledge abt hooking..just tell me the way how i do this...
also i want to the information about standard tool bar icons when the user
clicks them..how can i achive this also...please help me...
Thanks in advance..
--
--------------------------------------------
At last i learned something for today...:)
Post by Ben Voigt [C++ MVP]Post by SreeThanks for your reply Ben,
actally my intention is to get menu item
names,which user clicks.
i am using WH_GETMESSAGE hook and processing WM_COMMAND msg. by this
i am only able to get identifier of the menu(which is integer value
not like IDM_xxx).
I used spy++ to know which msgs are generating when i clicked a menu
or standard tool bar icon( ex:paste etc). it is generating wm_command
msg with lparam value is zero..by getting loword of wparam i am able
to get menu identifier..from now how to get menu information?
That's not the menu identifier (which is what you got with WM_MENUSELECT),
it's the command (which is why it comes in WM_COMMAND). How would you tell
Windows what value to send from menus you created? You'll have to check
that structure for every menu in the program and see which one matches,
there is no one-to-one mapping for command like there is for menu ids.
(More than one menu item can send the same command, toolbars and
accelerators/hotkeys can also generate WM_COMMAND). But in most cases
you'll find a menu item that sends the command and you can use its caption.
Post by Sreei mean i need menu item text like "paste ctrl+v", "undo ctrl+z" etc..
please help me..i stuck with this..
(i am able to get menu information when i used WH_CALLWNDPROC hook
and using WM_MENUSELECT but this msg generating when menu item is
visited. i dont want this..i want to know menu information when user
clicks a menu(wm_command) in any open application like notepad
,wordpad etc..)
Thanks in advance...
Post by Ben Voigt [C++ MVP]What message are you processing?
Some messages contain a menu child item id, from which you can
easily learn the menu caption (the string that appears in the menu).
WM_COMMAND contains only an application-specific id. You'd have to
use Spy++ on each such application to find out what number
corresponds to each menu item.
Post by SreeHi guys, no one knows answer for this question? i stuck with this
problem form one week. please help me..
is it possible to know which menu item is clicked using
wh_getmessage hook?
if not possible please tell me the way how can we achive this?
i trying with wh_getmessage hook and i am only able to get
identifier of the
menu item. how to menu information using this identifier? is it
possible? on internet i not found anywhere about this.....
Thank you in advance...
--
--------------------------------------------
At last i learned something for today...:)
Post by SreeHi i am new to hooking..i am using wm_getmessage hook to know which menu item
is clicked.
i am using the follwing code to get identifier of the menu
WORD identifier=LOWORD(pMsg->wParam);
it is giving integer value..up to now is fine...
my problem is how to know which menu item is clicked by using this
identifier? is it possible by this? or is there any other way to know which
menu item clicked?
please explain with code if possible..
Thanks in advance...
--
--------------------------------------------
At last i learned something for today...:)