English
Source / code snippets

intercepting end windows

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
windows-end intercepting
#############################
Test-Program for :
XProfan
#############################
Author : Andreas Miethe
august 2003
#############################
Topic : windows-end intercepting
#############################
 $H windows.ph
 $H messages.ph
DEF HiWord(1) And(&(1)>>16,$FFFF)
DEF LoWord(1) And(&(1),$FFFF)
Declare Ende&,Button&,OldWindowProc&

Proc Speicher_Routine

    Declare X&
    but not of/ one memory-routine runs here only one counter through
    ~TextOut(%hDC,0,0,memory-Dummy :,16)

    Whilenot X& > 20000

        Locate 2,0
        Print X&
        Inc X&

    EndWhile

    ~TextOut(%hDC,0,100,ready with Save :,22)
    ~TextOut(%hDC,0,150,Button.... :,11)
    Waitinput

ENDPROC

Proc Frage_Speichern

    If Messagebox(Erstmal any data Save ?,Windows_Ende?,36) = 7

        return 1 windows becomes immediate exits

    Else

        before 1 zurückgegeben becomes can here a memory-routine
        installed be. windows becomes first exits if everything Done is.
        Speicher_Routine
        return 1 windows becomes to the Save exits
        return 0 windows not exits

    Endif

ENDPROC

Proc WindowProc

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

    If Msg& = ~WM_COMMAND

        If lParam& = Button& Control inquire

            If HiWord(wParam&) = ~BN_CLICKEDKlick on Button

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

            Endif

        Endif

    Endif

    If Msg& = ~WM_CLOSE

        Speicher_Routine
        ~PostQuitMessage(0)Program-end

    Endif

    If Msg& = ~WM_QUERYENDSESSION

        Return Frage_Speichern()

    Endif

    any Messages The not treats get on The Original-procedure weiterleiten
    return ~CallWindowProc(OldWindowProc&,Wnd&, Msg&, WParam&, LParam&)

ENDPROC

set(FastMode,1)
SetTrueColor 1
Window Style 31
Window 0,0-640,480
CLS ~GetSysColor(~COLOR_BTNFACE)
Button& = CreateButton(%hwnd,end,10,50,80,24)
Sendmessage(Button&,~WM_SETFONT,~GetStockObject(~DEFAULT_GUI_FONT),1)
Window-procedure replace and The Original-procedure in
OldWindowproc secure
OldWindowProc& = ~SetWindowLong(%hwnd,~GWL_WNDPROC, ProcAddr(windowProc,4))

WhileNot Ende&

    WaitInput

EndWhile

 
07/15/07  
 



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.645 Views

Untitledvor 0 min.
Joerg06/11/16
Wilfried06/02/16
RudiB.02/14/16
pfisterhamj11/08/14
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (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