static private Check ( ErrorCode error ) : void | ||
error | ErrorCode | |
return | void |
public string NextCommand() { SafeCommandHandle command = null; try { uint length; IntPtr ptr; ErrorCode result = NativeMethods.windower_next_command(this.handle, out command); if (result == ErrorCode.OutOfRange) { return(null); } WindowerException.Check(result); WindowerException.Check(NativeMethods.windower_command_length(command, out length)); WindowerException.Check(NativeMethods.windower_command_string(command, out ptr)); byte[] buffer = new byte[length]; Marshal.Copy(ptr, buffer, 0, (int)length); return(UTF8.GetString(buffer)); } finally { if (command != null) { command.Dispose(); } } }
public Text(Instance instance, string name) { int asciinamelength = Instance.ASCII.GetMaxByteCount(name.Length) + 1; byte[] asciiname = new byte[asciinamelength]; Instance.ASCII.GetBytes(name, 0, name.Length, asciiname, 0); WindowerException.Check(NativeMethods.windower_text_create(instance.Handle, out this.handle, asciiname)); }
public void SetPadding(float pixels) { if (pixels < 0) { throw new ArgumentOutOfRangeException("pixels"); } WindowerException.Check(NativeMethods.windower_text_set_padding(this.handle, pixels)); }
public Instance(Process process) { NativeMethods.Initialize(); if (process == null) { throw new ArgumentNullException("process"); } WindowerException.Check(NativeMethods.windower_create(out this.handle, (uint)process.Id)); }
public void SetFont(string typeface, float size) { if (typeface == null) { throw new ArgumentNullException("typeface"); } int utf8typefacelength = Instance.UTF8.GetMaxByteCount(typeface.Length) + 1; byte[] utf8typeface = new byte[utf8typefacelength]; Instance.UTF8.GetBytes(typeface, 0, typeface.Length, utf8typeface, 0); WindowerException.Check(NativeMethods.windower_text_set_font(this.handle, utf8typeface, size)); }
public void SetText(string text) { if (text == null) { throw new ArgumentNullException("text"); } int utf8textlength = Instance.UTF8.GetMaxByteCount(text.Length) + 1; byte[] utf8text = new byte[utf8textlength]; Instance.UTF8.GetBytes(text, 0, text.Length, utf8text, 0); WindowerException.Check(NativeMethods.windower_text_set_text(this.handle, utf8text)); }
public void SendString(string text) { if (text == null) { throw new ArgumentNullException("text"); } int utf8textlength = Encoding.UTF8.GetMaxByteCount(text.Length) + 1; byte[] utf8text = new byte[utf8textlength]; UTF8.GetBytes(text, 0, text.Length, utf8text, 0); WindowerException.Check(NativeMethods.windower_send_string(this.handle, utf8text)); }
public Instance(string domain, Process process) { NativeMethods.Initialize(); if (domain == null) { throw new ArgumentNullException("domain"); } if (process == null) { throw new ArgumentNullException("process"); } int utf8domainlength = UTF8.GetMaxByteCount(domain.Length) + 1; byte[] utf8domain = new byte[utf8domainlength]; UTF8.GetBytes(domain, 0, domain.Length, utf8domain, 0); WindowerException.Check(NativeMethods.windower_create_remote(out this.handle, utf8domain, (uint)process.Id)); }
public void HideBackground() { WindowerException.Check(NativeMethods.windower_text_hide_background(this.handle)); }
public void ShowBackground() { WindowerException.Check(NativeMethods.windower_text_show_background(this.handle)); }
public void SetStyle(FontStyles style) { WindowerException.Check(NativeMethods.windower_text_set_style(this.handle, style)); }
public void SetKeyState(Key key, KeyState state) { WindowerException.Check(NativeMethods.windower_set_key_state(this.handle, key, state)); }
public void SetLocation(int x, int y) { WindowerException.Check(NativeMethods.windower_text_set_location(this.handle, x, y)); }
public void Hide() { WindowerException.Check(NativeMethods.windower_text_hide(this.handle)); }
public void Show() { WindowerException.Check(NativeMethods.windower_text_show(this.handle)); }
public void SetAlignment(TextAlignment alignment) { WindowerException.Check(NativeMethods.windower_text_set_alignment(this.handle, alignment)); }
public void SetForeground(byte red, byte green, byte blue) { WindowerException.Check(NativeMethods.windower_text_set_foreground(this.handle, red, green, blue, 255)); }
public void SetBackground(byte red, byte green, byte blue, byte alpha) { WindowerException.Check(NativeMethods.windower_text_set_background(this.handle, red, green, blue, alpha)); }
public void Unblock(InputKinds kind) { WindowerException.Check(NativeMethods.windower_unblock(this.handle, kind)); }
public void SetWeight(FontWeight weight) { WindowerException.Check(NativeMethods.windower_text_set_weight(this.handle, weight)); }