public static bool IsRunningInNWN2Server() { try { if (GetExoAppWindow() != IntPtr.Zero) return true; } catch (ApplicationException) { } return false; }