02-27-2006 09:10 AM
02-27-2006 11:15 AM
How are you doing it from the VB program? If there isn't a similar method in LabVIEW a fall back position might be to create a ActiveX control using VB that could be used from within LabVIEW. The usual methods, such as talking to Excel or Word, require them to have ActiveX connectivity. DDE, which you already mentioned it doesn't have support for, would usually be the alternative. Connecting from the VB program shows some means of connectivity, so all isn't lost yet. Have you browsed the "Help/ Find Examples/Communicating with External Applications"?
P.M.
02-27-2006 12:02 PM
I have used the Sendkey() method in VB to send keyboard commands - this however requires that the imaging app window has focus.
The imaging app was not written by me so I am not sure how I can turn it into an ActiveX container. I just have an exe file.
I looked through the examples. Nothing jumps at me..
I searched around and found some gtoolbox advertises similar functionality. I did not download as it is not free but thought I would ask this community if anyone has had success with such toolbox.
Thanks again.
~Roy
02-27-2006 01:07 PM
Simulating keyboard clicks by calling the windows API SetKeyboardState or KeybdEvent functions is fairly easy. You can find some examples if you search the forums. The trick is that the field or window has to have the focus. Another option is probably sending windows messages to the application window, but I haven't tried that path myself.
You can look at the integrating DLLs part of this site for information about calling DLLs and you can find documentation on windows function on the MSDN site.
02-28-2006 05:10 AM
02-28-2006 05:45 AM
Now I remember why I used KeybdEvent and not this when I wanted to simulate key presses.
wiebe@CARYA wrote:
I don't think SetKeyboardState will work, because (from MS SDK): "Changes made to this table do not affect keyboard input to any other thread.".
02-28-2006 08:37 AM
02-28-2006 11:43 AM
02-28-2006 12:10 PM
03-02-2006 09:54 AM
Hi Wiebe,
Thanks for your help. Were you able to find some example that you could post?
~Roy