WIN32 questions

Alex Martelli aleaxit at yahoo.com
Wed Oct 25 13:31:51 CEST 2000


"Drew Whitehouse" <Drew.Whitehouse at anu.edu.au> wrote in message
news:wly9zdwudv.fsf at anu.edu.au...
>
> Hi,
>
> Can some of the win32 gurus help me with a few things...
>
> I want to have a win2k system startup (and shutdown) a full-screen GUI
> program on a dozen other win2k systems. Can I do this without having
> the operator logon to each of the systems manually (it's a kiosk like
> facility) ? Should I be using an NT Service ?

I'm not yet very familiar with win2k, but, in NT, you would not
use a service for that -- you'd use TweakUI or AUTOLOGON or the
registry equivalent.  See, e.g.:

http://www.jsiinc.com/TIP0000/rh0004.htm
http://support.microsoft.com/support/kb/articles/Q97/5/97.ASP
http://support.microsoft.com/support/kb/articles/q119/3/64.asp

Once the default-user is thus automatically logged on, you have
the usual ways to auto-startup programs running as that user, of
course.


> Is there a way to trap the closing of a window from a command line
> python program ? ie a user double clicks on a python app icon, it runs
> continuously in a console window and eventually they hit the kill
> button. (try: .. finally: .. doesn't handle this). I need to do
> various cleanup actions before the program dies, which leads me to my
> next question.

No, if a process is abruptly-killed (typically via the Task
Manager) it's given no chance to clear up anything -- that's
why the Task Manager warns against process-killing.

NT _does_ expose a SetConsoleCtrlHandler that lets you set
a handler-function for various console events, such as the
console being closed, so this case is not _quite_ the same
as process-killing.  But I don't think win32all exposes it.

It's normally simpler to write a GUI application, than to
use NT's advanced Console functions, anyway, IMHO (I opine
the reason for existence of those functions is mostly to
ease the task of porting legacy console applications to
NT...).  The task of interfacing Python code to callbacks
can only further add complexity, it seems to me.


Alex






More information about the Python-list mailing list