Public extern static IntPtr GetProcAddress(IntPtr hwnd, string procedureName) Public extern static IntPtr LoadLibrary(string libraryName) (would have posted as a comment, but I'm a new user!) Just figured I'd post it so other people didn't have roll it by hand. This is just an implementation of what's suggested above by Bruno Lopez, but works on Win2k + all WinXP service packs. If (!IsWow64Process(p.Handle, out retVal)) Using (Process p = Process.GetCurrentProcess()) Public static bool InternalCheckIsWow64() Private static extern bool IsWow64Process( ![]() Static bool is64BitOperatingSystem = is64BitProcess || InternalCheckIsWow64() My solution: static bool is64BitProcess = (IntPtr.Size = 8) How to detect programmatically whether you are running on 64-bit Windows If this returns true, you are running in a 32-bit process on 64-bit Windows. NET you can do so by checking IntPtr.Size), and if you are running in a 32-bit process, you still have to call the Win API function IsWow64Process. ![]() NET Framework 2.0 on 64-bit Windows (it would return 32-bit).Īs Microsoft's Raymond Chen describes, you have to first check if running in a 64-bit process (I think in. ![]() IntPtr.Size won't return the correct value if running in 32-bit. NET Framework 4.0, you can just check Environment.Is64BitOperatingSystem. UPDATE: As Joel Coehoorn and others suggest, starting at.
0 Comments
Leave a Reply. |