Jump to content
  • Microsoft engineer explains how even the Windows clipboard is optimized for best performance


    Karlston

    • 119 views
    • 3 minutes
     Share


    • 119 views
    • 3 minutes

    Raymond Chen, a senior Microsoft engineer, often tells interesting tales about Microsoft or Windows. For example, recently, he shared some more details about the Janet Jackson song that is officially a cyberthreat for Windows computers and how some OS features like the APO were used to protect PCs.

     

    Chen shares these stories in his The Old New Thing column on Microsoft's site and in the latest post, he has described how the Windows native clipboard is different from other clipboard managers but in a good way.

     

    For those who may not be familiar, Windows offers a default clipboard that can be enabled via the Settings app. There is a simpler way, too, by using the Win + V shortcut and then selecting the "Turn on" option.

     

    In this latest story, Chen answers a question that some of you may have noticed and wondered: "Why doesn’t Clipboard History capture rapid changes to clipboard contents?" Chen says that the asynchronous approach is actually what makes the Windows one better, at least in terms of performance, as it does not slow down the system with constant changes.

     

    Windows is able to achieve this using the AddClipboardFormatListener function and the WM_CLIPBOARDUPDATE message identifier. The former is part of the Winuser header (.h file) wherein winuser.h file helps to handle various user-side inputs like keyboard and mouse, among others. These Windows API features were introduced with Windows Vista.

     

    Explaining how all this works, Chen writes:

     

    The clipboard history service operates asynchronously. It registers for clipboard changes via AddClipboardFormatListener, and when it receives a change notification, it updates the clipboard history. The listener is notified asynchronous, however, so by the time the listener receives the WM_CLIPBOARDUPDATE message, the clipboard may have changed a second time.

     

    This is different from clipboard viewers, which are notified synchronously when the clipboard changes. The downside is that you might miss out on clipboard changes. The much better upside is that you don’t slow down or hang the clipboard.

    Thus, it looks like Microsoft has taken an approach such that even something like the clipboard has been created in a way so that it does not affect the performance of the OS. It is good to see that the company takes care of these small yet significant things in order to make Windows great.

     

    Source


    Hope you enjoyed this news post.

    Thank you for appreciating my time and effort posting news every day for many years.

    News posts... 2023: 5,800+ | 2024: 5,700+ | 2025 (till end of April): 1,811

    RIP Matrix | Farewell my friend  :sadbye:


    User Feedback

    Recommended Comments

    There are no comments to display.



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...