开发者

how to show windows service exception in GUI Message?

开发者 https://www.devze.com 2023-04-04 15:43 出处:网络
How i show GUI message sh开发者_如何学编程ow box for Windows Service. I got one link on MSDN but no idea from where I start my work, please guide me.

How i show GUI message sh开发者_如何学编程ow box for Windows Service.

I got one link on MSDN but no idea from where I start my work, please guide me.

http://msdn.microsoft.com/en-us/library/ms683502(v=vs.85).aspx

http://blogs.msdn.com/b/yvesdolc/archive/2009/08/20/do-you-still-use-the-messagebox-api-in-your-windows-service.aspx


You can't show UI from a service. Services run in session 0 and there is no desktop. What's more services run when there are no logged on users. Again there is no desktop.

You have a couple of options:

  1. Log your messages rather than attempt to show them.
  2. Have a helper application that runs as a standard user app on the logged on user's desktop. This app can show UI. Communicate between the service and the app via an IPC mechanism of your choice.


If your needs are limited to dialog boxes, check out the WTSSendMessage function.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号