AutoHotkey Community

It is currently May 25th, 2012, 3:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: August 22nd, 2007, 7:01 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
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?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 22nd, 2007, 7:16 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 7:42 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
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... :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 8:10 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Icarus wrote:
i feel like the Truman Show lately - I keep reaching the boundaries of the AutoHotkey world... :)


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.

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 8:28 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 8:34 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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/librar ... Menu_Items


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 8:38 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
That is interesting.. Thanks Sean. I hope someone could wrap it up. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 8:52 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 9:29 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 9:50 am 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 11:33 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 12:01 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 12:10 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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 :)

Want to post it in the Wish List ? :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 12:29 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
:)

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

Will post in wish list.

EDIT:
Posted in wish list


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 22nd, 2007, 1:24 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, engunneer, gemisigo, rbrtryn, sarevok9, tank, vsub and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group