-
Dec 13th, 2005, 03:47 PM
#1
-
Dec 16th, 2005, 04:44 PM
#2
Re: Changing Color of API-Created Context Menu
-
Dec 16th, 2005, 07:52 PM
#3
Re: Changing Color of API-Created Context Menu
I'm not sure what the actual problem is...
Are you having a trouble changing menu backcolor or displaying your own "context menu" instead of default?
Also, not sure what that ocx does but looks like too much code involved.
You may subclass WM_CONTEXTMENU message lso you would pop your menu instead - here is a subclassing sample by Randy Birch .
Once backcolor is changed any poppup menu will appear "dressed" in that color.
-
Dec 17th, 2005, 05:57 AM
#4
Re: Changing Color of API-Created Context Menu
Originally Posted by RhinoBull
I'm not sure what the actual problem is...
Are you having a trouble changing menu backcolor or displaying your own "context menu" instead of default?
Also, not sure what that ocx does but looks like too much code involved.
You may subclass WM_CONTEXTMENU message lso you would pop your menu instead - here is a subclassing sample by Randy Birch .
Once backcolor is changed any poppup menu will appear "dressed" in that color.
Thanks RB for your reply.
Sorry for not explaining my problem properly.
Here is my problem :
The 'target' window is a compiled application. It is a custom-made Text-To-Speech application, I don't have it it's source. I'm not sure if subclassing will work here.
The application displays text in a RTB, but it doesnot uses any formatting. It uses same font and style for all text. It doesn't have any zoom feature.
It is a problem for users with eyesight problem. I want to add Zoom functionality in this RTB. (EM_GETZOOM and EM_SETZOOM).
This application uses RTB's default context menu (AutoVerbMenu), so, IMO if I add more menuitems in that RTB's contextmenu, it will be easier for users to access these new features without switching to MY application window. (Also, IMHO, it will be good idea to not destroy the default contextmenu, as I don't know if the app runs any other code behind it.)
But the problem is, unlike normal TextBox, RTB doesn't uses any WM_CONTEXTMENU message. It uses WM_INITMENOPOPUP instead. The screenshot attatched is the messages I've found in Spy++ when user right-clicks on RTB.
There is no WM_CONTEXTMENU message. So, I hooked the external RTB and when I receive WM_INITMENUPOPUP message, I added my new menuitems by AddMyMenu() sub.
Then I'm tracking which menuitem is clicked. If user clicked one of MY menuitems, I'm executing it's code when I get WM_EXITMENUPOPUP
If you run the code attatched in the first post, you'll see that, it succesfully hooks into RTB and adds new menuitems.
But I want to change the color of "My Format Menu" item ( and it's submenu). And/Or add a bitmap. (pls see the attatched image).
Is it possible ?
-
Dec 18th, 2005, 06:42 PM
#5
Re: Changing Color of API-Created Context Menu
Once you've created your new menu item, can't you simply call SetMenuInfo to change its backcolor?
-
Dec 18th, 2005, 06:46 PM
#6
Re: Changing Color of API-Created Context Menu
I don't know how to change back color of (non-ownerdrawn) menu item.
What flages I need in MENUITEMINFO structure ?
-
Jan 9th, 2006, 08:02 PM
#7
Re: Changing Color of API-Created Context Menu
-
Jan 9th, 2006, 08:37 PM
#8
Re: Changing Color of API-Created Context Menu
I'm subscribed to this thread from the beggining , I tryied many ways to do it with not success, I think the Richtextbox Context menu in the other app doesn't allow you to paint it, or maybe its being painted but menuinfo/menuiteminfo is changed back on the RTB Paint. I think the closer I've got was showing a already colored and "iconed" Menu, but this menu must be present in the caller app (not the one with the rtb), the problem about this is that the first app is focused. It's a shame, because the rich textbox reacts well to events, but it's impossible to close the context menu with right click (that window lost the focus)
Also tryied to catch WM_PAINT message, but it was never fired , maybe another kind of hook is needed here.
Last edited by jcis; Jan 9th, 2006 at 08:53 PM.
-
Jan 10th, 2006, 04:58 AM
#9
Re: Changing Color of API-Created Context Menu
I tried with many other context menus. Like Notepad/Wordpad/Desktop/Taskbar.
But I haven't succeeded to add color/icon in any case.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|