LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get currently running application names on windows

hi all

 

I want to get the list of application names that are currently opened on windows platform through labview

 

Kindly anyone help me in this

 

Thanks

 

With regards

Bala

Message 1 of 39
(14,694 Views)

Hi Bala,

      Back in the day when 32 was a big number, we used to use the Windows API for such things - .but .Net makes life so much easier!Smiley Wink

 

See attached VI. Smiley Happy

 

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 39
(14,673 Views)

hi tbd

 

Thanks for the vi

 

But it gives the process that are running the windows.

 

i need the applications that are opened and not the process

 

Thanks

 

 

Message 3 of 39
(14,652 Views)

"Balavbs_83" <x@no.email> wrote in message
news:1223559605873-789623@exchange.ni.com...
> hi tbd&nbsp;Thanks for the vi&nbsp;But it gives the process that are
running the windows.&nbsp;i need the applications that are opened and not
the process&nbsp;Thanks&nbsp;&nbsp;

All applications are processes, and each process is an application. Even
"processes" that don't seem to have windows, can have windows.

First define "applications that are opened". Do you mean processes that have
open windows? I don't thing you do, because that will also get you the
taskmanager process, since it has an open window...

Regards,

Wiebe.


Message 4 of 39
(14,638 Views)

Hi wiebe

 

Thanks for your mail.

 

Actually i want to get the application names that i have opened in windows.

 

Suppose i have opened LabVIEW, notepad, MS-Word on windows platform

 

I have to get these names through the labview code and not all the processes which run in Windows

 

Hope i have clearly explained my doubt

 

With regards

Bala

Message 5 of 39
(14,623 Views)

"Balavbs_83" <x@no.email> wrote in message
news:1223617204860-790103@exchange.ni.com...
> Hi wiebe&nbsp;Thanks for your mail.&nbsp;Actually i want to get the
application names that i have opened in windows.&nbsp;Suppose i have opened
LabVIEW, notepad, MS-Word on windows platform&nbsp;I have to get these names
through the labview code and not all the processes which run in
Windows&nbsp;Hope i have clearly explained my doubt&nbsp;With regardsBala

Yes, it was kinda clear. But the thing is, it's hard to tell from a process
or application if you've started the application, or the OS.

Task manager can do this, so it is possible...

On the internet (google "how to list of applications") it says (loosely
quoted):

"Use EnumWindows, and check (available through GetWindowLong) if WS_VISIBLE
is true"

EnumWindows isn't very practical from LabVIEW, since NI *still* didn't make
anything to use callbacks. But we can use FindWindowExA (user32.dll)
instead.

Then we call GetWindowLong, to get the GWL_STYLE. Then we test the
WS_VISIBLE bit....

I'll post something soon...

Regards,

Wiebe.


Message 6 of 39
(14,613 Views)

This is working for me... Checking WS_VISIBLE returned some other stuff (even apperently drivers), so I check some other flags as well... Suit yourself.

 

The VI returns the exact same list as task manager's Applications tab.

 

Regards,

 

Wiebe.

Message 7 of 39
(14,608 Views)

Hi Bala, Wiebe,

      Using .NET it's pretty easy to get the application-windows (they're the only processes with a "Main Window Title") but LabVIEW's child-window-names were a problem - so I cheated.Smiley Wink

 

Before 1st reply I searched for a solution like Wiebe's, but didn't find one - nice work Wiebe!

 

Cheers.

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 8 of 39
(14,576 Views)
Tbd,

I've search for a .net solution first, but didn't find one! I gave up early,
I really don't like to work with it, although I have to admit it's pretty
easy if you know where to look. (I got burned with AX a few times, and don't
want to make this mistake with .net.) But I do know where to look in the
windows API, so I tend to use that...

Nice solution...

Regards,

Wiebe.


Message 9 of 39
(14,549 Views)

hi guys

 

Thanks for your replies!!!!

i am getting the required output now from your vi's

Thaks a lot

 

With regards

Bala

0 Kudos
Message 10 of 39
(14,470 Views)