Screen capture of active window in LabWindows at run time

Hi NI,
We at KPIT are building an application which gathers data from an ECU over RS-232. We have completed our UIR file and tested basic send recieve. We would like to automate the test report generation. For this, we need to capture the GUI window (containing graphs, text boxes etc.) after the end of the test. Currently we are doing this manually using the standard Alt+PrintScreen fucntionality provided by Windows. Is there a way in LabWindows to capture the GUI form/screen/tab automatically through an API call ?
Regards,
-Ashish

Hi it's not that elegant but you can usethe following code i wrote:
it uses ClearClipboard software and it's basicly an automated printscreen
int BmpID,Available=0,Width,Height,RowB,PixDepth,Error,Status;
int *ColorTable=NULL;
unsigned char *Bits=NULL; unsigned char *Mask=NULL;
LaunchExecutable ("c:\\Program Files\\ClearClipboard\\ClearClipboard.exe");
Delay(1);
keybd_event(VK_SNAPSHOT,0xd4, 0, 0);
keybd_event(VK_SNAPSHOT,0xd4, KEYEVENTF_KEYUP, 0);
ProcessSystemEvents();
ClipboardGetBitmap (&BmpID, &Available);
AllocBitmapData (BmpID, &ColorTable, &Bits, &Mask);
GetBitmapData (BmpID, &RowB, &PixDepth, &Width, &Height,ColorTable, Bits, Mask);
SaveBitmapToJPEGFile (BmpID, strFull, 0, 100);
DiscardBitmap(BmpID);
free(Bits);
free(Mask);
free(ColorTable);
Hope it helps....
Kobi Kalif
Software Engineer

Similar Messages

  • Urgent!! How to capture the active windows

    I want to write a program to capture the active windows in the Windows desktop. Can anyone help me. I know to use class "Robot" to capture the screen, but how to determine the position of the active windows in the desktop.
    Thanks...

    This code could work to capture the desktop screen:
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    Image imgs;
    try{
         Robot r = new Robot();
    Rectangle rect = new Rectangle(0,0,d.width,d.height);
    imgs = r.createScreenCapture(rect);
    }catch(AWTException awe) {
    System.out.println("robot excepton occurred");
    Try this!!!

  • Capture the Active Window

    I need to capture the Active window on the event of PrintScreen Key pressed. What I get is the whole desktop. Can anyone please tell how do I capture the Active Window?

    Try alt-printscreen
    But I don't know what it is in Java

  • Mail Activity Window - Nothing showing most the time??

    I am fairly new to Mail. I've used Entourage for years and switched over when i got my new imac. Sort of liking it. There are many more functions in Entourage that Mail doesn't have. For one...I could hit Command > Period to stop sending an email while it was in the process of sending. How do I do that now in Mail? I see there is a Mail Activity window but most of the time it doesn't show any status down there..? Why? Sometimes it does but not very often. There's no rhyme or reason...Just when it wants to it seems. When it DOES show the status of a sending email i see that there is an "X" to cancel. But that is only when it shows. Command > Period doesn't work here.
    Thanks in advance.

    I have found an acceptable solution to this until the real thing comes along...
    Under Window in the task bar, select Activity. This moves a small box onto the desktop. Make it as small as you can and drag it to somewhere on your desktop where it's out of the way.
    Press Get Mail as you used to and all the activity is shown in the - ahem - activity panel.

  • Screen Capture of Classic Window

    I wish to capture the contents of a Classic application's window. None of the OS X keyboard shortcuts seem to work with the Classic window. If I capture only the window (Command-Shift-4), the result is a blank file. If I capture the entire screen (Command-Shift-3), and so on, the result is the OS X screen minus the Classic window.
    Is there any way to capture a picture of the Classic window in OS 10.4?

    Hmmm, I only found one real reference to a Black Screen capture...
    http://www.uselesscreations.com/mac/puddle/
    Leopard (OS X 10.5) and some older versions will give the screensaver a black screen to capture when the screensaver password option is turned on. The screensaver now attempts to detect this and display your wallpaper image instead, so that you don't just get the black screen OS X is trying to display!
    And though it's not what we're talking about. it leads ne yo ask a few questions...
    Is this from an Admin account?
    Do you have Multiple Users in OS9?
    How many colors is OSX.s display set to?
    How many colors is OS9.s display set to?
    How much Video RAM on ones that work, and ones that don't?
    Tried capturing in Classic with Extensions OFF?

  • Permission to post screen capture of beta windows

    Hello!
    can i post screen captures of the CS6 beta to the NAPP or Photoshop User media?
    for additional information, please see my recent CS6 forum post 'enhanced photo cropping'.
    best regards, Ron Stone

    Hi JAR2010
    Assuming we are talking about the same thing
    , the blue lines aren't visible to your end user.
    They are there for you as the Captivate developer so that you know
    the path the mouse will travel. If you choose not to have mouse
    movement, they aren't visible to you as the developer either. So
    your worries are quite probably unfounded.
    Not following you on downloading the slides as JPEGs. Do you
    mean by your end user? Or are you possibly asking if you can obtain
    the screen captures as individual images from Captivate to use
    elsewhere? If you mean by the end user, I'm going to say it's
    probably not possible. But if you mean by Captivate, you should be
    able to look in the Library panel and export them from there.
    Either individually or as a group.
    Cheers... Rick

  • LabVIEW 2010 Window Size/Panel Size Run-Time VI properties - unexpected behavior

    I have used the VI Properties Windows Run-Time Position - Panel Size and VI Properties - Window Size to set the desired display size for use on the application PC.
    A strange thing happens, when I first open the application window, it is smaller than the specified Window Size and Panel Size (both set to 1064 x 728).  However, if I click on a horizontal border the window's vertical size snaps instantly to the 728 pixel value and the horizontal size in unchanged, still smaller than the 1064 value specified.  When I click on a vertical border, the horizontal size changes to the specified value.
    I don't believe this is how these properties were intended to work.  They should open the application in a window sized as specified.  
    Is this a known problem?  Is there a workaround.

    I regret that I cannot post my employers' proprietary code.  I have tried to duplicate the problem with a publicly distributed VI and been unable to do so.  
    I believe now that it is possible my VI was "straddling" two monitors when I made the initial changes.  
    Later compilations were made using different VI properties and do not show this problem.
    I have attached a file showing the relevant VI property settings used in the aberrant VI compilation.
    Attachments:
    vi properties used.JPG ‏58 KB

  • How to make a window disable/enable in run time in webdynpro application

    Hi all,
    1) my requirement is in run time i want to make the content of a window in disable mode?
    2)  and again it should display in enable mode when we perform some action?
    thanks & regards
    naveen
    Moderator Message: This has been covered numerous times in this forum. Also, the forum is not a free consulting service here to do your job for you.
    Thread locked
    Edited by: Neil Gardiner on Nov 22, 2010 9:27 PM

    Hi,
    You will not be able to do this with a standard radio button, as each one will be in a separate instance of the row.
    The easiest way is to use a checkbox (as you can script this on/off) and then make it look like a radio button.
    Example here:
    https://acrobat.com/#d=sasUNmniOUgs3MwY-p4H8Q
    Hope that helps,
    Niall

  • Screen bell on active window

    I am trying to get screen to trigger the bell action on the active screen window. It currently works for only inactive screen windows. Is this even possible?
    .screenrc
    setenv LC_CTYPE en_US.UTF-8
    defutf8 on
    startup_message off
    bell_msg "^G"
    hardstatus alwayslastline
    hardstatus string '%{= 9g}[ %{G}%H %{= 9g}][%= %{= 9w}%?%-Lw%?%{= 9R}(%{W}%n*%f %t%?(%u)%?%{= 9R})%{= 9w}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{= C}[ %Y-%m-%d %c ]%{W}'
    # Default screens
    screen -t rss
    screen -t irssi
    If this isn't possible with screen, is tmux or any other terminal multiplexer capable of such?

    Hi it's not that elegant but you can usethe following code i wrote:
    it uses ClearClipboard software and it's basicly an automated printscreen
    int BmpID,Available=0,Width,Height,RowB,PixDepth,Error,Status;
    int *ColorTable=NULL;
    unsigned char *Bits=NULL; unsigned char *Mask=NULL;
    LaunchExecutable ("c:\\Program Files\\ClearClipboard\\ClearClipboard.exe");
    Delay(1);
    keybd_event(VK_SNAPSHOT,0xd4, 0, 0);
    keybd_event(VK_SNAPSHOT,0xd4, KEYEVENTF_KEYUP, 0);
    ProcessSystemEvents();
    ClipboardGetBitmap (&BmpID, &Available);
    AllocBitmapData (BmpID, &ColorTable, &Bits, &Mask);
    GetBitmapData (BmpID, &RowB, &PixDepth, &Width, &Height,ColorTable, Bits, Mask);
    SaveBitmapToJPEGFile (BmpID, strFull, 0, 100);
    DiscardBitmap(BmpID);
    free(Bits);
    free(Mask);
    free(ColorTable);
    Hope it helps....
    Kobi Kalif
    Software Engineer

  • Number of participant after activity completion is determined at run time.

    I have a scenario
    1. Let there be 5 roles A,B,C,D,E
    2. Role A initiates a process, and it goes to B and C(in different roles) simultaneously.
    3. When both B and C approves this, it will go to next participant D and E. However if only one of them approves, then the process instance must not go forward.
    4. Also the number of groups to whom the process, flows is determined at run time.
    Please let me know, how to achieve this task. Any suggestions will be welcomed and appreciated.
    Regards.

    You'd use a parallel gateway with complex gateway at the join. In the complex gateway you'd have an expression to continue when first flow completes (activationCount == 1) and select "Abort pending flows". That would have the scope end when the first flow completes. Docs are at:
    http://download.oracle.com/docs/cd/E21764_01/doc.1111/e15176/model_bus_procs_bpmpd.htm#CJABIBCB
    Section 6.7.5

  • Is there a pref to turn off border/shadow in window screen capture?

    Somewhere along the line, Apple changed screen capture of a window (cmd-shift-4 and then spacebar) so that now you get a white border and drop shadow around the window in the screen capture file. This is very pretty, but for the purposes of posting captures on websites, for example, the original 'just the window' capture is really much more useful. Is there a *defaults write com.apple.screencapture* (or something) preference that can be changed to set the border/shadow to off?
    - padmavyuha

    Yes, annoying isn't it? I got mine changed using this command in Terminal:
    defaults write com.apple.screencapture disable-shadow -bool true
    You then need to log out and back in. This fix is courtesy of "atverd" at MacOSXHints. Bless him, and Rob Griffiths.
    Francine
    Francine
    Schwieder

  • Capture active window

    does java offer any methods to capture the active window as an image ie .gif or .jpeg?

    thx for the info...i'm having difficulty compiling and executing the source files...can u helpme?

  • Mavericks Screen Capture causes spinning beach ball

    Trained by experience never to install a brand new operating system on top of a perfectly functioning one (unless I want to risk many wasting times and losing productivity), to test out the new Mac OS, I installed Mavericks on an external FireWire drive by upgrading a fresh install of Snow  Leopard, updated to its maximum version. Nothing else was on the volume, for I had used Disk Utility to securely erase and content and overwrite the volume with zeros.
    Immediately after the Mavericks, I looked at the System Profile, taking some screen captures of selected windows. While Mavericks successfully captured the screens, it failed to display them when I selected one and hit the space bar. Instead, mavericks presented a perpetually spinning beach ball that prevented me from doing anything else on the Mac. I was forced to shut down.
    Upon restart back into Mavericks, I encountered the same problem. I had to force power off again.
    After rebooting into Mountain Lion on my internal hard drive, I ran a complete series of hard drive maintenance utilities involving all the tools I have, including Disk Utility, Drive Genius, Disk Warrior, and Tech Tool Pro. All ran successfully and reported no problems. I then capped things by running iDefrag to eliminate file fragmentation and to optimize the volume. With several hours of labor invested in preparing the external hard disk, downloading Mavericks' installer, running the Mavericks installer, performing all the pertinent maintenance routines I could think of, and finally optimizing the volume, which has no other software on it besides the new Apple operating system, I restarted the Mavericks volume. I then took a fresh screen capture, selected it, pressed the space bar, and I still got that infernal spinning beach ball.
    I let it run for at least half an hour as I returned to watching a football game, hoping things would finally get cleared up. They did not. The ball still spun. I could not even get to the Finder to peek into the Force Quit command under the Apple icon. So, as originally condemned, I was compelled to hold down the power button to regain control of my computer, which this new, appropriately named operating system had wrested from me.
    Anyone having a similar problem? Anyone aware of a sure-fire solution, other than to avoid relying on this new operating system, which must be my policy until such glitches get fixed?
    At least you know now why I consider it unwise to install a brand new OS atop of one that has served you well.

    OK, it’s Wednesday now, late afternoon, following a long yesterday, spent exclusively on getting Mavericks installed, a day which continued well into night, approaching the sun rise, until I collapsed. No one can tell me that the Mavericks installation is without errors! Your mileage may differ, if you’re lucky. But if you had to go through what I just did, you’ll long for the days of System 7, when all you had to do was shove a half-dozen floppy disks into a floppy drive to get your Mac up and running without such angst.
    SHORT ANSWER:
    After many twists and turns that Apple should have foreseen and not inflicted upon customers, I finally managed to get Mavericks installed on my external Firewire hard drive.
    I did follow your lead, Baltwo, that the nature of the problem might lay in corrupt preferences files on the primary Account, but, as I attempted a couple of days, I modified your suggestion that I cherry-pick which plist files might be good vs. which might be corrupt, by deleting the whole **** account. A couple of days ago, my intuition told me that doing that was the wiser way to proceed;  today I felt compelled to do exactly that, because I had no other choice.
    The reasons I had to do that is elaborated upon below.
    LONGER EXPLANATION and DETAILS:
    As I explained in the message I composed on Tuesday morning, I felt so insecure that I did not obtain a well-functioning operating system that I had decided to start the installation all over from scratch.
    It took all day Monday to again use Disk Utility to securely erase the volume and prepare it for the new installation. When I tried to short-cut the process by doing a Quick Erase, the volume refused to accept the installation of Snow Leopard 10.6.3 from the DVD. On top of that, I again encountered difficulties in installing Snow Leopard from the DVD, because the installer just could not close the deal. The gauge runs up to the 99% mark, and it hangs there saying that it is “Moving items into place.” Sure, it is!
    I’m a patient guy, so I let the installer do its thing for about four hours while I watched the World Series game. (Yeah, Red Sox!) But by the time the game was over, so was my patience. I had to Force Power Off the Mac and restart it.
    Since I have no confidence in an operating system whose installer failed to do its job properly, I felt that I had to do more. Before I did that, though, I did a Google search to find out if my experience was unique. It is not! The forums are full of people who have complained about this very same hanging problem ever since the Snow Leopard DVD was released. Great, I thought. Now what do I do?
    I decided to the Apple support site and download the 1.x GB combo updater to Snow Leopard 10.6.8 in the hopes that the upgrade process would cure whatever issues cropped up during the incomplete installation by the DVD. After downloading that combo disk image, installing 10.6.8, restarting the Mac under 10.6.8, and getting all the software updates applicable to that version, a few tests, supplemented by a running a whole barrage of maintenance utilizes to fix permissions, repair the disk, rebuilt the directory, seemed to indicate that I did finally achieve a solid installation of Snow Leopard 10.6.8 and all its trimming.
    To save myself any future agony of having to go through this kind of winding road installation again, I used SuperDuper to create a disk image of the entire volume.  That disk image is stored on another Firewire volume, ready to burned at some future date onto a BluRay disc for safe-keeping and backup.
    With Snow Leopard safely installed on the volume and sporting one user Account, I was ready to use the Mavericks installer package that I had downloaded last Saturday, when I first began this process, to upgrade to Apple’s latest and greatest OS. Unfortunately, the installation process failed in the same way that the Snow Leopard installer failed. The installer just could not get over the hump of closing the deal. Once I got the installer started, I went to bed.
    Four hours later, the installer still had not completed its job, again getting to the 99% mark, and just hanging there. Again, I had to Power Off the Mac. Upon restarting with the Option held down, I elected to start up using the built-in Recovery feature.
    That seemed to work, but only sort of. I was able to get a Mavericks desktop, but the User account had absolutely no privileges to do a **** thing. It could not open its own Home folder to see what was in it. It could not complete the screen capture process, because I had no permission to save the picture anywhere, like on the Desktop.
    In System Preferences, I tried to increase the size of the cursor, but that failed. In Finder preferences, I tried to make the hard drives show up on the desktop, but that failed, too. I ran permissions in Disk Utility; that did no good. Nothing worked! I could not even change anything related to my User account, because I had no permission to do so. Imagine that: my only account was an Administer account to which I had no access. I would not have thought such a thing could be possible.
    I was caught in a loop, stranded on a Mobius Strip, walking on the wild side, surfing the waves of a brand new operating system corrupted by its own installation process.
    Not a good thing at all.
    Since the first installment had also resulted in a bizarre set of user accounts ending up with QuickLooks being declared the winner of a new account the system decided to create for me, I think it is reasonably safe to conclude that there is some kind of a bug, or flaw, in the Apple upgrade / installation procedure that needs some attention by Apple system engineers. None of this kind of stuff I have delineated at some length should be happening to anyone who owns a Mac.
    And, Baltwo, even though I had kept uppermost in my mind your suggestion about creating a new account merely to ferret out which preference files might be corrupt and which might be OK, I decided that I did not want to take any chances at all with this extremely messed User account, which had worked fine in Snow Leopard, but had somehow got corrupted during the upgrade. So, as before, I decided to (1) create a brand new Administrator account; (2) log out from the useless User account in which I had no privileges whatsoever; (3) log in with the brand new Adminstrator; and (4) delete that useless User account entirely, completely, and forever.
    At first, I was a little hesitant about deleting the first Administrator account that existed in my Users and Groups pane. I did not even know if such a thing could be done. So, I referred to my David Pogue reference books, and I did a Google search for “Delete Home User Mac” to see what others knew about this. Everyone described the standard way to delete an account; no one even mentioned any prohibition about deleting the original User account. So, I went ahead and deleted it, without encountering the slightest problem in doing so. I even followed up with before and after Terminal commands to see if that useless User account was truly gone, and it definitely went poof. Since I lacked permissions to create any documents at all within that former Home folder, getting rid of it was easy. I think that the System was just as glad to trash it as I was.
    Hopefully, whatever corruption occurred during the Mavericks installation and upgrade process was restricted to the preference files associated with that messed-up, original Administrator account so that I can begin exploring Mavericks with a perfectly pristine operating system. Before I start tweaking it or adding stuff to it, my next step will be to use SuperDuper to create a disk image of the entire volume, so that, in the future, I will have a clean set of system of file to install on this external Firewire volume, or on any other internal hard drive I choose to install Mavericks later on. A Bluray disc will contain that disc image for safekeeping when it’s time to remove it from the destination volume where it gets created.
    As to the tardiness of my reply, it is caused by the exorbitant amount of time—four days!—it took me to trek along this twisting, winding path of installing Mavericks, as well as a glitch in the mismatch of similarly looking User Names associated with similarly looking Apple ID accounts and similarly looking User Names associated with nearly identical Email Addresses that do not convert from one to the other, as, for example, mac.com does to me.com.
    As I learned from Apple Staff who responded to my report that I was being locked out of the Apple Discussions community, there are four pieces of information that must match up for each Apple ID account, and my data had slipped out of sync. Now I know why, during Apple’s changeover in the formatting of the Apple Discussions section, I lost all those “points” I had accumulated in helping others, not that I track such things, and I could not find where my previous discussions were.
    That’s also why I may be able to award anyone points for helping me in this thread, but I’m dialing in under the “other” Apple ID, not the one I used to create this topic. Close readers will observe the slight difference.
    Thanks a lot, Baltwo. You get the credit for pointing me in the right direction.

  • Screen capture not working right in 10.6.2

    Since installing 10.6.2, screen capture of a window puts a black border around the captured window instead of the shadow. Any idea's why?

    there have been many posts about this. could be a bug.
    http://discussions.apple.com/thread.jspa?messageID=10559347&#10559347
    http://discussions.apple.com/thread.jspa?messageID=10217973&#10217973
    http://discussions.apple.com/thread.jspa?messageID=10553006&#10553006
    you can try a few things suggested in those threads. first, go to the directory homefodler/library/preferences and delete the files com.apple.systemuiserver and com.apple.screencapture.plist. (the second file may not exists) and run the following terminal command
    killall SystemUIServer
    try taking a screencapture again. if that does not help install Onyx
    http://www.apple.com/downloads/macosx/systemdiskutilities/onyx.html
    and use the parameters tab to either turn off the shadow in screenshots or change the image format used for screencaptures to png.

  • Screen capture tablet hp stream 8

    how do i do a screen capture? vol- & windows ket does not work

    Hey @Faengelm ,
    Welcome to the HP Forums!
    I understand you're looking for information on taking screenshots with the Stream 8 tablet.
    The shortcut you listed for Windows tablets does not work on the Stream 8. To take screenshots of desktop apps you will need to use the Snipping Tool. You can find this by searching Snipping Tool in the start screen.
    If you want to share a screenshot of an app you can use the screenshot feature by swiping in from the right, selecting Share, and changing the dropdown at the top right corner to Screenshot and then selecting how to share the screenshot. Choices here are limited, and personally I use Mail to share a .png image by sending it to myself so that I can do what I need with the screenshot.
    Hopefully that helps.
    Please click the "Kudos, Thumbs Up" at the bottom of this post if you want to say "Thanks" for helping!
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    The Great Deku Tree
    I work on behalf of HP.

Maybe you are looking for

  • Windows Vista and Apple TV

    Anyone got an answer to why I cannot see Apple TV under Devices in my new recently installed 7.2 version of Itunes? In fact that catagory doesn't even show up. I'm running Vista Home Premium and I've tried everything in the Apple TV help section incl

  • LIS Credit Memo

    In MCSI we have our own customized info structure S991.In the present system, Credit Memo values are getting updated in Gross Credit Memo column. Our client wants the Credit Memo value to be updated in Gross Inv sales Column. In Gross invoice column

  • I lost all my photos in iPhoto after I updated the iPhoto thumbnails.  How do I get my pictures back?

    After I updated the thumbnails, my iPhoto could not even open, but when I did, all my photos were gone.  Is there a way to recover those photos that I lost?

  • Validation on selection screen parameter.

    I have select options in my selection screen. 1) s_a 2) s_b Requirement:- 1) If I run the program and click the arrow on the "s_a" field, it should open multi selection screen. From that I can make multi entry or upload data from excel file. 2) If "s

  • Performance issues while issuing cursor

    Hi All, I have two tables, Tab1 contains 8000 rows and tab2 contains 2000 rows. I need to check which all tab1 data are missing in table2. I wrote the comparision query using cursor within curosoe and its working fine also but its taking a long time.