English
Source / code snippets

Animated Window Subclassing

 
Subclassing - animated Window of Andreas Miethe:
CompileMarkSeparation
#####################################
animierte Fenster
und
Fenster-Eigenschaften ( Properties )
XProfan
ab Windows 98 und W2K
#####################################
Andreas Miethe * Juni 2004
#####################################
SET(FastMode,1)
 $H windows.ph
 $H messages.ph
Declare OldWindowProc&,BackBrush&
Declare Ende&,Button1&,Button2&

Proc ButtonCallback

    Parameters Wnd&, Msg&, wParam&, lParam&

    IF Msg& = ~WM_LBUTTONDOWN

        SetText Wnd&,Autsch

    Endif

    IF Msg& = ~WM_LBUTTONUP

        SetText Wnd&,Klick

    Endif

    Return ~CallWindowProc(~GetProp(Wnd&,OldCallback),Wnd&, Msg&, WParam&, LParam&)

EndProc

Proc WindowCallback

    Parameters Wnd&, Msg&, wParam&, lParam&

    If Msg& = ~WM_COMMAND

        If lParam& = Button1&

            If ~IsWindowVisible(Button2&) = 0

                ~SetWindowPos(Button2&,0,10,40,80,24,~SWP_HIDEWINDOW)
                ~AnimateWindow(Button2&,400,~AW_ACTIVATE | ~AW_SLIDE | ~AW_HOR_POSITIVE)

            Endif

        Endif

        If lParam& = Button2&

            SendMessage(Wnd&,~WM_CLOSE,0,0)

        Endif

    Endif

    If Msg& = ~WM_CLOSE

        ~RemoveProp(Button2&,OldCallback)
        ~AnimateWindow(Wnd&,400,~AW_HIDE | ~AW_SLIDE | ~AW_VER_NEGATIVE)
        ~DeleteObject(Backbrush&)
        ~PostQuitMessage(0)Programm-Ende

    Endif

    Return ~CallWindowProc(OldWindowProc&,Wnd&, Msg&, WParam&, LParam&)

EndProc

WindowStyle 31
Window %Maxx+1,0 - 640,480
CLS ~GetSysColor(~COLOR_BTNFACE)
BackBrush& = ~CreateSolidBrush(~GetSysColor(~COLOR_BTNFACE))
~SetClassLong(%hwnd,~GCL_HBRBACKGROUND,BackBrush&)
OldWindowProc&= ~SetWindowLong(%hwnd,~GWL_WNDPROC, ProcAddr(WindowCallback,4))
SetDialogFont ~GetStockObject(~DEFAULT_GUI_FONT)
Button1& = Create(BUTTON,%hwnd,Klick,10,10,80,24)
Eigenschaft OldCallback setzen ( in diesem Fall wird das alte Callback gesichert )
das spart eine globale Variable
~SetProp(Button1&,OldCallback,~SetWindowLong(Button1&,~GWL_WNDPROC, ProcAddr(ButtonCallback,4)))
Button2& = Create(BUTTON,%hwnd,Ende,0,0,0,0)
ShowWindow(Button2&,0)
~SetWindowPos(%hwnd,0,0,0,640,480,~SWP_SHOWWINDOW)

Whilenot Ende&

    
put EndWhile
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

3.589 Views

Untitledvor 0 min.
RudiB.12/28/21
Jörg Sellmeyer05/16/18
H.Brill02/10/18
Tango07/21/17
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