LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get application name via Windows API or another source

Solved!
Go to solution
Highlighted

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

 

EDIT: Saved back to LV11 as well...

Download All
0 Kudos
Message 11 of 15
(131 Views)
Highlighted

What are all the 12345678 strings supposed to represent?

0 Kudos
Message 12 of 15
(121 Views)
Highlighted

@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
(119 Views)
Highlighted
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
(102 Views)
Highlighted

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 LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Message 15 of 15
(97 Views)