File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Interactive Services" Watch "Interactive Services" New topic
Author

Interactive Services

sharab rao
Greenhorn

Joined: Jan 09, 2013
Posts: 10
Hi,

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
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

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.)
 
Don't get me started about those stupid light bulbs.
 
subject: Interactive Services