Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 192
  • Last Modified:

MessageBox froma a windows service

I need to show a dialog box when something occurs during the execution of a windows service, but it's impossible using MessageBox.Show(string).

Any solution?

Thanks!

Enric.
0
EM77
Asked:
EM77
2 Solutions
 
Svetlin_PanayotovCommented:
Well - try this
MessageBoxA(NULL,"Message","Caption",MB_OK);
0
 
123654789987Commented:
put the following code in the service OnStart event and I got a messageBox when the service was started

System.Windows.Forms.MessageBox.Show("Service started on:","",System.Windows.Forms.MessageBoxButtons.YesNo,System.Windows.Forms.MessageBoxIcon.Question,System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.ServiceNotification);
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now