How can I Get the Active window
I used the following code.. but i didn't get activewindow..
int hwnd = OS.GetDesktopWindow();
it returns value and working..
but
int hwnd = OS.GetActiveWindow();
it returns 0 only.. i didn't get correct value...
how can i get Activewindow .... is there any alternate method....
import java.awt.image.*;
import javax.imageio.*;
import java.awt.Rectangle;
import java.lang.*;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.win32.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.widgets.Tracker;
try
//in hwnd=OS.GetDesktopWindow();
int hwnd =OS.GetActiveWindow();
System.out.println(hwnd);
RECT clientRect= new RECT();
POINT pt1 = new POINT ();
POINT pt2 = new POINT ();
OS.GetClientRect(hwnd, clientRect);
pt1.x = clientRect.left;
pt1.y = clientRect.top;
pt2.x = clientRect.right;
pt2.y = clientRect.bottom;
System.out.println(clientRect.left);
System.out.println(clientRect.top);
System.out.println(clientRect.right);
System.out.println(clientRect.bottom);
OS.ClientToScreen (hwnd, pt1);
OS.ClientToScreen (hwnd, pt2);
clientRect.left = pt1.x;
clientRect.top = pt1.y;
clientRect.right = pt2.x;
clientRect.bottom = pt2.y;
System.out.println(clientRect.left);
System.out.println(clientRect.top);
System.out.println(clientRect.right);
System.out.println(clientRect.bottom);
if((clientRect.right!=0)&&(clientRect.bottom!=0))
BufferedImage screencapture = new Robot().createScreenCapture(new Rectangle(clientRect.left,clientRect.top,
clientRect.right,clientRect.bottom));
File file = new File("screencapture.jpg");
ImageIO.write(screencapture, "jpg", file);
System.out.println("Image Saved Successfully");
else
System.out.println("Failed");
catch(AWTException ae){}
catch(IOException ie){}
This is not SWT forum.
Similar Messages
-
How do I get the activity window in safari 6.0.2?
How do I get the activity window in safari 6.0.2?
Safari 6
Activity Window is no more available in Safari 6.
Apple removed that feature.
Best. -
How can I get the video window to disappear?
Placing video in a InDesign CS6 file, exporting as an interactive pdf. The video plays fine but when it is finished playing a black box replaces the video. How do I get the video window to disappear after video finishes playing? BYW, using the No Poster option in InDesign.
When the video finishes playing in an interactive PDF, it shows the last frame of the video. The last frame of your video is probably black.
There is no way to get the video window to disappear if it's embedded in the page, sorry. You could change the last frame to white, however. -
I liked how FireFox used to have a downloads window when I would download. But, now its like som sort of add-on, it's at the top right and I dont like it very well. Can I get the window back somehow? Thanks, Lego893.
There is a way, but it may not be supported for ever... If you want the old download manager back, go to about:config, click the I'll be careful, I promise! button. Then search for "download", and set the browser.download.useToolkitUI preference to true (double-click it).
-
My iphone will not activate,it keepos sending me a message telling me the servers are down and I tried everything.somebody please help
Either your antivirus/firewall is blocking access to gs.apple.com, your iphone is jailbroken, or your computer was used at some time in the past to hack or jailbreak this or some other iOS device. The first you can fix by disabling your security software. The 2nd you can't do anything about, and the 3rd you fix by editing your hosts file and removing the lines containing gs.apple.com.
-
How can i get the Apple Thunderolt display to show Windows 7 i run on my system using Paralells desktop..
You may need to set the slider at the upper-right corner of the Control window to something other than the extreme left-most position:
Hope this helps. -
My computer crashed and I had to reinstall windows 7, how can I get the playlist on my iphone onto itunes?
It has always been very basic to always maintain a backup copy of your computer for this very occasion.
If for some reason you have failed to do this, not good, then you can transfer itunes purchass from the ipod. File>Devices>Transfer Purchases -
Hi all, I have bought a second hand iphone 5s and have found it is still activated to the last user... i can't get hold of them anymore, how can i get the phone activated in my name?
If iOs 7 is installed on that iPhone, you will not be able to activate it without
the requested information. It is called Activation Lock and is a security
feature built into iOS 7. There is no workaround. -
How Can I Get the Amount of Free Disk Space using windows 7 please share example using GetDiskSpace i have already studied http://digital.ni.com/public.nsf/allkb/9958B8E473C4EF1786256BBC0053B64F
Reading your question a bit more in detail, I doubt whether you are using Win32 API GetDiskFreeSpace function (for which my previous post is the solution) of Programmer's Toolbox GetDiskSpace function.
With reference to the second one, it works even with disks larger than 2GB but you need to use the proper formatting code to display the returned value. I updated my example to show total free space in the debug output window and added a comparison with 3GB value using UInt64TypeCompareUInt from the Programmer's Toolbox. -
HT201441 if the previous owner died, how can i get an Activation Lock for a iPhone 5
If the previous owner died, how can i get an Activation Lock for a iPhone 5
Without knowing the Apple ID and password that the deceased used you can't unlock the Activation Lock.
-
found an locked iphone5c, how can i get the owners info, email or anything if he/she only says "pls. bring back my phone.. godbless" on the activation menu??
Try using Siri and ask "Who's phone is this?" It should give you the name, number, and email address of the owner. Also, you can try swiping to unlock, select Emergency, then see if they have a Medical ID set up. If they do, they may have the name of a contact with a phone number listed.
-
I have downloaded adobe camera raw 8.7 . Closed all adobe programs . Reopen PS cc6 , it is still using camera raw 8.2 . How can I get the updated plug in to become active ?
Please clarify your version of Photoshop.
There is no CC6.
There is
Photoshop CS6
Photoshop CC
Photoshop CC 2014
Also, what is your operating system? -
how can I get my google window back in the upper right hand corner of my start page? I seem to have lost it.
Control click in the tool bar area and customize.
-
How can I get the shutter count for my Canon 7D Mark II using Windows XP?
How can I get the shutter count for my Canon 7D Mark II using Windows XP? I've been looking lots of places and doing some file uploads, but I can't seem to find anything. I'm wary of downloading software I know nothing about. Any help is greatly appreciated.
Solved!
Go to Solution.Nevermind, just, sort of answered my own question. Doesn't work on XP, but using a Win 7 'puter I was able to use Shutter Count, which now works w/ the 7D Mark II.
-
My computer was refreshed and the technician did not deactive the CS3 license first and the drive has been wiped. I have my serial number, how can I get it activated?
Hi pipper88,
You can reinstall CS3 and enter the serial number to activate the software.
Regards,
Rave
Maybe you are looking for
-
How to copy custom fields in purchasing contract
Dear all, we have added to the standard field in the purchase contract position two custom fields. These two fields (in value) are not taken when the user create a new contract by copying from another. Are there some exit or BADI functions that allow
-
I have an iPhone 4s I have gone to iTunes and everything has been synced in the clouds. Buuuttttt when I go to my iPhone which I purchased last year in 2012 I started it up with a computer I no longer have. When I go to setting and then go to "iTune
-
Pricing condition settings with list cond type
Hi all, I have a very urgent problem in pricing settings. We are in CRM 4.0 sp6 scenario linked to an ECC 5. In ECC 5 have been set some condition record that provide the field "list cond type" as blank. This are calculated in ECC but not in CRM that
-
Impossibile Installare driver Sound Bluster Audig
Salve a tutti.... avrei un problema per quanto riguarda la scheda audio Creai'veSound Bluster Audigy 2. Durante l'installazione dei driver (? scaricati dal sito ufficiale del Creative ) mi appare un errore e perci? mi ? impossibile usufruire della sc
-
Blob to Java class that has changed problem
I wasn't sure how to title this problem, but here's an explanation. It is slightly hypothetical but is likely to become an issue soon. I am storing my java objects into a database as a Blob, retrieving them and then regenerating them as java objects.