.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Launch window forms app from windows service

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :.NET Framework
I have a windows forms app that is used to manage settings for a windows service. When the service starts I want to launch the forms app. I'm using Process.Start("myWindowsApp") and I can see the app running in the task manager processes but the windows aren't displayed. My guess is that it's because the service is running under the localsystem account but what do I need to do to make the windows forms app work properly? SteveR

View Complete Post

More Related Resource Links

Debugging a Windows Service (VS 2008 / .NET 3.5) Using Debugger.Launch()

Hi, Everybody! I wrote a Windows Service using VS 2008 (.NET 3.5).  I wish to debug it.  I am able to build it and install it successfully.  When I start the service, the Visual Studio Just-In-Time Debugger (VS JIT Debugger) appears displaying the following message: An unhandled exception ("Launch for user") occurred in <WindowsService> [3392] (or [2560] or [5180] or ...).  I select the following Possible Debuggers <WindowsService> - Microsoft Visual Studio: Visual Studio 2008 and click the Yes button.  This is followed immediately by the following dialog box: Caption: Microsoft Visual Studio, Message: There is no source code available for the current location.  Clicking the Show Disassembly button results in displaying the disassembly.  The call stack shows mscorlib.dll!System.Diagnostics.Debugger.Launch() + 0x6a bytes.  The exception apparently occurs in Debugger.Launch();.  If I choose to continue, I am able to debug the Windows Service, stopping at the specified break points.  Why does the VS JIT Debugger appear in the first place?  How can I use Debugger.Launch(); without the VS JIT Debugger appearing?  See code below... protected override void OnStart(string[] args) { try { Debugger.Launch(); var t = new Thread(Start); t.IsBackground = true

Convert System.Window.Forms.Keys into WPF (system.windows.input.key)



I am trying to add some short cuts to my WPF app. I read an xml file which especifies the shortcut key with it is system.windows..forms.keys value (e.g: 114, that will be F4)

The idea of having to create a switch to return the right key based on it is value it is, to say the least, horrendous, so before I start doing that :( ... does anyone knows how I can convert that value into a system.windows.input.key? Any help will be appreciated.



Connection times out when WCF client tries to call WCF service, both in Windows Forms apps



The exception message is: Could not connect to TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

What I am trying to do: a WCF service is self hosted in a Windows Forms application. The WCF client is in another Windows Forms application. Eventually, the client is supposed to run on a computer somewhere out there on the Internet and send messages to the server which is running on my home computer. This is my first attempt at making a remote WCF call.

I have success when server and client either run on the same computer, or are running on different computers attached to my little in-home LAN. When I try to route the client's request via Internet (in preparation for having the client reside out there somewhere) I get the exception reproduced in the first paragraph above after waiting for about 20 seconds.

OS is WinXP Pro with SP3. Using Visual Studio 2008, Visual Basic. is the IP currently assigned to me by Comcast (I watch carefully to see when it changes; also, I altered it for purposes of asking this question).


Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

How to Localize Windows Forms and Change the Language at Runtime

Localization is the process of customizing your application to a particular language, culture or locale. Visual Studio provides support for localizing Windows Forms with much ease. In this article, we will see how to localize windows forms and give the user the ability to change to his preferred language at runtime.
When you run a localized application, the appearance is determined by two culture values. The UICulture property is used to specify which resource files will be loaded for the form. The Culture property, on the other hand, determines how strings such as dates, numerals, and currency amounts are formatted.
Let us see the steps required to create a localized form. You can then expand this example and adopt the same approach for the rest of the forms in your project

Localizing Windows Forms

The Visual Studio project system provides considerable support for localizing Windows Forms applications. There are two ways to generate resource files using the Visual Studio development environment: one is to have the project system generate the resource files for localizable UI elements such as text and images on the form. The resource files are then built into satellite assemblies. The second way is to add a resource file template and then edit the template with the XML Designer. A reason for doing the latter is to make localizable strings that appear in dialog boxes and error messages. You must then write code to access these resources.

This walkthrough topic demonstrates both processes in a single Windows Application project.

You can also convert a text file to a resource file; for more information, see Resources in Text File Format and Resource File Generator (Resgen.exe).


problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

CLR Inside Out: Extend Windows Forms Apps Using System.AddIn


See how Windows Forms applications can be adapted to use the new .NET Add-in framework (System.AddIn) this month.

Mueez Siddiqui

MSDN Magazine July 2008

GUI Library: Bring the Simplicity of Windows Forms to Native Apps


In this article, author John Torjo presents a guide to his C++ GUI library called eGUI++ and explains how it makes user interface programming easier.

John Torjo

MSDN Magazine June 2008

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Service Station: Serialization in Windows Communication Foundation


Windows Communication Foundation supports several serialization mechanisms and provides a simple, interoperable foundation for future service-oriented applications. Here Aaron Skonnard explains it all.

Aaron Skonnard

MSDN Magazine August 2006

Managed Spy: Deliver The Power Of Spy++ To Windows Forms With Our New Tool


Spy++ displays Win32 information such as window classes, styles, and messages. Now you can get that same functionality for managed code using our ManagedSpy. Get it here.

Benjamin Wulfe

MSDN Magazine April 2006

Winning Forms: Practical Tips For Boosting The Performance Of Windows Forms Apps


This article discusses techniques you can use to ensure that Windows Forms-based apps provide optimal performance to match the rich UI responsiveness they're known to provide.

Milena Salman

MSDN Magazine March 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend