Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TWAPI - how to register a callback to a Shutdown (or similar) event?

25 views
Skip to first unread message

MartinLemburg@UGS

unread,
May 8, 2007, 4:59:59 AM5/8/07
to
Hello,

I really would like to know, if and how it is possible using TWAPI to
register a callback for a Shutdown, LogOff, etc. event!

Can somebody help me?

Thanks and best regards,

Martin

MartinLemburg@UGS

unread,
May 8, 2007, 5:42:47 AM5/8/07
to
Perhabs I found the solution for my problem, not really needing twapi,
just by ...

wm protocol . WM_SAVE_YOURSELF

But ... is this event really supported?

Thanks again!

Martin

On May 8, 10:59 am, "MartinLemburg@UGS" <martin.lemburg....@gmx.net>
wrote:

Jeff Hobbs

unread,
May 10, 2007, 3:13:04 PM5/10/07
to MartinLemburg@UGS
MartinLemburg@UGS wrote:
> Perhabs I found the solution for my problem, not really needing twapi,
> just by ...
>
> wm protocol . WM_SAVE_YOURSELF
>
> But ... is this event really supported?

I added this support into Tk in 8.4.13.

Jeff

Roy Terry

unread,
May 10, 2007, 9:04:40 PM5/10/07
to
MartinLemburg@UGS wrote:
> Perhabs I found the solution for my problem, not really needing twapi,
> just by ...
>
> wm protocol . WM_SAVE_YOURSELF
>
> But ... is this event really supported?
Does this really solve it? It's mapped to the
Windows message WM_QUERYENDSESSION which all apps
receive. Any app's refusal means the system won't be shutting
down and the distribution of the message is stopped
after the first refusal.

Seems WM_ENDSESSION is the definitive Windows signal
that the app must exit with no option.
R

Joe English

unread,
May 10, 2007, 9:26:29 PM5/10/07
to
Martin Lemburg wrote:
>`

>Perhabs I found the solution for my problem, not really needing twapi,
>just by ...
>
> wm protocol . WM_SAVE_YOURSELF
>
>But ... is this event really supported?

Yes, but beware that the semantics of [wm protocol ... WM_SAVE_YOURSELF]
are very different on Windows and on X11. On X11, the WM_SAVE_YOURSELF
handler _must_ update the [wm command] string, otherwise it can
prevent users from logging out.


--Joe English

0 new messages