forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


api for background colour changes

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Nov 13, 2003 10:15 pm    Post subject: api for background colour changes Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Nov 14, 2003 6:14 am    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Nov 14, 2003 6:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Nov 14, 2003 3:52 pm    Post subject: Reply with quote

You should also be able to simulate editboxes. This way, you can modify them however you like... Smile

See this topic:
http://forum.vdsworld.com/viewtopic.php?p=15654#15654

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Nov 15, 2003 7:57 am    Post subject: Reply with quote

thanks for your suggestion skit...but it's not what i need Sad

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 Very Happy

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Nov 15, 2003 11:43 am    Post subject: Reply with quote

Hi Serge

I don't think I am contradicting myself Wink
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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sat Nov 15, 2003 3:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 15, 2003 3:59 pm    Post subject: Reply with quote

Isn't it possible to add these dialog elements yourself by using APIs? Or do we have to wait for the update for that (because of the 8 parameters limitation)?
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sat Nov 15, 2003 4:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sat Nov 15, 2003 5:25 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sun Nov 16, 2003 8:37 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Nov 17, 2003 4:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Nov 18, 2003 2:22 am    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Thu Jan 08, 2004 5:08 pm    Post subject: Reply with quote

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
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Jan 09, 2004 1:56 am    Post subject: Reply with quote

cool codescript...will look forward to it Very Happy Very Happy Very Happy

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
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
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group