aspose file tools*
The moose likes Java in General and the fly likes How do I do keyboard commands with the screen of the session server minimized? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How do I do keyboard commands with the screen of the session server minimized?" Watch "How do I do keyboard commands with the screen of the session server minimized?" New topic
Author

How do I do keyboard commands with the screen of the session server minimized?

Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hello
I'm developing a program that needs to run (open on screen) a file in a specific format. And after that
do that by manipulating the keyboard to type shortcuts as
ctrl + alt + f4 to open the file is saved and closed.
I'm using it for the Robot class, however the commands are made only when the server's screen session is open, and when the screen session from the server is closed I realized that the program screen opened out of focus, and keyboard commands that are not made in the open file.
Here is the code I use to execute commands on the server:



I'm waiting
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Hi!! Im back... Is it possible?
Anyway what I really need is manipulate a program, such as:
Exe file that I need that makes some additional functionality. To be clear, I need my file to be
opened by Java (I already got it) and then it saves the file data and still be close and makes over a specific command of the program.
Thanks a lot
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Nobody knows? Is it possible ???
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14276
    
  21

Hello Adriano, welcome to JavaRanch.

Please don't quote your complete previous message each time you reply; that makes the topic unnecessarily long and hard to read.

I don't know how to solve your problem, but I can imagine that it's not possible to use the GUI of a program (manually or automatically) when the screen is locked because of security reasons. The whole purpose of locking the screen is that you must first type the password before you get access to the programs running there - and it doesn't matter if you're sitting there physically, typing on the keyboard, or if another program "types" on the keyboard, like your program is doing.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Thank you for you answer

Is there some way of making a file open and does some additional functionality. To be clear, I need my file to be
opened by Java (I already got it) and then it saves the file data and closes.
Is it possible???
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14276
    
  21

Ofcourse you can open files, read the data, do things with it, and write data to files using a Java program.

But how to read the data and what to do with it depends entirely on what kind of file it is and what you need to do with it, and you don't explain any details about that. So, please explain in more detail what exactly you need to do, and then we can try to help you with it.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
In fact, the file I need to run is a . exe, I use this code to open the file:
Runtime.getRuntime.exe ("File.exe");
After that I need to do that the file makes a task typical himself(this task can be activated by a CTRL + R),
after that I should save the updates and finally close the screen of my .exe file
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14276
    
  21

So, what is the mysterious program you are trying to run? Is it a well-known program such as Word or Excel, or some custom program? What does it do if you press Ctrl+R? Did you write it yourself or do you know the people who wrote it? Maybe there is another way do let the program do what it needs to do that does not require using the GUI. You could ask the people who wrote that program. It's hard to help you when this stays so vague and general.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Ok, the program is called QlikView, QlikView was developed by QlikTech (a firm), the command CONTROL+R does a reload of data, I just need that makes this on server, and after save and close the program.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14276
    
  21

Maybe you should ask QlikTech if there is another way to do what you need to do with it. For example, some programs can be run with command line arguments to do things automatically, so that you don't have to use the GUI to do the necessary actions.

I did a quick Google search and found that they also have a forum. It would be a good idea to post there to explain what you want to do.
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
Thank you a lot
Adriano Ferreira
Ranch Hand

Joined: Jan 05, 2011
Posts: 34
I went to the forum and I guess I reached what I wanted.
Thanks a lot
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14276
    
  21

Good!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I do keyboard commands with the screen of the session server minimized?