02-26-2020 12:35 PM
I am working on a project that will take data from a device (i.e. weight balance, Mitutoyo Indicator, force gauge, etc) and place the data output wherever the blinking cursor is. I have gone the route of taking the data and placing this into the Clipboard by using the App.Clipboard.Write Invoke Node to save the data to the clipboard and App.Clipboard.Read Invoke Node to extract the data point.
Right now, the data will be saved to a MS Access Form with a textbox but I want to make this scale-able to any program regardless if where the blinking cursor is stationed. Has anyone progmatically found where the blinking cursor is or might have any idea how this might be done?
Solved! Go to Solution.
02-27-2020 06:18 AM
02-27-2020 08:26 AM
I'd like it to be encapsulated all inside LabVIEW. I'll look into the Windows APIs for the FindWindow and FindWindowEx functions. Thank you.
02-27-2020 11:10 AM
This turned out to be much simpler than I had originally thought. Using the SendKeys.SendWait method of the .NET System.Windows.Forms namespace, I can send keystrokes to any program as long as either the caret/cursor is present for the active window or, in the case of Excel (the Active Cell), it will paste/type the data as if it was sent using a keyboard.
And I was freaking out about getting neck deep into the Windows API.
02-28-2020 12:40 AM
Good to hear. I remember now that I have used this to send keys to Windows: https://forums.ni.com/t5/Example-Code/Programmatically-Simulate-Key-Strokes-in-LabVIEW/ta-p/3521756?...
It uses user32.dll's "keybd_event".