LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Check if process is 32 or 64 Bit.

Hello everyone,

 

I use the .net Framework (getProcessesByName) for looking up a process, but now I want to check if that prozess is 32 or 64 Bit.

 

Has someone an idea?

0 Kudos
Message 1 of 12
(4,698 Views)

This is most likely a question for a different forum. Is this LabVIEW related?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 12
(4,692 Views)

Yes, it is,

 

It is a Labview VI, I thought it would be clear. Smiley Surprised

0 Kudos
Message 3 of 12
(4,685 Views)

But what I'm saying is your issue isn't with LabVIEW. You're using the .NET framework which is Microsoft. You can't access the Windows processes through LabVIEW unless you're using the .NET framework as an intermediate language. Have you found a .NET method that does what you're trying to do?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 12
(4,677 Views)

I got the Code (under this post) from another User and now I want to change the code so I can look that up. I thought that not switching off .net would be the best idea.

 

dotNet Get Process.png

0 Kudos
Message 5 of 12
(4,662 Views)

The Process reference has a lot of Properties that you can access. Maybe one of these can be analyzed to figure out if the process is 64bit or 32bit.

Process Properties.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 12
(4,644 Views)

Try here: http://stackoverflow.com/questions/1953377/how-to-determine-programmatically-whether-a-particular-pr...

 

You should be able to get the IntPtr.Size (the first suggestion) from the Handle property of the process.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 12
(4,636 Views)

The IntPtr.Size was a good idea, but it only works with the program itself, so I can check if Labview is a 32 or 64 Bit system but no other programs.

 

 

0 Kudos
Message 8 of 12
(4,590 Views)

There are other suggested methods in that thread, and other linked threads inside it.

 

Calling IsWow64Process from kernel32.dll from a call library function node would do it.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 9 of 12
(4,573 Views)

@Sam_Sharp wrote:

There are other suggested methods in that thread, and other linked threads inside it.

 

Calling IsWow64Process from kernel32.dll from a call library function node would do it.


 

BOOL WINAPI IsWow64Process(
  _In_  HANDLE hProcess,
  _Out_ PBOOL  Wow64Process
);

This function supposedly returns FALSE if the process in question is running natively. That means the only time it is TRUE is if the process is a 32 bit process under Windows 64 Bit. So you would first have to determine if you run under 64 Bit Windows and if so then if this function returns FALSE you have a 64 bit process. Otherwise you always have a 32 bit process.

 

I'm pretty sure .Net has something along this function as a method of the Process class.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 12
(4,541 Views)