AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to change menu font color/style
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 6:01 am    Post subject: How to change menu font color/style Reply with quote

Is there a command that I missed to do that?
I found how to change the background color, but I want a black menu with a white bold font.

(p.s. not talking about the tray menu, but any other GUI menu)

Can be done?
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Aug 22, 2007 6:16 am    Post subject: Re: How to change menu font color/style Reply with quote

Icarus wrote:
I found how to change the background color, but I want a black menu with a white bold font.


I do not think you can change the text color of menu for a single App.
It can be effected only globally.

Smile
Back to top
View user's profile Send private message Send e-mail
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 6:42 am    Post subject: Reply with quote

hmm... interesting.
i was assuming that if bg color can be changed, so can font color.

i feel like the Truman Show lately - I keep reaching the boundaries of the AutoHotkey world... Smile
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Aug 22, 2007 7:10 am    Post subject: Reply with quote

Icarus wrote:
i feel like the Truman Show lately - I keep reaching the boundaries of the AutoHotkey world... Smile


Maybe the boundaries of Windows API .. AutoHotkey is built on Windows API and that is why we get a tiny app sized around 200KB. If menus and controls were owner drawn by AHK, it would bloat the size EXE as well as affect the EXEcution speed.

If you see an APP that has a menu text NOT in default color, probably it was owner drawn.

Smile
Back to top
View user's profile Send private message Send e-mail
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 7:28 am    Post subject: Reply with quote

Yeah yeah, not complaining at all.
The tinyness of AHK and the things it provides is absolutely amazing.

I dont know what would I do without it.

ANd the best thing is, there is a living, breathing community that helps and circulates ideas.

I am just always under the assumption that AHK can do anything, so I keep trying to push the envelope.
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Wed Aug 22, 2007 7:34 am    Post subject: Reply with quote

Although I haven't tried it myself, I believe you can set the Font/TextColor/BackColor of the menu, even individually for each item, using Owner-Drawn Menu:
http://msdn2.microsoft.com/en-us/library/ms647558.aspx#_win32_Creating_Owner_Drawn_Menu_Items
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Aug 22, 2007 7:38 am    Post subject: Reply with quote

That is interesting.. Thanks Sean. I hope someone could wrap it up. Smile
Back to top
View user's profile Send private message Send e-mail
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 7:52 am    Post subject: Reply with quote

Thats a little overboard for me. I get lost at MSDN.
It took me some months to start using DllCall, I believe it will take me some more to collect enough courage to go back into the microsoft maze.
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Wed Aug 22, 2007 8:29 am    Post subject: Reply with quote

Then, what you meant by "I found how to change the background color"?
Usually, changing foreground color is similar to changing background color.
Show us your working code for the background color, then may alter it to the foreground color.
Back to top
View user's profile Send private message
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 8:50 am    Post subject: Reply with quote

There is a built in AHK command
Menu <MenuName>, Color, <ColorCode>

Code:
#SingleInstance Force

Menu Menu_1, Add, Item 1 in menu 1, DoNothing
Menu Menu_1, Color, Yellow      ; Here it is

Gui Add, Text,   x5   w90 vButton_1 gShowMenu, Graphic Button 1
Gui Show

Return

ShowMenu:
   Menu Menu_1, Show
Return

DoNothing:
Return

GuiEscape:
GuiClose:
   ExitApp
Return
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Wed Aug 22, 2007 10:33 am    Post subject: Reply with quote

Icarus wrote:
There is a built in AHK command
Menu <MenuName>, Color, <ColorCode>

I see. Then, I think AHK uses SetMenuInfo API which has a member to set the background color, however, no member corresponding to set the foreground color.
I'm afraid owner-drawn menu seems the only solution.
Back to top
View user's profile Send private message
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 11:01 am    Post subject: Reply with quote

I see.
Thanks for clearing that. Seems odd that one graphical aspect is available, while the other isn't. someone at microsoft got fired before he could finish his code...
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Aug 22, 2007 11:10 am    Post subject: Reply with quote

Icarus wrote:
Seems odd that one graphical aspect is available, while the other isn't. someone at microsoft got fired before he could finish his code...


No Icarus! What Sean means is: AHK has not included that option while Win API actually supports it Smile

Want to post it in the Wish List ? Smile
Back to top
View user's profile Send private message Send e-mail
Icarus



Joined: 24 Nov 2005
Posts: 851

PostPosted: Wed Aug 22, 2007 11:29 am    Post subject: Reply with quote

Smile

ah - so Chris (?) went for coffee in the middle of the implementation....

Will post in wish list.

EDIT:
Posted in wish list
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Wed Aug 22, 2007 12:24 pm    Post subject: Reply with quote

No, I meant that there was no member to set the foreground color.
If it had been there, Chris would have implemented it already, obviously.
Without having it and using Owner-Drawn items, it's tricky to achieve it.
There is an API similar to SetBkColor: SetTextColor.
The tricky part is that it seems to have to be applied before the menu is displayed to take an effect.
Currently, the only solution would be via CBT Hook using ahkhook.dll.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group