| View previous topic :: View next topic |
| Author |
Message |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Nov 13, 2003 10:15 pm Post subject: api for background colour changes |
|
|
hi,
is there an api call i can use to change the background colours of edit boxes, list boxes and drop down lists? i am wanting to change the background colours on the fly without using STYLE...
thanks in advance
serge
ps i did a search of the forum and found nothing...may be i used the wrong keywords... _________________
|
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Fri Nov 14, 2003 6:14 am Post subject: |
|
|
Hi Serge
To change the color of VDS edit/other controls on the fly may not be possible as far as I know (unless some undocumented features exist)
This is because the VDS runtime is continously drawing the background and changes made by your API calls may dissapear even before you can even see it.
So IMO U have do draw your own controls - list box/edit box etc.
You need to wait for the VDS 5 update for doing this.
I have done that with Richeditbox using VDSUG.dll
Richedit with green background and can be changed to anything on the fly
http://codescript.vdsworld.com/VDS5src/richedit.zip
Transparent RichEdit box (U can add a background Image)
http://codescript.vdsworld.com/VDS5src/TranparentRichedit.zip
These examples may not be a good starting point to learn @LIB/@UG as they are bit complex and I have not seperated the code into a DSU.
You can refer Win 32 Programmers reference and VDS API constants Reference I wrote for getting details on each API as PGWARE already said. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Nov 14, 2003 6:45 am Post subject: |
|
|
gggrrr...and i thought that it was a simple request...thanks for your help codescript...i have downloaded the 2 zip files and i will study them
serge _________________
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sat Nov 15, 2003 7:57 am Post subject: |
|
|
thanks for your suggestion skit...but it's not what i need
codescript, how come you managed to come up with api codes for the table element whereby rows could be coloured on the fly...but there is nothing for edit boxes and others...i'm only saying that because of what you said in your reply which seems to contradict what you managed to do with the table element (which was and is absolutely fantastic!)
| Quote: | | This is because the VDS runtime is continously drawing the background and changes made by your API calls may dissapear even before you can even see it |
just curious
serge _________________
|
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Nov 15, 2003 11:43 am Post subject: |
|
|
Hi Serge
I don't think I am contradicting myself
IMO in a nutshell Listview control(VDS Table) and EDIT/LIST BOX are entirely
different beasts.
Listview has easier API calls to set color which wrap the low level functions
which EDIT/LIST BOX donot have. Also VDS runtime ha hardly utilized the
large number of options which are available in Listview.
Intercepting/hooking WM_CTLCOLOREDIT/WM_CTLCOLORLISTBOX messages are
the starting point of what U R trying to do I think though I may be wrong. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Nov 15, 2003 3:56 pm Post subject: |
|
|
Hi All,
CodeScript is exactly right and he is not contradicting himself. The VDS Table is not a complete wrapper of the ListView control's abilities. Also as for changing the color of the VDS Edit box with WM_CTLCOLOREDIT. I have tried this many times with Gadget's GetMsg functions and it's not possible do to the fact that VDS keeps changing the color back because it is defined at the class level and we cannot return a Brush in response to the WM_CTLCOLOR messages. You have to understand that most of the VDS elements are sub-classed controls. Trying to get between VDS and it's sub-classed control is sometimes not possible. In the case of the VDS table element it has richer API messages for you to change colors and many other things about it. I think the ListView control was one of MS first attempts for a Grid like control and it just stayed with Windows and now it is used everywhere. Windows Explorer uses the ListView control to display all kinds of things. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Nov 15, 2003 4:12 pm Post subject: |
|
|
Well,
Really I don't think it would be possible unless you use a DLL to handle the returns for the messages properly. Also I think that it would be better for this to be done inside VDS or at the very least give us the ability to set the return values for the WindowProc of each element that VDS has. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sat Nov 15, 2003 5:25 pm Post subject: |
|
|
Yes as mindpower said even though you can create a edit box
after the VDS update it would still require a dll.
I think it may be more easily possible in VDS to add such a command
(feature request)
| Code: | | DIALOG SET,STYLE1,$0010B114.$00FFFFFF |
and may be a Dialog Refresh command to repaint the control
(else Dialog Disable -> Enable may be enough) _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sun Nov 16, 2003 8:37 am Post subject: |
|
|
hi codescript,
thanks for your reply...i understand now...i assumed that edit boxes and table elements were the same type of thing and could not understand why one can be manipulated with api's while the other can't
now i understand that they are not the same thing and understand your earlier reply
thanks for clarifying that up
serge _________________
|
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Mon Nov 17, 2003 4:23 pm Post subject: |
|
|
| CodeScript wrote: | and may be a Dialog Refresh command to repaint the control
(else Dialog Disable -> Enable may be enough) |
CodeScript if you need to repaint a control you may be able to send it either a WM_PAINT and/or InvalidateRect function may do the trick. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Nov 18, 2003 2:22 am Post subject: |
|
|
Very much mindpower, But I was talking of a Non API solution in case a "SET STYLE" command is added to VDS in future.
In that case more than likey then a refresh command will also be added.
But as of now everything is just a wish and hypothetical. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Thu Jan 08, 2004 5:08 pm Post subject: |
|
|
I think that should be very much possible (tested) now in a subclassing dll I am building.
It is likely to be in C and only a few kb.
It may take sometime before I make things more generic including
ability to add background images to textbox/listboxes and more ... _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Jan 09, 2004 1:56 am Post subject: |
|
|
cool codescript...will look forward to it
serge _________________
|
|
| Back to top |
|
 |
|