02-09-2016 04:37 AM
Hi community,
An application constantly runs on a PC. I need to periodically capture its window and save it to a disk, similarly as if I would select the window of the application and hit ALT+Printscreen. The trick is that the application is not necessarily visible as the operator can minizmize it to the tray or another application can overlay its window. Its size and position can change as well.
Is there way to do this with labview?
thanks.
02-09-2016 04:52 AM
For sure there are many ways to do this.
Maybe a fully LabVIEW way with the CCT, never tried though, not sure it's going to work in EXE.
Certainly a "windows way" with dlls and getting the data from the clipboard, sounds like a lot of work to me.
Because it just work with very little coding, I install IrfanView along with my EXE and whenever I need a screenshot I launch a cmd :
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-09-2016 05:01 AM
I can take screenshots in numerous ways even w/o irfanview, but as the app is not always visible on the desktop or could be (partially) covered by other windows simply taking screenshot doesnt solve my problem. Also I dont need a full screenshot. Having the entire deskop on the image is very undesirable.
See my original post:
"...similarly as if I would select the window of the application and hit ALT+Printscreen. The trick is that the application is not necessarily visible as the operator can minizmize it to the tray or another application can overlay its window. Its size and position can change as well."
02-09-2016 05:25 AM
Oh... then I would look into the CCT
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-09-2016 05:25 AM
What the CCT does is to call the FP.Get Image method on the VI, which returns an image of the FP, which you can then save to a file. I believe this should work in an EXE (assuming the FP wasn't removed, which it wouldn't be if you use it as a window), and should probably also work if the FP is not visible, but I'm not sure if the FP updates correctly if it is minimized. You will need to test that.
02-09-2016 05:32 AM - edited 02-09-2016 05:37 AM
use this method put it inside the case structure and start programing to execute in particular time
you just need to adjust the picture size same as your ROI to capture too
02-09-2016 06:11 AM
Unfortunately, its not a LabVIEW exe, its a 3rd party application.
02-09-2016 06:15 AM
Oh... And you want to make a LabVIEW app to get screenshots of this 3rd party app periodically?
Then it make it a little more difficult... I guess you can use Windows dlls to retrieve the Window Handle of the app but then I don't know how to get a screenshot of it 😮
Maybe .NET lets you do that I have no idea. Can't help more than this.
Good luck
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
02-09-2016 06:19 AM
Yeap, thats correct. I bet there is a way to automate this, but as you said... most likely it will be .net or dll calls.
02-09-2016 06:40 AM
so you means is this not capture front panel see this page it will be help you
Programmatically Acquire a Screen Capture in LabVIEW