English
Source / code snippets

Control Edit coloured Mainwindow Style Tabstop

 
coloured Edit Control and the main window with Tabstop Style of Andreas Miethe:
CompileMarkSeparation
Declare Edit1&,Edit2&,Edit3&,Button1&,Button2&,Brush&
Declare Ende&,OldWindowProc&
 $H windows.ph
 $H messages.ph
set("FastMode",1)

PROC SetColor

    Behandlungroutine für
    WM_CTLCOLORSTATIC,WM_CTLCOLOREDIT und WM_CTLCOLORLISTBOX
    es wird ein farbiger Brush angelegt und die Textfarbe bestimmt
    Parameters col&,bk&,wParam&

    IF Brush&

        ~DeleteObject(Brush&)

    Endif

    Brush& = ~CreateSolidBrush(bk&)
    ~SetBkMode(wParam&, ~TRANSPARENT)
    ~SetTextColor(wParam&,col&)
    Return Brush&

Endproc

Proc Windowproc

    parameters Wnd&, Msg&, wParam&, lParam&

    If Msg& = ~WM_CLOSE

        Aufräumen

        IF Brush&

            ~DeleteObject(Brush&)

        Endif

        ~PostQuitMessage(Wnd&,0,0)

    Endif

    If Msg& = ~WM_CTLCOLOREDIT

        If lParam& = Edit1&

            Return SetColor(rgb(255,0,0),rgb(255,255,0),wParam&)

        Elseif lParam& = Edit2&

            Return SetColor(rgb(0,0,128),rgb(255,0,255),wParam&)

        Elseif lParam& = Edit3&

            Return SetColor(rgb(255,255,255),rgb(0,0,128),wParam&)

        Endif

    Endif

    If Msg& = ~WM_COMMAND

        IF lParam& = Button1& Button1 abfragen

            IF (wParam& >> 16) = ~BN_CLICKED HiWord

                ~Messagebox(0,"Button1 Klick","Meldung",0)

            Endif

        Endif

        IF lParam& = Button2& Button2 abfragen

            IF (wParam& >> 16) = ~BN_CLICKED HiWord

                ~Messagebox(0,"Button2 Klick","Meldung",0)

            Endif

        Endif

    Endif

    alle nicht behandelten Meldungen an die Originalprozedur weiterleiten
    Return ~CallWindowProc(OldWindowproc&,Wnd&, Msg&, WParam&, LParam&)

Endproc

WindowStyle 543
cls ~GetSysColor(~COLOR_BTNFACE)
ein paar Controls anlegen
Edit1& = Create("Edit",%Hwnd,"Edit1",10,10,80,20)
Sendmessage(Edit1&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
Edit2& = Create("Edit",%Hwnd,"Edit2",10,40,80,20)
Sendmessage(Edit2&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
Edit3& = Create("Edit",%Hwnd,"Edit3",10,70,80,20)
Sendmessage(Edit3&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
Button1& = Create("Button",%Hwnd,"Button1",10,110,80,20)
Sendmessage(Button1&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
Button2& = Create("Button",%Hwnd,"Button2",10,150,80,20)
Sendmessage(Button2&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
Window-Prozedur austauschen
OldWindowproc& = ~SetWindowLong(%hwnd,~GWL_WNDPROC, ProcAddr(WindowProc,4))

Whilenot Ende&

    waitinput

EndWhile

end
salvo, iF.
 
07/01/05  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.672 Views

Untitledvor 0 min.
H.Brill06/07/21
Torben Nissen05/04/20
Ernst06/13/16
RudiB.04/03/16
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


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