10-31-2011 02:22 AM
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
10-31-2011 02:36 AM
Hi,
although not from NI I would suggest having a look at GetPanelDisplayBitmap.
Wolfgang
10-31-2011 03:10 AM
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....