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 

StatusBar Background Problem [Solved-Windows Bug]

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
dmatch



Joined: 15 Oct 2007
Posts: 112

PostPosted: Thu Dec 06, 2007 3:11 am    Post subject: StatusBar Background Problem [Solved-Windows Bug] Reply with quote

On my older system (Windows Me) a Gui StatusBar background option fills the entire status bar with the requested color except when the Gui window has a resize option. Then the status bar background is incompletely colored in the area of the bottom right corner that contains the diagonal resize control.

On my Windows Xp SP2 MCE the status bar background color has no effect at all. Whether there is a resize option or not it does not color any of the background as requested.

Is there a bug or is something wrong with the demonstration code below or what?

I am running AHK version 1.0.47.02. If this is a bug has this been corrected in later versions?

Code:

Gui, +Resize
Gui, Add, StatusBar, BackgroundRed
Gui, Show, x10 y10 w200 h100, Test

return
GuiClose:
ExitApp


I used red because it is so easy to see what is happening.

dmatch


Last edited by dmatch on Thu Dec 06, 2007 9:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6307
Location: Pacific Northwest, US

PostPosted: Thu Dec 06, 2007 6:16 pm    Post subject: Reply with quote

My XP SP2 (not MCE) shows the behavior the same as your ME.

I think this is windows' fault, not AHK. Not many programs have a colored statusbar. can you give an example of one, so we may check how they dealt with the issue?
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
dmatch



Joined: 15 Oct 2007
Posts: 112

PostPosted: Thu Dec 06, 2007 7:02 pm    Post subject: What Style Windows? Reply with quote

Actually, I don't know of any programs that use a status bar with custom color. I was working on putting a progress bar on a status bar (another recent thread) when I ran into this. Even in that case it's not a big deal since the addition of color to the status bar was academic and I really do not have a use for it other than trying to support all options available with StatusBar. BTW, I posted a function that uses a real progress bar in that thread.

What window style (theme) do you use in XP? I am using an XPXLargeFont (on HDTV).

I could easily believe this is a Windows related bug Wink , but then I don't know the exact method by which AHK attempts to make the background color change.

Thanks for the feedback.

dmatch
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6307
Location: Pacific Northwest, US

PostPosted: Thu Dec 06, 2007 7:21 pm    Post subject: Re: What Style Windows? Reply with quote

dmatch wrote:

What window style (theme) do you use in XP? I am using an XPXLargeFont (on HDTV).

Win 2000 style, ATM.

dmatch wrote:

I could easily believe this is a Windows related bug Wink , but then I don't know the exact method by which AHK attempts to make the background color change.

AHK is open source Wink
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
dmatch



Joined: 15 Oct 2007
Posts: 112

PostPosted: Thu Dec 06, 2007 9:51 pm    Post subject: Microsoft Frog Croaks Again Reply with quote

engunneer wrote:

AHK is open source Wink


Indeed it is and a quick look into the source reveals that the following code in script_gui.cpp creates the status bar and sets its background:
Code:

   case GUI_CONTROL_STATUSBAR:
      if (control.hwnd = CreateStatusWindow(style, aText, mHwnd, (UINT)(size_t)control_id))
      {
         mStatusBarHwnd = control.hwnd;
         if (opt.color_bk != CLR_INVALID) // Explicit color change was requested.
            SendMessage(mStatusBarHwnd, SB_SETBKCOLOR, 0, opt.color_bk);
      }
      break;
   }

Even though MSDN says that CreateStatusWindow is obsolete it also says that it passes all parameters to CreatWindow unchanged. It would indeed appear to be a problem with Windows. The background color is changed after window creation so I guess the Windows code that applied the color change didn't change the colors of the resize grip which appears to be some sort of square bitmap or whatever.

Microsoft Frog croaks again!

Edited to Add:

BTW, the XP theme I am using has a brushed aluminum look to the status bar and appears to be a gradient image so that would probably explain why a status bar background color is being ignored. An image of appropriate color(s) would have to be generated on the fly.

dmatch
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
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