void updateUI() { this.apply.Enabled = false; if (vvw.HWnd == IntPtr.Zero) { this.currentStatus.Text = "VRView Not found"; return; } var size = vvw.GetResolution(); if (size.IsEmpty) { this.currentStatus.Text = "VRView Not available"; return; } this.currentStatus.Text = string.Format( "CurrentReso: {0}x{1}", size.Width, size.Height ); this.saveShortcut.Enabled = this.apply.Enabled = true; }
public static void Run(string arg) { Size s; try { s = Util.Str2Size(arg); } catch { MessageBox.Show( string.Format("Illegal argument: {0}", arg), Program.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Hand ); return; } var vvw = new VRViewWindow(); if (vvw.HWnd == IntPtr.Zero) { MessageBox.Show( "VRView window not found", Program.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Hand ); return; } if (vvw.GetResolution().IsEmpty) { MessageBox.Show( "VRView window is not available", Program.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Hand ); return; } if (s.IsEmpty) { MessageBox.Show( "Resolution is not valid (empty)", Program.APPLICATION_NAME, MessageBoxButtons.OK, MessageBoxIcon.Asterisk ); return; } vvw.SetResolution((IntPtr)0, s); }