Win32api Clipboard Open failed

MY J 20 Reputation points
2024-11-21T01:55:47.9466667+00:00

I copy different content,and openClipboard。I found that it open failed with the content copy from some app,like windows text editor;

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,689 questions
{count} votes

Accepted answer
  1. RLWA32 46,111 Reputation points
    2024-11-23T12:40:32.33+00:00

    if the format is available, then the data must be exist.

    One possibility is that an application has not properly implemented Delayed Rendering of clipboard data. If the application uses delayed rendering but fails to provide the data upon receiving the WM_RENDERFORMAT message or the WM_RENDERALLFORMATS message then the GetClipboardData function will not return a valid HGLOBAL even though a clipboard format has been enumerated.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. RLWA32 46,111 Reputation points
    2024-11-22T10:15:42.85+00:00

    I copy different content,and openClipboard。I found that it open failed...

    The Remarks section of the documentation for OpenClipboard states "OpenClipboard fails if another window has the clipboard open." If the function fails you can call the GetOpenClipboardWindow function to identify the window holding the clipboard open or the GetClipboardOwner function if you want to identify the window/process that is the clipboard owner.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.