English
Forum

colours for Controls Change

 

Peter
Mallow
Hi,
is it z.B. possible The Hintergrundsfarbe of/ one Listbox To Change without additional DLL?
with a RichEdit need I only a Message send, however for Listboxes can I no Message find.
another Possibility would possible with of/ one Callback-Routiene as in the example in the Profanhilfe described is (Listing: Callback (Text box color))

only create I not this code for a Listbox umzuschreiben.

can someone Approaches supplying? though if it slight with of/ one Message goes, then is me the rather
 
WinXP Pro SP2, XProfan 9 + XPSE
AMD Athlon 64 X2 3800
10/03/05  
 



Search => Codes... => Codesnippets-Finder => coloured...

For which have I the part geproggt...?

salvo.
 
10/03/05  
 




Peter
Mallow
Sorry, there have I do not sought.

but the example functions unfortunately not.
I see no differences:
CompileMarkSeparation
 {$cleq}
###########################
Thema : Subclassing
###########################
Listbox mit Hintergrundbild
###########################
Andreas Miethe
Oktober 2003
###########################
 $H Windows.ph
 $H Structs.ph
 $H Messages.ph
Set(FastMode,1)

Proc Setcolor

    Parameters Wparam&,Col&

    If Brush&

        ~Deleteobject(Brush&)

    Endif

    Brush& = ~Createsolidbrush(Col&)
    Return Brush&

Endproc

Struct Ps = ~Paintstruct
Struct Rect = ~Rect
Declare Ende&,Listbox&,Oldlbproc&,Brush&
Declare Hdc&, Mdc&, M2dc&, Width&, Height&, Painting&
Declare Image&,Moldobject&,M2oldobject&,Hmbitmap&
Declare Ps#,Rect#
Dim Ps#,Ps
Dim Rect#,Rect

Proc Lbproc

    Declare Result&
    Parameters Wnd&, Msg&, Wparam&, Lparam&
    Result& = 0

    If Msg& = ~Wm_erasebkgnd

        Result& = 1

    Elseif Msg& = ~Wm_paint

        If Painting& = 0

            Painting& = 1
            Result& = ~Callwindowproc(Oldlbproc&, Wnd&, Msg&, M2dc&,Lparam&)
            ~Beginpaint(Wnd&, Ps#)
            ~Getclientrect(Listbox&,Rect#)
            ~Bitblt(M2dc&, Rect#.Left&,Rect#.Top&,Rect#.Right&,Rect#.Bottom&, Mdc&,Rect#.Left&,Rect#.Top&, ~Srcand)
            ~BitBlt(m2dc&, 0, 0, width&, height&, mDC&, 0, 0, ~SRCAND)
            Hdc& = ~Getdc(Wnd&)
            ~Bitblt(Hdc&, Rect#.Left&,Rect#.Top&,Rect#.Right&,Rect#.Bottom&, M2dc&,Rect#.Left&,Rect#.Top&, ~Srccopy)
            ~BitBlt(hdc&, 0, 0, width&, height&, m2DC&, 0, 0, ~SRCCOPY)
            ~Releasedc(Wnd&, Hdc&)
            ~Endpaint(Wnd&, Ps#)
            Painting& = 0

        Endif

    Else

        Result& = ~Callwindowproc(Oldlbproc&,Wnd&, Msg&, Wparam&, Lparam&)

    Endif

    Return Result&

Endproc

Cls ~Getsyscolor(~Color_btnface)
Image& = ~Loadimage(0,tile.bmp,0,640,480,$10)
Width& = 640
Height& = 480
Hdc& = ~Getdc(%Hwnd)
Mdc& = ~Createcompatibledc(%Hdc)
Moldobject& = ~Selectobject(Mdc&, Hmbitmap&)
Moldobject& = ~Selectobject(Mdc&, Image&)
M2dc& = ~Createcompatibledc(Hdc&)
Hmbitmap& = ~Createcompatiblebitmap(%Hdc,Width&,Height&)
M2oldobject& = ~Selectobject(M2dc&, Hmbitmap&)
~Releasedc(%Hwnd,Hdc&)
Clearlist
Addfiles *.*
Listbox& = Create(Listbox,%Hwnd,,0,0,0,0)
~Setwindowpos(Listbox&,0,10,10,300,292,~Swp_showwindow)
Movelisttolist(Listbox&)
~Sendmessage(Listbox&,~Wm_setfont,~Getstockobject(~Default_gui_font),0)
Oldlbproc& = ~Setwindowlong(Listbox&,~Gwl_wndproc, Procaddr(Lbproc,4))
Repaint
Usermessages ~Wm_close

Whilenot Ende&

    Waitinput

    If Getfocus(Listbox&)

        Sendmessage(Listbox&,~Wm_paint,0,0)

    Endif

    If %Umessage = ~Wm_close

        ~Deleteobject(Image&)
        Ende& = 1

    Endif

Wend

 
WinXP Pro SP2, XProfan 9 + XPSE
AMD Athlon 64 X2 3800
10/03/05  
 




Peter
Mallow
my Error functions still, if I The address to that Hintergrundsbild change.

but GEHTS Perhaps too plainer? want only The colour the Hintergrundes (Black) and the Schriftfarbe ($FFFFFF) of/ one Listbox Change.
 
WinXP Pro SP2, XProfan 9 + XPSE
AMD Athlon 64 X2 3800
10/16/05  
 




Frank
Abbing
Hello Peter,

without you To near zurück To want, is me noticed, that You you gladly Codes of others people create can...
Nimm you still time whom Code Andreas to and try it yourself abzuspecken. engage you so, so long is it Yes not. you become remember, the teach ungemein. anyway More, as itself constantly Codes vorsetzten To let.


for your trouble there no simple Solution, except the Subclassing. or You take Sebastians SKControl.dll. The operates too to this principle.
 
10/16/05  
 



can you there only fully consent, Frank.
 
10/17/05  
 




Frank
Abbing
thanks Andreas!

Peter, You could too one List view use. there are The colours adjustable and You can it so ausehen let as an Listbox. and there's even a crazy Dll, around the thing yet plainer To style....
 
10/17/05  
 




Peter
Mallow
@Frank
sincere said have you got already right but I try always The Codes To understand.

have me already time attempts with the code auseinanderzusetzten, still the was something To plenty new at a single blow. but i'll me so nocheinmal accurate keep busy, if I time again plenty Time have.
 
WinXP Pro SP2, XProfan 9 + XPSE
AMD Athlon 64 X2 3800
10/19/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.374 Views

Untitledvor 0 min.
H.Brill09/19/23
Sven Bader08/06/21
Peter Max Müller10/29/17
Ernst05/04/14
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie