public static PrintManager GetForWindow(IntPtr hWnd)
        {
            IPrintManagerInterop printManagerInterop = (IPrintManagerInterop)WindowsRuntimeMarshal.GetActivationFactory(typeof(PrintManager));
            Guid guid = typeof(PrintManager).GetInterface("IPrintManager").GUID;

            return(printManagerInterop.GetForWindow(hWnd, ref guid));
        }
        public static PrintManager GetForWindow(IntPtr hWnd)
        {
            Guid iid = InteropHelper.GetIID <PrintManager>();
            IPrintManagerInterop factory = InteropHelper.GetActivationFactory <IPrintManagerInterop>(typeof(PrintManager));

            return(factory.GetForWindow(hWnd, ref iid));
        }
Esempio n. 3
0
        public static PrintManager GetForWindow(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IPrintManager));

            return((PrintManager)printManagerInterop.GetForWindow(appWindow, iid));
        }