From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close browser using labview.

Hi, 

I would like to close the default browser using labview, I know how to close a VI for example, but I do not know how to close the browser because is not the same process.

 

Could you help me?

 

Thanks in advance.

0 Kudos
Message 1 of 9
(3,839 Views)

Hi, following with the same topic, I saw that you know a lot about labview,

 

I would like to close the default browser using labview, I know how to close a VI for example, but I do not know how to close the browser because is not the same process.

 

Could you help me?

 

Thanks in advance.

0 Kudos
Message 2 of 9
(3,840 Views)

Taskkill works, but a slightly more graceful way might be to issue the close window command which is more like clicking the red X.

 

http://digital.ni.com/public.nsf/allkb/81E9C1441900FFCE8625748F0055DBB0

Message 4 of 9
(3,790 Views)

Hi, 

I used this example. It works with LabView and another app that I have but it doesn't work with Google Chrome, I've tried Google, Google Chrome, Chorme, Chrome.exe... and I couldn't close it.

 

Do you know why?

0 Kudos
Message 5 of 9
(3,784 Views)

Hi, 

Thanks a lot. It works perfectly. 

I would like to ask you if you could help me on the following problem.

 

I have a program on labview which the front panel can not disappear because I have to see constantly what is happening, it has to be always visible on the screen.

Problem:

The program send a http comand from labview to chrome to download a file, so chrome oppens it automatically and I do not want that, after the download has been produce, I have to close chrome to continue watching the front panel.

 

Do you know how I can open the Google Chrome Minimized using Open URL with the default browser?

 

I think that if I download the file with the chrome minimized and then I close Chrome using this intruction taskkill, it would be Perfect. 

Thanks in advance.

0 Kudos
Message 6 of 9
(3,781 Views)

Hi aitor,

 

maybe you can use software like AutoIt to do the job of clicking a certain item in the window border of your Chrome instance…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(3,779 Views)

Hi, 

Yeah, it works but I think that if I execute Autoit just an instant after open Chrome, the browser will apear on the screen although if it's 1s. 

Don't you think so?

 

By the way, do you know the istruction to minimize on Autoit? I know thaht I can do it by coordenates clicking but the resolutions of the sreens change and that will be a problem. I could try

 

I prefer do not combine two programs on my task.

0 Kudos
Message 8 of 9
(3,776 Views)

@aitorplaza wrote:

 

I used this example. It works with LabView and another app that I have but it doesn't work with Google Chrome, I've tried Google, Google Chrome, Chorme, Chrome.exe... and I couldn't close it. 


Since you didn't quote anyone, there is no way to know who you are talking to but I will assume it is my reply.  The title of the window in a browser changes with the page you visit.  Like for me the title of my Chrome window is something like "Reply to Message - Discussion Forums - National Instruments - Google Chrome".  Also Chrome behaves differently than most programs, and generates a new PID for each window, not just a new HWND.  This means you should be able to close just the one tab by killing or closing the one PID/HWND.  I tested this and it didn't quite go as planned.  The code here will list all open windows, you can find the ones that contain "Google" and you will probably find all your open windows.  Find the HWND associated with that window, and then pass that into the close function I linked to earlier.  For me at least this still closed all of my Chrome window.  Not sure why it didn't just close the one.

 

Oh and if you do get the HWND you can pass it into the Win32API functions and do things like minimize, maximize, and resize. Again no idea how this interaction works with Chrome since each tab gets its own PID.

0 Kudos
Message 9 of 9
(3,772 Views)