{"id":18653081,"url":"https://github.com/pdawg-bytes/hwnd-xamlpresenter-notepad","last_synced_at":"2025-08-30T23:44:40.389Z","repository":{"id":156710523,"uuid":"574217413","full_name":"Pdawg-bytes/hwnd-xamlpresenter-notepad","owner":"Pdawg-bytes","description":"This is a Shell32.dll modification that allows you to create a XamlPresenter window that launches by clicking \"About\" in Notepad's top menu.","archived":false,"fork":false,"pushed_at":"2024-03-29T04:05:21.000Z","size":143,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T20:04:18.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pdawg-bytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-12-04T19:30:46.000Z","updated_at":"2023-07-20T17:49:30.000Z","dependencies_parsed_at":"2024-03-29T05:21:48.098Z","dependency_job_id":"f3fd9379-a0b3-4d1a-a21f-3913e5bbdce7","html_url":"https://github.com/Pdawg-bytes/hwnd-xamlpresenter-notepad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pdawg-bytes/hwnd-xamlpresenter-notepad","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pdawg-bytes%2Fhwnd-xamlpresenter-notepad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pdawg-bytes%2Fhwnd-xamlpresenter-notepad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pdawg-bytes%2Fhwnd-xamlpresenter-notepad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pdawg-bytes%2Fhwnd-xamlpresenter-notepad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pdawg-bytes","download_url":"https://codeload.github.com/Pdawg-bytes/hwnd-xamlpresenter-notepad/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pdawg-bytes%2Fhwnd-xamlpresenter-notepad/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272922274,"owners_count":25015766,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T07:09:58.117Z","updated_at":"2025-08-30T23:44:40.339Z","avatar_url":"https://github.com/Pdawg-bytes.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hwnd-xamlpresenter-notepad\nThis is a Shell32.dll modification that allows you to create a XamlPresenter window that launches by clicking \"About\" in Notepad's top menu.\n\n# What can you do?\nWith this, you can create any XAML element inside of a presenter window that launches from notepad. It can be for hiding easter eggs, like this: \n\n![image](https://user-images.githubusercontent.com/83825746/205511464-fbf2c715-3e88-47d3-a827-fdff910e4e1b.png)\n\nThis screenshot was taken in WinPE UWP, a project by me and a few other friends!\n\n# Buiilding\nTo build the modified DLL, you must have C++ installed and UWP C++ (for C++/CX support). Make sure to use Visual Studio 2022 for best results!\n\n**Important:**\nBefore you build though, you will need the internal WinMD file. This is provided in `/WinMD/Windows.UI.Xaml.Hosting.winmd`. This WinMD allows you to create the XAML presenter window. To add it into your `dllmain.cpp` file, do this:\n\n```cpp\n#using \"D:\\Source\\Git\\hwnd-xamlpresenter-notepad\\WinMD\\Windows.UI.Xaml.Hosting.winmd\" // Make sure to set the path to where ever your winmd file is! (This path is an example on my computer)\n```\n\nJust modifiy line 18 of `dllmain.cpp` and add the path to where your WinMD is saved.\n\n# Using the DLL\nTo use the DLL, you will need a custom notepad.exe. This is provided in `Binaries/notepad.exe`. Once ready, just copy your built Shell16.dll file into the same folder as the notepad binary, and it should open just fine!\n\n# Structure\nTo better understand this modification (and how you can edit it), I reccommend you read this section:\n\n**XAML Components:**\n```cpp\n    i = XamlPresenter::CreateFromHwnd((int)window);\n    i-\u003eInitializePresenter();\n    auto y = ref new Grid();\n    auto z = ref new Button();\n    z-\u003eContent = \"Hello\";\n    y-\u003eChildren-\u003eAppend(z);\n    auto h = ref new ProgressRing();\n    h-\u003eIsActive = true;\n    y-\u003eChildren-\u003eAppend(h);\n    i-\u003eContent = y;\n    EnableMouseInPointer(true);\n```\nTo create a new XAML component or edit the existing ones, this code here is how to do it. That is the example code provided in the modified DLL. To add a control, you must create an `auto` followed by the control, like this:\n```cpp\n    auto h = ref new ProgressRing();\n```\nDoing this initializes the control as an object. Now you have to set any properties for the control like this:\n```cpp\n    h-\u003eIsActive = true;\n    h-\u003eWidth = 60; // This line is not included in the source, it is just an example.\n```\nFinally, after setting all the properties for that control, end it off with\n```cpp\n    y-\u003eChildren-\u003eAppend(h);\n```\nThat's it! That's how you modify the properties of a control or create a new one.\n\n**Window Customization:**\nHere is the HWND that creates the example window:\n```cpp\nwindow = CreateWindowEx(\n        0,                              // Optional window styles.\n        CLASS_NAME,                     // Window class\n        L\"XamlPresenter\",               // Window text\n        WS_OVERLAPPEDWINDOW,            // Window style\n\n        // Size and position\n        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,\n\n        NULL,                   // Parent window    \n        NULL,                   // Menu\n        GetModuleHandle(NULL),  // Instance handle\n        NULL                    // Additional application data\n    );\n```\nTo change any properties relating to the window, (for example, title), modify the `L` property in the HWND. The title can be changed like this:\n```cpp\n        L\"Whatever you want it to be\",\n```\nYou can also change the titlebar of the window handle, but that requires redrawing your own or using internal APIs. The titlebar in the screenshot above is a custom-drawn one. The titlebar you will see in your presenter will NOT be like that, it will have the default Win32 titlebar.\nAny window customization can be done here, just look at the provided comments.\n\n**Exporting Functions:**\n\nAny function that you modifty must be defined in the `exports.def` file. In this modification, all modified shell32 functions are renamed to `Modified`+ the normal name of the function. This is needed to that shell32 will not take over the functions that are being modified.\n```\nEXPORTS\n   ShellAboutW=ModdedShellAboutW\n   DragAcceptFiles=ModdedDragAcceptFiles\n   ShellExecuteW=ModdedShellExecuteW\n   DragQueryFileW=ModdedDragQueryFileW\n   DragFinish=ModdedDragFinish\n   SHAddToRecentDocs=ModdedSHAddToRecentDocs\n```\n\nHere are the exports that are in this DLL. Any other function will need to be added here in this format: `ExistingFunctionName = ModifiedExistingFunctionName`, and each name is defined by you in the code.\n\n**That's all you need to know to modify the basic components of the window and its contents!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdawg-bytes%2Fhwnd-xamlpresenter-notepad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdawg-bytes%2Fhwnd-xamlpresenter-notepad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdawg-bytes%2Fhwnd-xamlpresenter-notepad/lists"}