Ferdinand Sousa wrote:
I couldn't find the GetLastInputInfo function (pywin32 212, python 2.5.2 on
Xp).

That's because it's not there <grin>. You'd have
to use ctypes or roll your own extension for that.

What I'm putting together is a script that uses Adobe Acrobat COM. It opens
a port and listens for connections on the LAN. When a pdf is sent to the
port, my script opens it in Acrobat and performs some operations. If Acrobat
is not currently open (checks for an open window with 1st 26 characters of
title text =="Adobe Acrobat Professional"), the script opens Acrobat (in
hidden mode, no visible window) performs the operations and closes it. If
Acrobat is already open, a dialog asks for user's permission before
continuing (because it is made invisible). It processes the file and closes
it, and the user gets back control of Acrobat as it was, with all the files
that were opened by the user as they were. The issue I want to handle is if
Acrobat is open, but, say, the user is away from his desk.

That's a lot clearer; as you point out, sometimes
being forced to explain one's own situation is enough
to clarify certain things about to oneself. Which then
helps one determine what to ask other people.

If your users are going away and leaving their desktops
unlocked then you're down to some sort of (over-the-top)
hooks mechanism[*]. If, however, you're prepared to say:
I'll skip the dialog box if the desktop's locked, then
you can use this kind of technique which is a lot simpler:

http://timgolden.me.uk/python/win32_how_do_i/see_if_my_workstation_is_locked.html

TJG

[*] And a security problem, methinks.
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to