public MouseCapture() { IntPtr desk = PInvoke.GetDesktopWindow(); using(Graphics desktop = Graphics.FromHwnd(desk)) mask = DeviceHandle.CreateCompatibleDC(desktop); cursorInfoSize = Marshal.SizeOf(typeof(CURSORINFO)); }
public MouseCapture() { IntPtr desk = PInvoke.GetDesktopWindow(); using (Graphics desktop = Graphics.FromHwnd(desk)) mask = DeviceHandle.CreateCompatibleDC(desktop); cursorInfoSize = Marshal.SizeOf(typeof(CURSORINFO)); }
protected virtual void Dispose(bool disposing) { if (disposing) { // free managed resources mask.Dispose(); mask = null; } }
public static DeviceHandle CreateCompatibleDC(Graphics graphics) { if(graphics == null) throw new ArgumentNullException("graphics"); IntPtr source = graphics.GetHdc(); IntPtr handle = PInvoke.CreateCompatibleDC(source); DeviceHandle dc = new DeviceHandle(handle); graphics.ReleaseHdc(source); return dc; }
public static DeviceHandle CreateCompatibleDC(Graphics graphics) { if (graphics == null) { throw new ArgumentNullException("graphics"); } IntPtr source = graphics.GetHdc(); IntPtr handle = PInvoke.CreateCompatibleDC(source); DeviceHandle dc = new DeviceHandle(handle); graphics.ReleaseHdc(source); return(dc); }
protected virtual void Dispose(bool disposing) { if(disposing) { // free managed resources mask.Dispose(); mask = null; } }