windows - using the clipboard in native c++ metro app -
i'm looking interfaces allow me access clipboard in native c++ metro app - similar datatransfer::clipboard::setcontent in c#.
can please refer me interfaces , how can done using wrl library?
in wrl, need iclipboardstatics interface contains setcontent method.
#include <windows.foundation.h> #include <windows.applicationmodel.datatransfer.h> #include <wrl\wrappers\corewrappers.h> #include <wrl\client.h> using namespace abi::windows::foundation; using namespace microsoft::wrl; using namespace microsoft::wrl::wrappers; using namespace abi::windows::applicationmodel::datatransfer; // initialize windows runtime. roinitializewrapper initialize(ro_init_multithreaded); if (failed(initialize)) { cout << "failed initialize"; } comptr<iclipboardstatics> clipboard; hresult hr = getactivationfactory(hstringreference(runtimeclass_windows_applicationmodel_datatransfer_clipboard).get(), &clipboard); if (failed(hr)) { cout << "failed create runtime instance"; return 0; } comptr<idatapackage> datapackage; // create package , set data // ... clipboard->setcontent(datapackage.get());
Comments
Post a Comment