Method for native integration and playing PowerPoint PowerPoint in WPF program

By configuring PowerPoint in speaker mode within a WPF application, hiding the media control window, and using Direct3D 11 devices to capture PowerPoint frames, the problems of PowerPoint failing to load and multimedia playback synchronization in existing technologies are solved, achieving seamless integration of native PowerPoint and synchronized display of multimedia content.

CN120803444APending Publication Date: 2025-10-17SHANDONG INSPUR ULTRA HD INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510687601.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing technologies for embedding and playing PPT content in WPF applications suffer from issues such as loading failures, inaccurate scaling, unsuitable layer stacking, inaccurate position anchoring, delayed click event response, and multimedia synchronization problems, failing to meet the requirements for native PPT playback and seamless integration.

Method used

Open the PPT document using Microsoft.Office.Interop.PowerPoint, configure SlideShowSettings to speaker presentation mode, hide the media control window, use the SetWindowPos API to hide the PPT window at the edge of the screen, create a Direct3D 11 device and capture session, capture PPT frames and convert them to BitmapSource for display, and implement PPT page turning control.

Benefits of technology

It realizes native PPT playback in WPF programs without additional players or transcoding steps, supports seamless playback of multimedia content such as videos and animations, and is suitable for scenarios such as education, display and interactive systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803444A_ABST
    Figure CN120803444A_ABST
Patent Text Reader

Abstract

The invention discloses a method for native integration and playing of PowerPoint PowerPoint in a WPF program, and relates to the technical field of graphical interface and multimedia integration, and the method comprises the following steps: configuring a presentation mode of a speaker and hiding a media control window; after a window handle is obtained, a SetWindows Pos API is called to move the window handle to the position outside the edge of a screen, and only one pixel is left to be visible. The method comprises the following steps: establishing a Graphics CaptureItem, registering a window as a capture target, and establishing Direct3D 11 equipment and a context which support the BGRA by using D3D11 CreateDevice at the same time; according to the method, a native device is converted into a SharpDX object, then the SharpDX object is converted into a Windows Runtime device, and on the basis of the Windows Runtime device, a multi-thread Direct3D11 CaptureFramePool is created, and a Graphics CaptureSession is started. And after the registration frame arrives at an event, converting the captured PPT picture into BitmapSource, and displaying the BitmapSource on an Image control of the WPF. Finally, PPT page turning control is achieved through a SlideShowView interface, and in-program complete control over the demonstration progress is completed. According to the method, the original PPT demonstration can be efficiently embedded in the WPF application program, and seamless playing of multimedia contents such as videos and animations is supported.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of graphical interface and multimedia integration, in particular to a method for native integration and playing of a PowerPoint presentation in a WPF program. BACKGROUND

[0002] Currently, the mainstream methods for embedding and playing PPT content in a WPF program mainly include the following two methods:

[0003] 1. ActiveX control embedding: by embedding the PowerPoint Viewer as an ActiveX control in the WPF program, the technical implementation relies on COM component interaction. Specifically, the PowerPoint Viewer is loaded by an ActiveX container such as AxShockwaveFlashObjects, and the PPT playing is controlled through the OLE automation interface. However, this method has the following defects: it only supports Windows system and depends on a specific version of Office environment, and it often fails to load in 64-bit systems or high-version WPF frameworks; it cannot accurately control the size scaling (such as adapting to the WPF window ratio), hierarchical superposition (such as Z-axis ordering with WPF native controls), and position anchoring (such as dynamically adjusting the layout with the window) of the PPT picture; the click event and animation trigger logic in the PPT are difficult to interface with the event system of the WPF program, resulting in delayed user operation response.

[0004] 2. Image playing: the PPT pages are converted into static images (such as PNG, JPG sequence) for display through PowerPoint API or third-party tools, and the technical path is as follows: the Microsoft.Office.Interop.PowerPoint component is used to extract the content of each page of the PPT, and the image is rendered and played through the WPF Image control. However, this method has the following defects: the path animation, erasing effect, 3D rotation, etc. in the PPT cannot be restored, and only static frames can be displayed; the embedded video and audio files are separated and cannot be played synchronously, and the interactive buttons (such as hyperlinks and action triggers) lose their response ability; after converting the standard 20-page PPT into image sequences, the data volume can reach 5-10 times that of the original file, increasing the memory occupation and loading time.

[0005] Both of the above two methods have problems such as content loss or complex integration, and cannot meet the dual needs of "native PPT playing" and "seamless integration" in modern applications. Especially in teaching systems, information display systems and other scenarios, there is an urgent need for a solution that can both play PPT natively and present it completely in the WPF program. SUMMARY

[0006] The present application aims at the needs and deficiencies of the current technology development, and provides a method for natively integrating and playing a PowerPoint presentation in a WPF program.

[0007] The method for natively integrating and playing a PowerPoint presentation in a WPF program of the present application solves the above technical problems by adopting the technical scheme as follows:

[0008] The method for natively integrating and playing a PowerPoint presentation in a WPF program comprises the following steps:

[0009] S1, opening a target PPT presentation by Microsoft.Office.Interop.PowerPoint, configuring SlideShowSettings to enable the presenter mode, and hiding the media control window to ensure the purity of the playing interface;

[0010] S2, obtaining the handle of the window, and using SetWindowPos API to move the PPT playing window to the edge of the screen, and only leaving a 1-pixel edge in the screen;

[0011] S3, creating a GraphicsCaptureItem through the PPT window handle, registering the window as a capture target, using D3D11CreateDevice to create a Direct3D 11 device and context supporting hardware acceleration and BGRA format, first converting the native Direct3D 11 device into a SharpDX object, and then converting it into a Windows Runtime device, creating a Direct3D11CaptureFramePool supporting multi-threading based on the Windows Runtime device, and starting the capture through the Direct3D11CaptureFramePool to create a GraphicsCaptureSession;

[0012] S4, registering a frame arrival event, starting the capture session, and calling StartCapture, converting the captured PPT picture frame into a BitmapSource, and transmitting it to an Image for display, so as to realize the display of real-time PPT pictures in the WPF program;

[0013] S5, realizing the page turning control of PPT through the SlideShowView interface, including Next() and Previous(), and realizing the complete control of the presentation progress in the program.

[0014] Optionally, the step S1 specifically comprises:

[0015] Load the target PPT document through the Microsoft.Office.Interop.PowerPoint component, and call the Presentations.Open method to open the target PPT document after instantiating the Application object;

[0016] Configure the SlideShowSettings property: set the ShowType to

[0017] PpSlideShowType.ppSlideShowSpeaker, that is, the speaker presentation mode, ensures full-screen playback; set the automatic or manual page turning mode through the AdvanceMode property, and set the ShowControls property to msoFalse to hide the PPT native media control bar.

[0018] Optionally, perform step S2 to obtain the PPT process through System.Diagnostics.Process, and call the Win32API.FindWindow method to obtain the playback window handle.

[0019] Further optionally, perform step S2 to use the SetWindowPos API to perform window positioning, move the PPT playback window to the edge of the screen, and only keep 1 pixel in the screen, with specific coordinates (1-width, 1-height), where width and height are the window width and height, so as to ensure that the PPT window is at the top left corner of the screen, and only 1 pixel is kept in the screen, achieving the effect of "hiding but being captured by the system", avoiding affecting the display of the main program interface.

[0020] Optionally, the step S3 specifically includes:

[0021] Obtain the activation factory of the GraphicsCaptureItem through the WinRT module, which is used to create a capture item that interacts with the system window; convert the factory into an IGraphicsCaptureItemInterop interface that allows the creation of a capture item through a window handle; call the CreateForWindow method of the interface, pass in the PPT window handle and the GUID of the GraphicsCaptureItem, and obtain a COM pointer pointing to the capture item; convert the COM pointer into a GraphicsCaptureItem object that can be operated by.NET, and complete the binding of the window and the capture system;

[0022] using SharpDX's Device class to create a Direct3D 11 device in hardware-accelerated mode, and enable BGRA support for WPF compatibility; query the Direct3D 11 device for a DXGI device interface, which is used to interact with the Windows Graphics Infrastructure; through the DXGI device pointer, use

[0023] CreateDirect3D11DeviceFromDXGIDevice function to create a Windows Runtime recognizable IDirect3DDevice interface; encapsulate the native device pointer into a.NET operable IDirect3DDevice object for subsequent graphics capture operations;

[0024] Convert the Windows Runtime device into an IDirect3DDxgiInterfaceAccess interface, which allows access to the underlying DXGI device; get a pointer to the native Direct3D 11 device through the interface accessor; use the pointer to create a SharpDX Device object to establish a managed representation of the Direct3D 11 device;

[0025] Based on the converted Windows Runtime device, create a multi-threaded Direct3D11CaptureFramePool that supports B8G8R8A8UIntNormalized pixel format for WPF compatibility and allocates 2 buffers to store captured frames; use the SharpDX device to create a Texture2D that matches the size of the capture window to store image data extracted from the capture frame; create a GraphicsCaptureSession for the target window through the frame capture pool and start the session to capture the window content.

[0026] Optionally, the steps S4 specifically include:

[0027] Call GraphicsCaptureSession.StartCapture() to start window content capture and register a FrameArrived event handler that triggers when a new frame is available;

[0028] In the event handler: get the Direct3D11CaptureFrame object and its Surface property, and copy the Surface content to the pre-created Texture2D with ShaderResource binding flag through the SharpDX device's ImmediateContext;

[0029] Bind the Texture2D surface using the SetBackBuffer method of the D3DImage control to achieve zero-copy rendering from Direct3D to WPF, or convert the Texture2D to BitmapSource to achieve image data transmission from GPU to CPU through CPU copy;

[0030] Use Dispatcher.Invoke to ensure that the image source is updated in the UI thread, avoid cross-thread operation exceptions, bind D3DImage or BitmapSource through the Image control of WPF, and realize real-time display.

[0031] Optionally, the step S5 specifically comprises:

[0032] The Next() or Previous() method is called through the PowerPoint.SlideShowView object to realize page turning, and the page turning operation triggers PPT content updating;

[0033] The frame capture session automatically detects the content change of the window, and the new page is synchronized to the WPF interface when the next frame is rendered after page turning.

[0034] Optionally, the multimedia in the PPT is decoded by the PowerPoint engine, and the rendering result is captured synchronously when the window is captured, without the need of an additional decoding library;

[0035] The VML / Office animation of the PPT is calculated by the PowerPoint engine, the frame change of the capture window can be completely restored, and the delay is less than 30 ms.

[0036] The method for natively integrating and playing a PowerPoint presentation in a WPF program has the beneficial effects compared with the prior art:

[0037] The method does not need an additional player or transcoding step, can be embedded into any system environment supporting Windows GraphicsCapture, bypasses the limitation of the traditional embedded mode, realizes PPT picture injection in the mode of "window hiding + image capture", ensures smooth and native demonstration experience, supports seamless playing of multimedia content such as videos and animations, and is suitable for various scenes such as education, display and interactive system. BRIEF DESCRIPTION OF DRAWINGS

[0038] ATTACH Figure 1 is a flowchart of the method of the application. DETAILED DESCRIPTION

[0039] In order to make the technical solutions, the solved technical problems and the technical effects of the present application clearer and more apparent, the technical solutions of the present application are described clearly and completely below in combination with specific embodiments.

[0040] The following English words in the embodiments are explained.

[0041] SlideShowSettings is an object in the Microsoft.Office.Interop.PowerPoint namespace, which is part of the PowerPoint COM component, mainly used to configure and control the behavior and properties of the slide show. Through this object, developers can customize the show mode, display options, loop settings, and other parameters to achieve programmatic control of the PPT show process.

[0042] ShowControls is a boolean property of the SlideShowSettings object, used to control whether to display the native media control bar (such as the progress bar when playing a video, the pause button, or the navigation buttons when switching slides) during PPT show; when set to false, the control bar can be hidden to avoid interface elements interfering with the audience's view, suitable for scenarios that require a clean playback interface (such as public speaking, full-screen demonstration).

[0043] System.Diagnostics.Process is a process class in the.NET framework, used to obtain and manage information about system processes (such as PPT processes), such as querying the process list, starting or terminating processes, etc.

[0044] Win32API.FindWindow method is a window search method in Windows API, which obtains the handle (HWND) of the target window by class name or window title, used for subsequent window operations (such as capture, control).

[0045] SetWindowPos API is a window position setting function in Windows API, used to adjust the position, size and level of the window, which can move the window to a specified coordinate (such as the edge of the screen to achieve hidden), or modify its display order.

[0046] GraphicsCaptureItem is a class in the Windows.UI.Composition namespace, representing a graphical item that can be captured (such as a window, control or entire screen); after creating an instance through the window handle (HWND), the specific window content can be used as a capture target for screen recording, real-time sharing and other scenarios.

[0047] D3D11CreateDevice, a function in the Direct3D 11 API, is used to create a Direct3D device (ID3D11Device) and a device context (ID3D11DeviceContext).

[0048] Direct3D 11 device, a graphics device interface in the native Direct3D 11 API (such as ID3D11Device), is a core component of DirectX 11, used to create and manage GPU resources.

[0049] SharpDX object, a Direct3D 11 object encapsulated in the SharpDX library (such as SharpDX.Direct3D11.Device), is a managed wrapper of the native Direct3D API on the.NET platform, facilitating calls from languages such as C#.

[0050] Windows Runtime device, a Direct3D device interface in the Windows Runtime (WinRT) environment (such as Windows.Graphics.DirectX.Direct3D11.IDirect3DDevice), is used for UWP applications or scenarios requiring integration with WinRT.

[0051] Direct3D11CaptureFramePool, a frame pool, is used to manage a set of reusable video frame buffers, optimizing memory usage and frame processing efficiency; it is created through the CreateFreeThreaded method, allowing frame data to be processed in a background thread to avoid blocking the UI.

[0052] GraphicsCaptureSession, a session object that controls the capture process, is responsible for obtaining frame data from GraphicsCaptureItem;

[0053] IGraphicsCaptureItemInterop interface, an interoperability interface for GraphicsCaptureItem, allows the creation of GraphicsCaptureItem objects through Win3 window handles (HWND), enabling interaction between Win32 and UWP capture APIs.

[0054] CreateForWindow method, a method for creating a capture item through a window handle, takes in a handle (HWND) parameter and returns the corresponding GraphicsCaptureItem, which is used for subsequent screen content capture.

[0055] CreateDirect3D11DeviceFromDXGIDevice function, a function for creating a Direct3D 11 device from a DXGI (DirectX Graphics Infrastructure) device pointer, implementing the interface conversion between DXGI and Direct3D 11 device, so that the Windows Runtime environment can recognize and use it.

[0056] IDirect3DDxgiInterfaceAccess interface, a Direct3D device interface in Windows Runtime, used to abstract the underlying graphics hardware, supporting UWP applications to interact with Direct3D 11 devices, implementing graphics resource creation and rendering operations.

[0057] Texture2D, a two-dimensional texture, an object in Direct3D that stores 2D image data, which can be used for rendering or further processing of captured frame content.

[0058] GraphicsCaptureSession.StartCapture(), a method to start capturing image frame data from a registered target window (such as a PPT window) in real time.

[0059] FrameArrived, an event callback function triggered when a new image frame is captured, used to process the received frame data (such as rendering, saving or analyzing).

[0060] Direct3D11CaptureFrame, refers to a Direct3D 11 capture frame, containing a frame of image data captured from a target window, which can be used to obtain image content.

[0061] Surface, meaning surface, in this embodiment refers to the underlying memory buffer of an image, storing the pixel data of the captured frame, which is the basic unit of graphics processing.

[0062] ImmediateContext, immediate context, a context type of Direct3D 11 device, used to directly execute graphics commands (such as copying textures, rendering operations), which is the execution interface of GPU operations.

[0063] ShaderResource, shader resource, a flag indicating that the texture can be read by the shader (Shader), used to define the use of the texture in the rendering pipeline.

[0064] D3DImage control, a control in WPF, used to display Direct3D texture content, connecting Direct3D rendering and WPF interface.

[0065] SetBackBuffer method, refers to the method of setting the back buffer, which binds Direct3D textures (such as Texture2D) to D3DImage controls, achieving GPU-to-WPF image rendering.

[0066] BitmapSource, is the image source base class in WPF, used to represent CPU-processable image data, commonly used to store and manipulate bitmaps.

[0067] Dispatcher.Invoke, refers to the dispatcher call method, used to execute the specified operation on the UI thread, ensuring thread safety for cross-thread UI update operations, avoiding exceptions caused by thread conflicts.

[0068] SlideShowView, is a sub-object of SlideShowWindow, which helps developers to achieve full-process programmatic control of PPT presentation without manual operation, widely used in automated demonstrations, interactive kiosk systems or remote conferencing tools.

[0069] PowerPoint.SlideShowView object, is an object in the Microsoft.Office.Interop.PowerPoint namespace, representing a view instance during PPT presentation, mainly used to control the behavior of slide show, get the current presentation state, and perform operations related to the presentation (such as page turning, jumping, pausing, etc.); it is one of the core interfaces in the PowerPoint COM component that implements presentation interaction.

[0070] Example 1:

[0071] Referring to the accompanying Figure 1 , this embodiment proposes a method for native integration and playback of PowerPoint presentations in WPF programs, which includes the following steps:

[0072] S1, open the target PPT document through Microsoft.Office.Interop.PowerPoint, configure SlideShowSettings to enable presenter mode, and hide the media control window to ensure a clean playback interface. This step specifically includes:

[0073] Load the target PPT document through the Microsoft.Office.Interop.PowerPoint component, instantiate the Application object, and then call the Presentations.Open method to open the target PPT document;

[0074] Configure the SlideShowSettings property: set ShowType (play type) to

[0075] PpSlideShowType.ppSlideShowSpeaker (Speaker Show Mode) ensures full-screen playback; set the automatic or manual page turning mode through the AdvanceMode (define slide switching mode) property, and call the ShowControls property to set msoFalse to hide the PPT native media control bar.

[0076] S2, get the PPT process through System.Diagnostics.Process, and call the Win32API.FindWindow method to get the playback window handle (HWND);

[0077] Use the SetWindowPos API to perform window positioning to move the PPT playback window outside the screen edge, leaving only 1 pixel in the screen, and the specific coordinates are (1-width, 1-height), where width and height are the window width and height, so as to ensure that the PPT window is in the upper left corner of the screen, and only 1 pixel is left in the screen, realizing the window "hidden but can be captured by the system", avoiding affecting the display of the main program interface.

[0078] S3, create GraphicsCaptureItem through the PPT window handle (HWND) to register the window as a capture target; use D3D11CreateDevice to create a Direct3D 11 device and context that supports hardware acceleration and BGRA format; first convert the native Direct3D 11 device to a SharpDX object, and then to a Windows Runtime device; create a Direct3D11CaptureFramePool that supports multi-threading based on the WindowsRuntime device, and create a GraphicsCaptureSession through the Direct3D11CaptureFramePool to start capturing. This step specifically includes:

[0079] Get the activation factory of GraphicsCaptureItem through the WinRT module, which is used to create a capture item interacting with the system window; Convert the factory into an IGraphicsCaptureItemInterop interface, which allows creating a capture item through a window handle (HWND); Call the CreateForWindow method of the interface, pass in the PPT window handle (HWND) and the GUID of GraphicsCaptureItem, and get a COM pointer pointing to the capture item; Convert the COM pointer into a.NET operable GraphicsCaptureItem object to complete the binding of the window and the capture system;

[0080] Use the Device class of SharpDX to create a Direct3D 11 device in hardware acceleration mode, and enable BGRA support to be compatible with WPF display; Query the DXGI device interface from the Direct3D 11 device, which is used to interact with the Windows graphics infrastructure; Use the

[0081] CreateDirect3D11DeviceFromDXGIDevice function to create a Windows Runtime recognizable IDirect3DDevice interface; Encapsulate the native device pointer into a.NET operable IDirect3DDevice object for subsequent graphics capture operations;

[0082] Convert the Windows Runtime device into an IDirect3DDxgiInterfaceAccess interface, which allows access to the underlying DXGI device; Get a pointer to the native Direct3D 11 device through the interface accessor; Use the pointer to create a SharpDX Device object to establish a managed representation of the Direct3D 11 device;

[0083] Based on the converted Windows Runtime device, create a Direct3D11CaptureFramePool that supports multi-threading, set the pixel format to B8G8R8A8UIntNormalized to be compatible with WPF, and allocate 2 buffers (balance performance and delay) to store the captured frames; Use the SharpDX device to create a Texture2D matching the size of the capture window to store the image data extracted from the capture frame; Create a GraphicsCaptureSession for the target window through the frame capture pool, and start the session to capture the window content.

[0084] S4, the registration frame arrives event, start capture session, call StartCapture; convert the captured PPT picture frame to display resources, display through WPF Image control, so as to realize the display of real-time PPT picture in WPF program. This step specifically includes:

[0085] Call GraphicsCaptureSession.StartCapture() to start window content capture, register FrameArrived event processing function, and trigger when new frame is available;

[0086] In the event processing function: get Direct3D11CaptureFrame object and its Surface attribute, copy Surface content to the pre-created Texture2D with ShaderResource binding flag through SharpDX device ImmediateContext;

[0087] Bind Texture2D surface using D3DImage control SetBackBuffer method, realize zero-copy rendering from Direct3D to WPF, or convert Texture2D to BitmapSource, realize image data transmission from GPU to CPU through CPU copy;

[0088] Use Dispatcher.Invoke to ensure updating image source in UI thread, avoid cross-thread operation exception, bind D3DImage or BitmapSource through WPF Image control, realize real-time display.

[0089] S5, realize PPT page turning control through SlideShowView interface, including Next() and Previous(), realize complete control of presentation progress in program, specifically including:

[0090] Realize page turning by calling Next() or Previous() method through PowerPoint.SlideShowView object, page turning operation triggers PPT content update;

[0091] Frame capture session automatically detects window content change, synchronizes new page to WPF interface when rendering the next frame after page turning.

[0092] It needs to be supplemented that PPT multimedia is decoded by PowerPoint engine, and the rendering result is captured synchronously when capturing window, without additional decoding library; VML / Office animation of PPT is calculated by PowerPoint engine, and frame change of capturing window can be completely restored, with a delay usually less than 30ms.

[0093] In conclusion, the method for natively integrating and playing a PowerPoint presentation in a WPF program can efficiently embed a native PPT presentation in a WPF application and support seamless playing of multimedia content such as videos and animations, and is suitable for various scenes such as education, display and interactive system.

[0094] The principles and implementation modes of the application are described in detail above by using specific examples, and these examples are only used to help understand the core technical content of the application. Based on the above specific examples of the application, any improvement and modification of the application made by those skilled in the art without departing from the principles of the application shall fall within the patent protection scope of the application.

Claims

1. A method for natively integrating and playing PowerPoint presentations in a WPF program, characterized in that: The steps include: S1. Open the target PPT document through Microsoft.Office.Interop.PowerPoint, configure SlideShowSettings to enable speaker mode, and hide the media control window to ensure a clean playback interface; S2. Get the handle of the window and use the SetWindowPos API to move the PPT playback window outside the edge of the screen, leaving only a 1-pixel edge on the screen; S3. Create a GraphicsCaptureItem using the PPT window handle and register the window as the capture target. Use D3D11CreateDevice to create a Direct3D 11 device and context that supports hardware acceleration and BGRA format. First, convert the native Direct3D 11 device to a SharpDX object, and then to a Windows Runtime device. Create a Direct3D11CaptureFramePool that supports multithreading based on the Windows Runtime device, and use the Direct3D11CaptureFramePool to create a GraphicsCaptureSession to start capture. S4. Register the frame arrival event, start the capture session, and call StartCapture; convert the captured PPT screen frame into BitmapSource and pass it to Image for display, thereby realizing the display of real-time PPT screen in the WPF program; S5. Implement PPT page turning control through the SlideShowView interface, including Next() and Previous(), to achieve complete control over the presentation progress within the program.

2. A method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 1, characterized in that: The step S1 specifically includes: Load the target PPT document through the Microsoft.Office.Interop.PowerPoint component, instantiate the Application object and call the Presentations.Open method to open the target PPT document; Configure the SlideShowSettings property: set ShowType to PpSlideShowType.ppSlideShowSpeaker, which is the speaker presentation mode, to ensure full-screen playback; set the automatic or manual page turning mode through the AdvanceMode property, and call the ShowControls property to set it to msoFalse to hide the native media control bar of PPT.

3. The method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 1, characterized in that: Execute step S2, obtain the PPT process through System.Diagnostics.Process, and call the Win32API.FindWindow method to obtain the playback window handle.

4. A method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 3, characterized in that: Execute step S2 and use the SetWindowPos API to perform window positioning, moving the PPT playback window outside the edge of the screen, leaving only 1 pixel on the screen. The specific coordinates are (1-width, 1-height), where width and height are the window width and height. This ensures that the PPT window is in the upper left corner of the screen and only 1 pixel is left on the screen, making the window "hidden but captureable by the system" to avoid affecting the display of the main program interface.

5. The method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 1, characterized in that: The step S3 specifically includes: Obtain the activation factory of GraphicsCaptureItem through the WinRT module. This factory is used to create capture items that interact with system windows. Convert the factory to the IGraphicsCaptureItemInterop interface, which allows creation of capture items using a window handle. Call the CreateForWindow method of the interface, passing in the PPT window handle and the GraphicsCaptureItem GUID to obtain a COM pointer to the capture item. Convert the COM pointer to a .NET-operable GraphicsCaptureItem object to complete the binding between the window and the capture system. Use SharpDX's Device class to create a Direct3D 11 device in hardware acceleration mode and enable BGRA support for compatibility with WPF displays; query the DXGI device interface from the Direct3D 11 device, which is used to interact with the Windows graphics infrastructure; use the DXGI device pointer to The CreateDirect3D11DeviceFromDXGIDevice function creates an IDirect3DDevice interface recognizable by the Windows Runtime and encapsulates the native device pointer into an IDirect3DDevice object operable by .NET for subsequent graphics capture operations. Convert the Windows Runtime device to an IDirect3DDxgiInterfaceAccess interface, which allows access to the underlying DXGI device. Obtain a pointer to the native Direct3D 11 device through the interface accessor. Use this pointer to create a SharpDX Device object, establishing a managed representation of the Direct3D 11 device. Based on the converted Windows Runtime device, a Direct3D11CaptureFramePool with multi-threading support is created, the pixel format is set to B8G8R8A8UIntNormalized for compatibility with WPF, and two buffers are allocated to store the captured frames. A Texture2D matching the capture window size is created using the SharpDX device to store image data extracted from the captured frames. A GraphicsCaptureSession for the target window is created through the frame capture pool, and the session is started to capture the window content.

6. The method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 1, characterized in that: The step S4 specifically includes: Call GraphicsCaptureSession.StartCapture() to start capturing the window contents and register a FrameArrived event handler that is triggered when a new frame is available. In the event handler: Get the Direct3D11CaptureFrame object and its Surface property, and copy the Surface content to the pre-created Texture2D with the ShaderResource binding flag through the ImmediateContext of the SharpDX device; Use the SetBackBuffer method of the D3DImage control to bind the Texture2D surface to achieve zero-copy rendering from Direct3D to WPF, or convert the Texture2D to a BitmapSource and transfer the image data from the GPU to the CPU through CPU copy; Use Dispatcher.Invoke to ensure that the image source is updated on the UI thread to avoid cross-thread operation exceptions. Bind D3DImage or BitmapSource through the WPF Image control to achieve real-time display.

7. The method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 1, characterized in that: The step S5 specifically includes: Call the Next() or Previous() method of the PowerPoint.SlideShowView object to turn pages. The page turning operation triggers the update of the PPT content. The frame capture session automatically detects changes in window content and synchronizes the new page to the WPF interface when the next frame is rendered after the page is turned.

8. The method for natively integrating and playing PowerPoint presentations in a WPF program according to claim 7, characterized in that: The multimedia in PPT is decoded by the PowerPoint engine, and the rendering results are captured synchronously when the window is captured, without the need for an additional decoding library; PPT's VML / Office animations are calculated by the PowerPoint engine, and the capture window frame changes can be completely restored with a delay of less than 30ms.