Each application must support it. Notepad does. If you want your application to provide it, you must implement it. Fortunately, this is easy if you use the right tools.
Cross-platform programming platforms, such as Qt, typically have classes that encapsulate clipboard operations between platforms.
Qt , QClipboard, , setText() text(), . - .