Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Show popup to specific Windows account

Posted on 2008-10-23
9
Medium Priority
?
379 Views
Last Modified: 2013-12-05
Hello all,

I have developed a Java server-application... it is always listening to a port and when another application hits that port, my application prompts a JFrame (popup).

The problem we are having now is with Windows 2003 Terminal Server. If I start running my Java-server application using Administrator (Windows account) my Java-server application will always show the popup to Administrator user. If I use other Windows account (e.g. student) while my application is still running under Administrator Windows account, the popup window stills displaying at the Administrator user account.

I need the popup on the correct Windows account. The Java-server application (which shows the popup) knows which Windows user needs to receive the popup. But if it is running under Administrator, it will always display it to Administrator account and not to the one that needs to receive the popup.

I have tried running my Java-server application under SYSTEM account and still does not work.

How can I display that popup to that specific Windows account ?

Thank you very much.
0
Comment
Question by:cdtcol
  • 5
  • 4
9 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22827431
How are you getting which user is logged in currently?

System.getProperty("user.name");

Should get you value of the windows logon, but maybe this is what you are using already.
0
 

Author Comment

by:cdtcol
ID: 22831488
Thank you mwvisa1 for your interest.

My Java-server application waits in a port. Another application hits that port (at any time) and that second application is the one that send me the information about which Windows account I must show the popup. My Java-server application receives that info and shows the popup.

The problem is that the popup is shown where the Java-server application was first executed.. not the desired Windows account.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22832893
So the problem is (paraphrasing to ensure my understanding):

SourceApp --> tcpip/socket connection --> ServerApp --> tcpip/socket connection --> Client (ClientApp)

What you are getting is that the response is being sent on the originating tcpip connection when what you need to do is start a whole new tcpip/socket connection to send a message to Client (not sure you are using socket connections here -- just using as reference of where the flow of communication is).

The problem there is the server app must know how to connect to this new connection.  Since it is sounds like it is the same machine, you could try to use a mechanism like windows sendmsg to user name you get from source application.  You could execute something like that through Runtime.exec.

Am I close to what you are looking for?  I am not sure myself how I would implement that, but maybe the confirmation of this will help another expert happening by thing of something.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22832909
* thing of something
Should be " to think of something".
0
 

Author Comment

by:cdtcol
ID: 22833524
Thank you again mwvisa1.

App1 --> socket --> Server App

Server App receives data from App1 and shows a popup.

The sendmsg to a user could be, but I my Server App displays more than a message.. it is a custom popup.. it shows some info and asks for more information from user and sends an OK or a Cancel.

Is there a way, using Java, to display that popup to a desired Windows Account ?

If not, I will have to keep my Server App and probably develop some Client App that must be executed by each Windows Account in order to keep that socket open and my Server App will hit the one it needs to display the popup.
0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 2000 total points
ID: 22835630
If you have a client app, my original code may work but not sure in this scenario.  The idea was you have a value coming to server app that says user "BobSmith".

If code, you can do this:

String messageUser = "BobSmith";
String currentUser = System.getProperty("user.name");

if (currentUser.equalsIgnoreCase(messageUser) {
    JOptionPane.showMessageDialog(null, "My custom message");
}
0
 

Author Comment

by:cdtcol
ID: 22844699

System.getProperty("user.name") is always returning "Administrator", which is the user that runs my Java-server application.

Thank you very much for your help... I have decided developing a Client app and will take in count your last code.

Thank you.

0
 

Author Closing Comment

by:cdtcol
ID: 31509326
Thank you very much for your help... I have decided developing a Client app and will take in count your last code. I am really sure it will work.

Thank you.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22845289
Ah, good luck with the client.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question