{"id":20217367,"url":"https://github.com/windowsnt/uwplib","last_synced_at":"2025-04-10T15:43:49.836Z","repository":{"id":80700422,"uuid":"176824613","full_name":"WindowsNT/uwplib","owner":"WindowsNT","description":"A library to use UWP controls as plain Win32 controls","archived":false,"fork":false,"pushed_at":"2020-02-04T12:17:51.000Z","size":1266,"stargazers_count":40,"open_issues_count":0,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-24T13:36:07.938Z","etag":null,"topics":["cpplusplus","uwp","win32"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WindowsNT.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-20T22:08:11.000Z","updated_at":"2025-01-27T09:47:54.000Z","dependencies_parsed_at":"2023-07-22T14:16:09.574Z","dependency_job_id":null,"html_url":"https://github.com/WindowsNT/uwplib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindowsNT%2Fuwplib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindowsNT%2Fuwplib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindowsNT%2Fuwplib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WindowsNT%2Fuwplib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WindowsNT","download_url":"https://codeload.github.com/WindowsNT/uwplib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243497,"owners_count":21071054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpplusplus","uwp","win32"],"created_at":"2024-11-14T06:33:48.129Z","updated_at":"2025-04-10T15:43:49.824Z","avatar_url":"https://github.com/WindowsNT.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A simple UWP Wrapper for Win32\n\nCodeProject article: https://www.codeproject.com/Articles/1279856/UwpAX-A-small-library-for-including-Xaml-controls\n\n# UWPLib\n\nIt's a library that allows you to use an UWP control as a HWND.\n\n1. Create an app with the attached manifest \n2. Call winrt::init_apartment(apartment_type::single_threaded); \n3. Call WindowsXamlManager::InitializeForCurrentThread();\n4. Call Register()\n5. Create windows with UWP_Custom class and use WM_SETTEXT to set the Xaml.\n6. The control returns an UWPCONTROL pointer which you can use to manipulate the IInspectable\n\n```C++\n\n\tstruct UWPCONTROL\n\t{\n\t\tDesktopWindowXamlSource xs;\n\t\tHWND hParent = 0;\n\t\tHWND hwnd = 0;\n\t\tHWND hwndDetailXamlIsland = 0;\n\t\twinrt::Windows::Foundation::IInspectable ins;\n\t};\n\n auto pv = LR\"(\u003cPivot xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n        xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" \u003e\n    \u003cPivotItem Header=\"Items\"\u003e\n            \u003cListView Name=\"GridItems\"/\u003e\n    \u003c/PivotItem\u003e\n    \u003cPivotItem Header=\"Transfers\"\u003e\n            \u003cListView Name=\"TransferItems\"/\u003e\n    \u003c/PivotItem\u003e\n    \u003cPivotItem Header=\"Add\"\u003e\n        \u003cStackPanel\u003e\n            \u003cButton x:Name=\"btn1\" Content=\"Add Files\" Margin=\"5\" Width=\"150\" /\u003e\n            \u003cButton x:Name=\"btn2\" Content=\"Add Directory\" Margin=\"5\" Width=\"150\" /\u003e\n        \u003c/StackPanel\u003e\n    \u003c/PivotItem\u003e\n    \u003cPivotItem Header=\"Upload\"\u003e\n        \u003cStackPanel\u003e\n        \u003c/StackPanel\u003e\n    \u003c/PivotItem\u003e\n    \u003cPivotItem Header=\"Configuration\"\u003e\n        \u003cStackPanel\u003e\n            \u003cTextBox Name=\"portnum\" Margin=\"5\" Header=\"Port Number\" Text=\"7001\"/\u003e\n            \u003cCheckBox Name=\"CB_RightClick\" Content=\"Enable right click\" /\u003e\n            \u003cCheckBox Name=\"CB_ForceOctetStream\" Content=\"Force MIME application/octet-stream\" /\u003e\n            \u003cTextBox x:Name=\"ip\" Margin=\"5\" Header=\"IP or Hostname (Empty = default) \" /\u003e\n        \u003c/StackPanel\u003e\n    \u003c/PivotItem\u003e\n\u003c/Pivot\u003e)\";\n\nSetWindowText(GetDlgItem(hh, 901), pv);\nUWPLIB::UWPCONTROL* u = (UWPLIB::UWPCONTROL*)SendDlgItemMessage(hh, 901, UWPM_GET_CONTROL, 0, 0);\nauto pivot = u-\u003eins.as\u003cPivot\u003e();\n...\n```\n\nAn example of a DLL that can be called from an ordinary Win32 app is also there in UWP directory. This dll exports a function that can transform a HMENU to an UWP menu and the Win32 can display it.\n\n\n![T1](https://www.codeproject.com/KB/miscctrl/1279856/u1-r-700.jpg)\n![T2](https://www.codeproject.com/KB/miscctrl/1279856/u2.jpg)\n![T3](https://www.codeproject.com/KB/miscctrl/1279856/u3.jpg)\n![T4](https://www.codeproject.com/KB/miscctrl/1279856/u4.jpg)\n![T5](https://www.codeproject.com/KB/miscctrl/1279856/u5.jpg)\n![T6](https://www.codeproject.com/KB/miscctrl/1279856/u6.jpg)\n![T7](https://www.codeproject.com/KB/miscctrl/1279856/u7.jpg)\n![T8](https://www.codeproject.com/KB/miscctrl/1279856/u8.jpg)\n![T9](https://www.codeproject.com/KB/miscctrl/1279856/u9.jpg)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindowsnt%2Fuwplib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindowsnt%2Fuwplib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindowsnt%2Fuwplib/lists"}