This widget could not be displayed.
This widget could not be displayed.

LabVIEW

This widget could not be displayed.
cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically send commands to any windows application

I want to send commands to other windows applications which are running on the background of labview.

I have an option through "send key ", but the application needs to be active window. But I don't want the application  to be an active window.

I think I need to get the handler for that application so that I can send commands to a particular application which ever I want to, but cannot find a way to do so.

 

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 1 of 11
(6,069 Views)

Hi kpraveen,

you can use the user32.dll functions to get the handle and to send messages.

See this link:

http://msdn.microsoft.com/en-us/library/ms633499(VS.85).aspx

 

and this

http://forums.ni.com/ni/board/message?board.id=170&message.id=338001&query.id=449931#M338001

 

Mike

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 2 of 11
(6,062 Views)

User32 LLBS are in LV4.0 version. I need them in lv 8.5.

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 3 of 11
(6,057 Views)
See here. They are in LV 8.2. You can use them for LV 8.2 & later versions.
- Partha ( CLD until Oct 2027 🙂 )
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 4 of 11
(6,047 Views)

i was able to control the application if the window was "active window" for me. But i want to send commands even if the window is not an acitve window for me. 

 

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 5 of 11
(6,016 Views)

i did also try FindwindowA() (user32.dll) and postmessageA() but was not sucessfull. The windows handle  from find window was always zero for me.

I took reference from below thread and msdn to use findwindow and postmessage functions.

http://forums.ni.com/ni/board/message?board.id=170&message.id=15281&query.id=519324#M15281

 

 

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 6 of 11
(6,011 Views)

Possibly a program called macro express could do this. It has an option to create macro commands that work only on certain windows and programs. Look at the macro scope options. Global, Global except, window specific, Program specific. I'm not 100% sure these will run on minimized windows, but it is a fairly cheap program around $60.

 

http://www.macros.com/index.htm

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 7 of 11
(5,997 Views)

Still i am not able to send commands .........

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 8 of 11
(5,946 Views)

Hi kpraveen,

see this link, inside off the zip file you'll find a working "FindWindowA" function.

 

Which commands do you want to send to your application?

 

Mike

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 9 of 11
(5,940 Views)
I was able to use "findwindow" and get the handle for the Non-Labview application. But I was not able to control or send commands and messages  using "postmessage" or "sendmessage" functions of user32.dll when this Non- labview application is not my active window. I was  able to send when Non- Labview application was active window.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 10 of 11
(5,916 Views)