LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in acquiring screenshot from Clipboard

Solved!
Go to solution

Hi,

 

for an application I need to acquire timed screenshot. I wrote a VI based on the example that I found at this link: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019NdrSAE&l=it-IT the VI is attacched in this post.

 

The problem is that I have success in triggering the event keybd_event so I have the image in the clipboard (if I copy the image in paint the screenshot is acquired correctly) but when I call the Invoke Node Clipboard->GetImage this returns an empty reference and so I have an error in saving file. It seems that clipboard is empty but it is not true.

 

Someone could help me? Why do I have this behavior?

 

Thank you very much. 

 

 

0 Kudos
Message 1 of 3
(2,177 Views)
Solution
Accepted by topic author Penzium

I think the dll and the .NET calls have to run in the UI thread. Go to the VI properties -> Execution and change "Preferred Execution System" to "User Interface"

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

It works! Thank you very much for your feedback!

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