FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changing color of ProgressBar

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
Chb



Joined: 07 Aug 2007
Posts: 2
Location: Germany

PostPosted: Tue Aug 07, 2007 7:38 am    Post subject: Changing color of ProgressBar Reply with quote

Hi there,

I am fairly new to D and got so far just one question. I have a form, which contains a progressbar. Now I would like to change the color of the progressbar. Due to the fact that progressbars do not seem to have "foreColor"-properties, I think I will have to use the Windows API to get this done.

Therefor I took a look at the function "SendMessage". The MSDN told me the following:
Code:
LRESULT SendMessage(          HWND hWnd,
    UINT Msg,
    WPARAM wParam,
    LPARAM lParam
);


So I wrote to my header:
Code:
private import std.c.windows.windows;
extern (Windows)
{
   public LRESULT SendMessageW(HWND hWnd,
         UINT Msg,
         WPARAM wParam,
         LPARAM lParam
   );
}


My call is:
Code:
      enum : uint {
         PBM_SETBARCOLOR
      }

SendMessageW(pgbHandle, PBM_SETBARCOLOR, 0, RGB(255,150,0));

I do not think, that this is correct. Wink

Another way I could use was dfl.utf.sendMessage. Here is my call:
Code:

      enum : uint {
         PBM_SETBARCOLOR
      }

int result = sendMessage(pgbHandle, 0, 0, RGB(255,150,0));

But this does not work.

Any ideas?

Thanks a lot!
-Chb
Back to top
View user's profile Send private message
cracki



Joined: 07 May 2007
Posts: 10
Location: Germany

PostPosted: Tue Aug 07, 2007 12:27 pm    Post subject: Reply with quote

Code:

enum : uint {
    PBM_SETBARCOLOR = 0x0409,
    PBM_SETBKCOLOR = 0x2001,
}


should work with that.
_________________
...meh...
Back to top
View user's profile Send private message
Chb



Joined: 07 Aug 2007
Posts: 2
Location: Germany

PostPosted: Tue Aug 07, 2007 1:01 pm    Post subject: Reply with quote

Thanks. Smile Actually it works when XP-styles are disabled.
If someone has an idea, how to get it work with XP-styles, let me know.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group