LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close a notepad window in labview after opening it with system exec

Is there a way to close a notepad window within Labview after opening the window using the System Exec function?
 
Also can Labview send characters to Notepad so they show up in its window?
0 Kudos
Message 1 of 4
(3,220 Views)

You can send a quit message to another window by using one of the VIs in a collection of windows interaction VIs called winutil32 (or something similar), but you will have to know the window name. Try searching for it on this site.

You could probably also use the windows PostMessage function to send characters to another window, but that would require learning how to work with DLLs in LV, reading up on the function at the MSDN site and implementing it. Another, more simple but less secure, way is to use the windows Keybd_Event function to simulate keyboard clicks. If the notepad window has the focus, it will receive those clicks. Try searching this site or google for things like "Keybd_Event LabVIEW" or "simulate keyboard".


___________________
Try to take over the world!
Message 2 of 4
(3,212 Views)
Thank you G man!  I got labview to close notepad by using the quit applications.vi in the lvwutil32 library.
 
I'm putting my other question on the back burner for now since LV doesn't have an easy way to send characters to an application such as notepad.
 
Regards,
Jeff
0 Kudos
Message 3 of 4
(3,189 Views)
> I'm putting my other question on the back burner for now since LV doesn't have an easy way to send characters to an application
> such as notepad.
 
 
Yes you can.  Try G Toolbox:   http://gtoolbox.yeah.net
George Zou
Message 4 of 4
(3,161 Views)