| |
|
|
Stefan M. Caillet | i should like to this Code Andreas Miethe moreover use, circa to one "Herunterfahren Befehl" yet some items To manage. on and itself kalppt the too. But if the manage something lasts, appear a Dialogbox. The gladly this code terminate would. click I on Cancel can the code of course its work manage, but windows won't More automatically exits. i want this code so adjust, that windows of course the Runterfahren silently (without these Dialogbox) breaks, but if the code The notwendigen items Done has, this windows says, that it now immediate runterfahren can.my code should So the Runterfahren Cancel, and to getaner work a new ShutDown produce, without however yourself again hereon To react. unfortunately find I in code The place(n) not, where I interfere must (- can). means Please I circa eure Help.
#############################
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,"Speicher-Dummy :",16)
Whilenot X& > 20000
Locate 2,0
Print X&
Inc X&
EndWhile
~TextOut(%hDC,0,100,"fertig with Save :",22)
~TextOut(%hDC,0,150,"Taste.... :",11)
Waitinput
ENDPROC
Proc Frage_Speichern
If Messagebox("Erstmal any data Save ?","Windows_Ende?",36) = 7
return 1windows 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 1windows 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,"Ende",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
thanks Stefan |
|
|
| Ich habe grosses Glück, weil ich Mitmenschen helfen darf. Entwicklungsumgebung: XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit PC: P4/3GHz , 2GB RAM , 1700GB HD Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD | 08/12/09 ▲ |
|
|
|
|
| I fürchte - cut a long story short - the is not (tidy).
You could The Api(s) hooken and "zurücksetzen" and then self selbige Shutdown-demand over again dispatching - I mean but here ought to differently angesetzt go because too such Hook either of OS not allows becomes/go could (z.B. UAC) or. alas plenty blabla... If the code but only for a bestimmtes windows his should, then could one vlt. but nevertheless set. goes it means z.B. only circa Win98 - then is a Hook vlt. a Possibility.
rather would: If Shutdown "registriert" (with obigen code) then immediate terminate - z.B. any States _fix abspeichern and first at next Start your application then react - z.B. with restore the fix gespeicherten States. so bliebe it In any drop "sauber" and You müsstest no fight against the OS lead. |
|
|
| |
|
|
|
Stefan M. Caillet | loudly the Code Andreas there Yes The Possibility through Return = 0 from the Frage_Speichern Proc the herunterfaren to interrupt. what I now bräuchte is thereafter The winproc again To deaktivieren, and from the While Ende& schleife rauszukommen. thereafter can I my items manage and a new Shutdown abzusetzen. my trouble: how can I to the Return 0 these Winproc again deaktivieren, dmit windows its messages again yourself regelt? Stefan |
|
|
| Ich habe grosses Glück, weil ich Mitmenschen helfen darf. Entwicklungsumgebung: XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit PC: P4/3GHz , 2GB RAM , 1700GB HD Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD | 08/13/09 ▲ |
|
|
|
|
| Achso, simply because You OldWindowProc& uses instead of procAddr and the SetWindowLong over again absendest. |
|
|
| |
|
|
|
Stefan M. Caillet | Sorry iF, steh on the Hose (wiedermal) be so endearing and zeig me, How and where I What exactly in the code insert must. Would me Real ne grosse Help. Thank you. Stefan |
|
|
| Ich habe grosses Glück, weil ich Mitmenschen helfen darf. Entwicklungsumgebung: XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit PC: P4/3GHz , 2GB RAM , 1700GB HD Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD | 08/13/09 ▲ |
|
|
|
|
| You änderst The WProc Yes with the row: where so The previous procAddr Yes in oldWindowProc& alights.
big deal if you your wProc namens "WindowProc" again supplant want then: with which (How You meant "winproc again To deaktivieren") your wndProc hold again out from the game is.
what I even not very knows is, when very You your Own wProc again "abschiessen" want but the row can You insert where You want. |
|
|
| |
|
|
|
Stefan M. Caillet | iF, mean it or mean not, but it works! I Have there namely ne Possibility used, on nem older Laptop of Ner older woman, The not so solid in the saddle the Computerwelt sits, data as E-Mails, Adressbuch etc in regelmässigen abstänedn on ne Speicherkarte in the PCMCIA-Slot To secure. the Whole should utterly without your zutun at turn off the "Lappis" (How tappt im dunkeln it loving name) automatically occur. Acronis Although not so bad, asks me but To often to, what about me wished this so having, that even no rückfragen, separate only the Info "BackUp becomes prepares - The computer toggles itself thereafter automatically aus") appear. now can I this program finish, because dank Andreas Miethe and you iF functions now the windows Hook. thanks eucch vielmals. |
|
|
| Ich habe grosses Glück, weil ich Mitmenschen helfen darf. Entwicklungsumgebung: XProfan11 , Win XP Pro 32Bit , Win XP Home ,Win7 HomePremium 64Bit PC: P4/3GHz , 2GB RAM , 1700GB HD Laptop: Intel Core 2 Duo /2,2GHz , 4GB RAM , 500GB HD | 08/13/09 ▲ |
|
|
|
|
Sato Pinto | Hello
Yes, to that Happiness there a couple people here in XProfan whom one not missen would like. If and Andreas Miethe are certainly too so meant. sometimes should "muss" one Komplimente on tappt im dunkeln write.
greeting Pedro |
|
|
| |
|
|