I have been using win32api.MessageBox to do alerts, and this works for apps running from the interactive prompt and normally executed code, however when I built a Python service when a MessageBox is triggered I can hear the 'beep' but the box does not display. Is it possible to display alerts from services?
+4
A:
No, Windows services run on a completely separate hidden desktop and have no access to the logged-on user's desktop. There is no way around this from a service developer's perspective.
In previous versions of Windows, it was possible for a service to be marked as "allowed to interact with the user desktop", but this option was removed in XP or Vista (I forget which). Now, services cannot interact with the user desktop.
One solution to your problem might be to have a desktop application that communicates with the service through some IPC method. When the service wants to alert the user of some condition, it would notify the desktop application which would then display a regular message box.
Greg Hewgill
2008-10-15 08:48:06