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