LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos
Message 1 of 3
(2,893 Views)

Hi,

 

although not from NI Smiley Wink I would suggest having a look at GetPanelDisplayBitmap.

 

Wolfgang

0 Kudos
Message 2 of 3
(2,891 Views)

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

0 Kudos
Message 3 of 3
(2,886 Views)