VirtualBox

Changeset 90054 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Jul 6, 2021 10:55:23 AM (4 years ago)
Author:
vboxsync
Message:

VBoxSharedClipboard/win: Replaced SharedClipboardWinAnnounceFormats with SharedClipboardWinClearAndAnnounceFormats that does all the necessary work. Documented hWndClipboardOwnerUs more accurately. bugref:9998

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp

    r85121 r90054  
    819819 * @param   fFormats            Clipboard format(s) to announce.
    820820 */
    821 int SharedClipboardWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats)
     821static int sharedClipboardWinAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats)
    822822{
    823823    LogFunc(("fFormats=0x%x\n", fFormats));
     
    893893}
    894894
     895/**
     896 * Opens the clipboard, clears it, announces @a fFormats and closes it.
     897 *
     898 * The actual rendering (setting) of the clipboard data will be done later with
     899 * a separate WM_RENDERFORMAT message.
     900 *
     901 * @returns VBox status code. VERR_NOT_SUPPORTED if the format is not supported / handled.
     902 * @param   pWinCtx     Windows context to use.
     903 * @param   fFormats    Clipboard format(s) to announce.
     904 * @param   hWnd        The window handle to use as owner.
     905 */
     906int SharedClipboardWinClearAndAnnounceFormats(PSHCLWINCTX pWinCtx, SHCLFORMATS fFormats, HWND hWnd)
     907{
     908    int rc = SharedClipboardWinOpen(hWnd);
     909    if (RT_SUCCESS(rc))
     910    {
     911        SharedClipboardWinClear();
     912
     913        rc = sharedClipboardWinAnnounceFormats(pWinCtx, fFormats);
     914        Assert(pWinCtx->hWndClipboardOwnerUs == hWnd || pWinCtx->hWndClipboardOwnerUs == NULL);
     915
     916        SharedClipboardWinClose();
     917    }
     918    return rc;
     919}
     920
    895921#ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
     922
    896923/**
    897924 * Creates an Shared Clipboard transfer by announcing transfer data  (via IDataObject) to Windows.
     
    12081235    return rc;
    12091236}
     1237
    12101238#endif /* VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS */
    12111239
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette