LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use a VI's Menus via ActiveX?

Is it possible to control a VI's menus via ActiveX? I want to select
menu options, just as though a user were running the VI from the
keyboard, but I can't find any method that manipulates the menus.

TIA.

Leslie
0 Kudos
Message 1 of 4
(2,470 Views)
Leslie,

LabVIEW haven't any method exposed to manipule its menus.

However, since you are already familiar with ActiveX, you can use the
SendKeys method of the "Wscript.shell" ActiveX component to send keystrokes
to the active LabVIEW window. For example,
SendKeys("%F{DOWN 5}~") is equivalent to typing ALT-F (open File menu)
followed by 5 DOWN arrows and ENTER which activate the "Save" menu item. The
string "^S" CTRL-S does the same. Of course, there is already an ActiveX VI
method to save the VI.

For a complete syntax for SendKeys see:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wsh/htm/wsM
thSendKeys.asp

Jean-Pierre Drolet


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 4
(2,470 Views)
lesliebrooks@my-deja.com (Leslie Brooks) wrote in message news:...
> Is it possible to control a VI's menus via ActiveX? I want to select
> menu options, just as though a user were running the VI from the
> keyboard, but I can't find any method that manipulates the menus.
>
> TIA.
>
> Leslie

A couple of people pointed out that I can use the Windows
Scripting Host; that was good advice. However, the WSH always sends
keystrokes to the Active Window. If I have two VIs running, how do I
select a VI to be the Active Application? (Or, how do I force an
ActiveX server VI to seize the focus?) I can't find any method or
property that seems to do this.

TIA.

Leslie
0 Kudos
Message 3 of 4
(2,470 Views)
Leslie,

to bring a VI as the topmost window of the LV application, use the FPWinOpen
property.
Setting TRUE this property when the window is already opened bring the VI
Panel on top.
If you need to give the focus to your application first, use the application
method BringToFront.

Jean-Pierre Drolet


"Leslie Brooks" a ecrit dans le message news:
fc7de112.0110231419.14cb0911@posting.google.com...
> lesliebrooks@my-deja.com (Leslie Brooks) wrote in message
news:...
> > Is it possible to control a VI's menus via ActiveX? I want to select
> > menu options, just as though a user were running the VI from the
> > keyboard, but I can't find any method that manipulates the menus.

> >
> > TIA.
> >
> > Leslie
>
> A couple of people pointed out that I can use the Windows
> Scripting Host; that was good advice. However, the WSH always sends
> keystrokes to the Active Window. If I have two VIs running, how do I
> select a VI to be the Active Application? (Or, how do I force an
> ActiveX server VI to seize the focus?) I can't find any method or
> property that seems to do this.
>
> TIA.
>
> Leslie


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 4
(2,470 Views)