private void CreateMagnifier() { if (!this.isInitialized) { return; } IntPtr hInst = Kernel32.GetModuleHandle(null); this.form.AllowTransparency = true; this.form.TransparencyKey = Color.Empty; this.form.Opacity = 0; User32.GetClientRect(this.form.Handle, ref this.magnificatorWindowRect); this.hwndMagnificator = User32.CreateWindow( 0, Magnification.WC_MAGNIFIER, "MagnifierWindow", (int)WinUser.WS_VISIBLE | (int)WinUser.WS_CHILD | (int)Magnification.MagnifierStyle.MS_SHOWMAGNIFIEDCURSOR, this.magnificatorWindowRect.left, this.magnificatorWindowRect.top, this.magnificatorWindowRect.right, this.magnificatorWindowRect.bottom, this.form.Handle, IntPtr.Zero, hInst, IntPtr.Zero ); if (this.hwndMagnificator == IntPtr.Zero) { return; } Magnification.Transformation matrix = new Magnification.Transformation(this.magnificationFactor); Magnification.MagSetWindowTransform(this.hwndMagnificator, ref matrix); }
public static extern bool MagSetWindowTransform(IntPtr hwnd, ref Magnification.Transformation pTransform);