Messagebox and Windows Service

  • Thread starter Thread starter Patrick Jox
  • Start date Start date
P

Patrick Jox

Hi,
I have my .NET application that is registered as as windows service. This
application exposes an interface to a third party library. During login to
the third party application I get a Messagebox when a wrong password is
used.

How does Windows handle such a messagebox? I heard, that messageboxes in
services are quit by the system and the message is stored in the event log.
This would be great, but as far as I experienced the application hangs.

How could I treat this?

Any suggestions?

Thanks a lot - Patrick
 
Patrick Jox said:
I have my .NET application that is registered as as windows service. This
application exposes an interface to a third party library. During login to
the third party application I get a Messagebox when a wrong password is
used.

In the presence of a decent security policy services run on a non-visible
desktop. Further, well designed services don't have any UI but rather leave
the UI to a client application which runs on the visible desktop and which
uses some IPC mechanism to communicate with the service.

That said, there are a couple of hacks available if you must. One, check the
docs for the flags MB_SERVICE_NOTIFICATION and MB_ DEFAULT_DESKTOP and with
your vendor to see if he'd consider using them in his call to MessageBox().
Two, in the control panel properties for the service you can mark the
service as one which is allowed to interact with the desktop.

The latter opens up a security vulnerability - google for Shatter attack for
the details. I hear the option may be pulled in a future version of Windows.

Regards,
Will
 
Back
Top