View previous topic :: View next topic |
Author |
Message |
Chb
Joined: 07 Aug 2007 Posts: 2 Location: Germany
|
Posted: Tue Aug 07, 2007 7:38 am Post subject: Changing color of ProgressBar |
|
|
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.
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 |
|
|
cracki
Joined: 07 May 2007 Posts: 10 Location: Germany
|
Posted: Tue Aug 07, 2007 12:27 pm Post subject: |
|
|
Code: |
enum : uint {
PBM_SETBARCOLOR = 0x0409,
PBM_SETBKCOLOR = 0x2001,
}
|
should work with that. _________________ ...meh... |
|
Back to top |
|
|
Chb
Joined: 07 Aug 2007 Posts: 2 Location: Germany
|
Posted: Tue Aug 07, 2007 1:01 pm Post subject: |
|
|
Thanks. 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 |
|
|
|
|
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
|