LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get application name via Windows API or another source

Solved!
Go to solution

Here's a VI download as well... LV18.

 

EDIT: Saved back to LV11 as well...

Download All
0 Kudos
Message 11 of 15
(1,062 Views)

What are all the 12345678 strings supposed to represent?

0 Kudos
Message 12 of 15
(1,052 Views)

@Eric1977 wrote:

What are all the 12345678 strings supposed to represent?


A buffer.


The dll needs a pointer to a buffer, large enough to copy the string in.

 

The string can't allocate the buffer, as it would be ambiguous who's responsible for releasing it.   

0 Kudos
Message 13 of 15
(1,050 Views)
Solution
Accepted by Eric1977

Ah. Gotcha. Thank you for the explanation on some of those Windows API functions.

 

I wanted to share my solution in case someone else needs it. It was far simpler than what I realized which is usually the case after taking a step back.

 

After getting the Process ID (PID), I did a lookup on the task manager using the System Exec.vi looking for that specific PID and it will return the image name which is the executable name the application uses. Just throw that into an array and extract the ImageName. The VI uses LV 2018.

0 Kudos
Message 14 of 15
(1,033 Views)

Hi,

 


wiebe@CARYA wrote:

@Eric1977 wrote:

I can't seem to drag your image to a blank block diagram. It always comes in as a image.


That's because the forum shrinks the image to save bandwidth. In the shrinking process, it removes the embedded VI section.

 

  1. Copy the image's link:/t5/image/serverpage/image-id/272987iD312656E0CA750CC/image-size/large?v=1.0&px=999
  2. Remove /image-size...: /t5/image/serverpage/image-id/272987iD312656E0CA750CC
  3. Save this image.

 

Now it should have the embedded VI.

 

Anyway, I showed all names, so it could be replicated as well 😉.


Or:

  1. Click to image to start the image viewer
  2. Click the download button right below the image…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 15
(1,028 Views)