Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Show Notification

Show Notification

Scheduled Pinned Locked Moved Windows Forms
helptutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sri_0099
    wrote on last edited by
    #1

    Hello, How to show Message/Notification from windows service. When i use MsgBox("Hi") it is throwing below error -> Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. Please Help. Thanks, Sh

    L 1 Reply Last reply
    0
    • S sri_0099

      Hello, How to show Message/Notification from windows service. When i use MsgBox("Hi") it is throwing below error -> Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. Please Help. Thanks, Sh

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Well the diagnostic information seems to have given you the answer. Showing a MessageBox, or any kind of Modal Dialog from a service is a bad idea as it means the service is stalled until someone answers the message. Most services are designed to post their messages to some form of log file unless they encounter a catastrophic error.

      S 1 Reply Last reply
      0
      • L Lost User

        Well the diagnostic information seems to have given you the answer. Showing a MessageBox, or any kind of Modal Dialog from a service is a bad idea as it means the service is stalled until someone answers the message. Most services are designed to post their messages to some form of log file unless they encounter a catastrophic error.

        S Offline
        S Offline
        sri_0099
        wrote on last edited by
        #3

        Thanks Richard, I am developing custom MessageBox. When i call it from winservice it is thrwoing error. It says set servicenotification. Richard, How to set "ServiceNotification" propert of custom messagebox. Thanks

        L S 2 Replies Last reply
        0
        • S sri_0099

          Thanks Richard, I am developing custom MessageBox. When i call it from winservice it is thrwoing error. It says set servicenotification. Richard, How to set "ServiceNotification" propert of custom messagebox. Thanks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Try here for information on how this may be achieved.

          1 Reply Last reply
          0
          • S sri_0099

            Thanks Richard, I am developing custom MessageBox. When i call it from winservice it is thrwoing error. It says set servicenotification. Richard, How to set "ServiceNotification" propert of custom messagebox. Thanks

            S Offline
            S Offline
            sri_0099
            wrote on last edited by
            #5

            Thanks Richard. But the article is for standerd message box. I have created my own message box (Form), for which i need to set either "ServiceNotification" or "DefaultDesktopOnly". I am not able to find, how to set those properties. Please help me. Thanks

            L 1 Reply Last reply
            0
            • S sri_0099

              Thanks Richard. But the article is for standerd message box. I have created my own message box (Form), for which i need to set either "ServiceNotification" or "DefaultDesktopOnly". I am not able to find, how to set those properties. Please help me. Thanks

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Your custom MessageBox should inherit from System.Windows.Forms.MessageBox and will then have access to the standard properties and messages. This may help.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups