Solved

Show popup to specific Windows account

Posted on 2008-10-23
9
373 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 59

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 59

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 59

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 59

Accepted Solution

by:
Kevin Cross earned 500 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 59

Expert Comment

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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
web application structure 18 100
Running JavaFX on JDeveloper 12C 1 54
How to set IPSec under Server 2008 R2 and Server 2012 R2 3 42
Java Restore security prompts not working 10 56
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

861 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