wood burning stoves 2.0*
The moose likes General Computing and the fly likes Interactive Services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Interactive Services" Watch "Interactive Services" New topic

Interactive Services

sharab rao

Joined: Jan 09, 2013
Posts: 10

Please help me out how to create hidden GUI application and use the CreateProcessAsUser function to run the application within the context of the interactive user.

Please refer below link for Interactive services(Windows)
Inetractive Services(Windows)
Provide some inputs how to create
1) Display a dialog box in the user's session using the WTSSendMessage function.
2) Create a separate hidden GUI application and use the CreateProcessAsUser function to run the application within the context of the interactive user.
     Design the GUI application to communicate with the service through some method of interprocess communication (IPC).
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3606

First and foremost, CreateProcessAsUser is a pretty tough Windows API, if you ask me. You might get a better response on some MSDN forum.

If decide to go this way, you need to use a mechanism to call native libraries (eg. JNI, JNA or something similar) to be able to call Windows API. There isn't anything special about calling this function compared to other native functions, the problem is understanding and setting up its parameters correctly. Setting up the security attributes will probably be the hardest part of it.

Depending on your needs, you may be able to do without CreateProcessAsUser. This call lets your service to start a GUI application which can then interact with the user in any way it wants. If you let the user start the application instead, or put the app into the Startup folder, you may avoid using CreateProcessAsUser. The problem in this case is that if the service wants to communicate with the user and the GUI application is not running, it doesn't have any means to let it be known. It's up to you to decide whether this presents a problem or not. You could probably use the WTSSendMessage function (which I assume is easier to use) to alert the user that he needs to run your GUI application.

(A note: Java is not the best suited language for Windows services, in my opinion.)
I agree. Here's the link: http://aspose.com/file-tools
subject: Interactive Services
Similar Threads
Access & Read Embedded Email Attachments From Existing Email Message
Sample Mobile Device App. to Generate & Display Barcode Image
response has been committed
Need Help With Dynamic text box in JSP
workflow implemetation with stateful session bean