public static bool IsWow64() { bool isWow64 = false; IntPtr functionPtr = WinBaseApi.GetProcAddress(WinBaseApi.GetModuleHandle("kernel32"), "IsWow64Process"); if (functionPtr != IntPtr.Zero) { IsWow64ProcessDelegate del = (IsWow64ProcessDelegate)Marshal.GetDelegateForFunctionPointer(functionPtr, typeof(IsWow64ProcessDelegate)); del(WinBaseApi.GetCurrentProcess(), out isWow64); } return(isWow64); }
public static bool IsUiThread(IntPtr handle) { return(WinBaseApi.GetCurrentThreadId() == GetWindowThreadId(handle)); }