From fc00adf7c585cb30733e2dbdff42ebab71dabb3c Mon Sep 17 00:00:00 2001 From: Godly Alias Date: Fri, 26 Jul 2024 02:14:52 +0530 Subject: [PATCH 1/2] Added winmain background task sample Signed-off-by: Godly Alias --- .../WinMainCOMBGTaskSample.sln | 43 ++++ .../WinMainCOMBGTaskSample/App.xaml | 16 ++ .../WinMainCOMBGTaskSample/App.xaml.cpp | 79 +++++++ .../WinMainCOMBGTaskSample/App.xaml.h | 16 ++ .../Assets/LockScreenLogo.scale-200.png | Bin 0 -> 432 bytes .../Assets/SplashScreen.scale-200.png | Bin 0 -> 5372 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 0 -> 1755 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 0 -> 637 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 283 bytes .../Assets/StoreLogo.png | Bin 0 -> 456 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 0 -> 2097 bytes .../WinMainCOMBGTaskSample/MainWindow.idl | 9 + .../WinMainCOMBGTaskSample/MainWindow.xaml | 14 ++ .../MainWindow.xaml.cpp | 77 +++++++ .../WinMainCOMBGTaskSample/MainWindow.xaml.h | 28 +++ .../Package.appxmanifest | 64 ++++++ .../WinMainCOMBGTaskSample/README.md | 34 +++ .../WinMainCOMBGTaskSample/RegisterForCom.cpp | 40 ++++ .../WinMainCOMBGTaskSample/RegisterForCom.h | 14 ++ .../ToastNotificationCreator.cpp | 42 ++++ .../ToastNotificationCreator.h | 11 + .../WinMainCOMBGTaskSample/Win32BGClass.cpp | 29 +++ .../WinMainCOMBGTaskSample/Win32BGClass.h | 37 ++++ .../WinMainCOMBGTaskSample.vcxproj | 198 ++++++++++++++++++ .../WinMainCOMBGTaskSample.vcxproj.filters | 65 ++++++ .../WinMainCOMBGTaskSample/app.manifest | 19 ++ .../WinMainCOMBGTaskSample/packages.config | 7 + .../WinMainCOMBGTaskSample/pch.cpp | 1 + .../WinMainCOMBGTaskSample/pch.h | 28 +++ 29 files changed, 871 insertions(+) create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample.sln create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.cpp create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.h create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/LockScreenLogo.scale-200.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/SplashScreen.scale-200.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/Square150x150Logo.scale-200.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/Square44x44Logo.scale-200.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/StoreLogo.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/Wide310x150Logo.scale-200.png create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.idl create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.cpp create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.h create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Package.appxmanifest create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/README.md create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.cpp create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.h create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.cpp create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.h create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.cpp create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.h create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj.filters create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/app.manifest create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/packages.config create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.cpp create mode 100644 Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.h diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample.sln b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample.sln new file mode 100644 index 000000000..79cd7e31b --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35013.160 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinMainCOMBGTaskSample", "WinMainCOMBGTaskSample\WinMainCOMBGTaskSample.vcxproj", "{B1C0CFB3-FD1F-4249-81A1-CDA96129F325}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|ARM64.Build.0 = Debug|ARM64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|x64.ActiveCfg = Debug|x64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|x64.Build.0 = Debug|x64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|x64.Deploy.0 = Debug|x64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|x86.ActiveCfg = Debug|Win32 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|x86.Build.0 = Debug|Win32 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Debug|x86.Deploy.0 = Debug|Win32 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|ARM64.ActiveCfg = Release|ARM64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|ARM64.Build.0 = Release|ARM64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|ARM64.Deploy.0 = Release|ARM64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|x64.ActiveCfg = Release|x64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|x64.Build.0 = Release|x64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|x64.Deploy.0 = Release|x64 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|x86.ActiveCfg = Release|Win32 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|x86.Build.0 = Release|Win32 + {B1C0CFB3-FD1F-4249-81A1-CDA96129F325}.Release|x86.Deploy.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4F22EA65-ABA7-4D96-ACC3-25A7A023CC21} + EndGlobalSection +EndGlobal diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml new file mode 100644 index 000000000..ae8fc1ee6 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.cpp b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.cpp new file mode 100644 index 000000000..995a6958a --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.cpp @@ -0,0 +1,79 @@ +#include "pch.h" +#include "App.xaml.h" +#include "MainWindow.xaml.h" +#include "RegisterForCom.h" +#include "Win32BGClass.h" + +using namespace winrt; +using namespace Microsoft::UI::Xaml; +using namespace winrt::WinMainCOMBGTaskSample; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace winrt::WinMainCOMBGTaskSample::implementation +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + App::App() + { + // Xaml objects should not call InitializeComponent during construction. + // See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent + +#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION + UnhandledException([](IInspectable const&, UnhandledExceptionEventArgs const& e) + { + if (IsDebuggerPresent()) + { + auto errorMessage = e.Message(); + __debugbreak(); + } + }); +#endif + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + void App::OnLaunched([[maybe_unused]] LaunchActivatedEventArgs const& e) + { + window = make(); + window.Activate(); + } + +} + +int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nShowCmd) +{ + winrt::init_apartment(winrt::apartment_type::single_threaded); + OutputDebugString(L"This is command line args: "); + OutputDebugString(lpCmdLine); + + if (std::wcsncmp(lpCmdLine, RegisterForCom::RegisterForComToken, sizeof(RegisterForCom::RegisterForComToken)) == 0) + { + RegisterForCom comRegister; + comRegister.RegisterAndWait(__uuidof(Win32BGTask)); + MSG msg; + + while (-1 != GetMessage(&msg, NULL, 0, 0) && + WM_QUIT != msg.message) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + else + { + // put your fancy code somewhere here + ::winrt::Microsoft::UI::Xaml::Application::Start( + [](auto&&) + { + ::winrt::make<::winrt::WinMainCOMBGTaskSample::implementation::App>(); + }); + } + + return 0; +} \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.h b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.h new file mode 100644 index 000000000..8589e9d33 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/App.xaml.h @@ -0,0 +1,16 @@ +#pragma once + +#include "App.xaml.g.h" + +namespace winrt::WinMainCOMBGTaskSample::implementation +{ + struct App : AppT + { + App(); + + void OnLaunched(Microsoft::UI::Xaml::LaunchActivatedEventArgs const&); + + private: + winrt::Microsoft::UI::Xaml::Window window{ nullptr }; + }; +} diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/LockScreenLogo.scale-200.png b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..7440f0d4bf7c7e26e4e36328738c68e624ee851e GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(FqV6|IEGZ*x-#9g>~Mkr+x6^F zy~CDX2QIMs&Gcs3RnRBoxBA!*(Mfw0KTCYuYk0WlEIV>qBmPl! zq4ukrvfADX@#p8fbLY(H47N+k`FZ(FZh?cDro7>{8mkBO3>^oaIx`3!Jl)Qq)HI!+ z(S=1{o~eT)&W^=Ea8C`-17(Jv5(nHFJ{dOjGdxLVkY_y6&S1whfuFI4MM0kF0f&cO zPDVpV%nz;Id$>+0Ga5e9625-JcI)oq=#Pa3p^>8BB}21BUw@eN!-6@w%X+^`+Vn?! zryu|3T>kVWNBYyBc=7Y6H#s1Ah!OI_nezW zXTqOdkv2Az6KKBV=$yHdF^R3Fqw(TZEoNSZX>reXJ#bwX42%f|Pgg&ebxsLQ010xn AssI20 literal 0 HcmV?d00001 diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/SplashScreen.scale-200.png b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..32f486a86792a5e34cd9a8261b394c49b48f86be GIT binary patch literal 5372 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 literal 0 HcmV?d00001 diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/Square44x44Logo.scale-200.png b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..f713bba67f551ef91020b75716a4dc8ebd744b1c GIT binary patch literal 637 zcmeAS@N?(olHy`uVBq!ia0vp^5g^RL1|$oo8kjIJFu8cTIEGZ*dUI*J;2{SImxtDO zm%3!R$UazoY}x{$j0P5ABYXWr(l=jxJ6ps1W{tV=^>{Dl><3nv3A}sm=EZ)#l3`NR zpZda3^rNox*D1%NC98Z~L*6zipLw~Gxn&(Y-;KmJ+aR6eLabU-L#y8HW%7P-E_-VlLqIabbHPHKT*)fT@9iWJ7iWgOT9%0}Lrj>lztPxWq6sPw3pi z#-<=#$jjrP_DD*i!RLsn0mIA=>4~N)IMYWIf=j%-zuKCdMG%tHYot70D1| zvWa0wMhauW#S>1CnI_;>!1Q3zMA17@DOVq{MQ+{U7^a&yA+%dMCG;WNPV0i;w$tu; zX^b}UKziPM)(<;)ruW;-`)bBN+rQNM*Zs_>?n$|FVFo-e*PZb*@U7VAd+tHb4e?=Blc~}S6K)wL}r*Gf`BM#QB z+y>N$mCswb4d{^{S9v_!eQj4fTRMOwOCi?lSk9%<=vAz}jM-*PQtH@Odn1LZcd^j#o> hW$4xn+CT+ep9lJ{OAO?njobhL002ovPDHLkV1nYebbkN< literal 0 HcmV?d00001 diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/StoreLogo.png b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Assets/StoreLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..a4586f26bdf7841cad10f39cdffe2aca3af252c1 GIT binary patch literal 456 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2o;fF!p=8IEGZ*dUM0H=rDtTTVkd2 z(%lbKn@VS_lUaADVB&;Z6F#LM+mPsa?e>FnHo;HND^!P`-lX%BH~FOg%y&x+t*x!? zg$#_1A1kgsSvO(fw`bOmo;lrJX8byO1j^gf7qohR%mmt z@L)WX;>gqgK|tWJvQ5j;4;=gt4HXVKSMYRv5RhY5vS~TqfK_NAP*r{h!!g^BZ;w4r z7CGdsai)y;fJQc`7{Zc2b==h%o`Op$|bg6a&nL{*m7-=0>k4M4-PXlU;G-?%*(*g>iFt^ U$m#7DfHB12>FVdQ&MBb@0G`#n8vpc0sq%A~kJcD9FY~qQRMt?ZR3YyDZt}Od;|mgpc{2dv9AHF){kXU%k({ z=Y8JidEayHTkG@twPZ|U3_^%3ct-OgLSiFAqDN!|tbCX@c@?4P`2x*TMK!+Q4b?k0 ziW7!!KF6dPWcF<%I|iznM~`QJ_V7sHGV_D`dhgpA9Vd@&X}ErK+j~_rdv;Bp?OA@a zFXOk7eWOJe5NcK;6h$FaM&7JxNc#-@QTwzW6x#d_zmQNkz5) zPI;kh;3d;5UCJU+9a(cOxX(|edWoOiAEdGU#kPJ&xnc2||3vDbuhBCkj-pb0as$Zl z5;}4n=**n6(1g`JEtSy;SG6X;#-F~Oz3lESG2b5`j@wAwY4Yp<=4Xeb>iH=6aicF?DxD&q{`!&}ct zBI)aycwuobQAf&678Uf+Mmh-@9RUhyH~>?w0dixO0#jZjEc9R^=5NZw=|a(kcB?9^ zfnTiEFXp-q#B;Tn>(O%$A*ud^Rg&eVH6Y_5Y%!E39RR&s?XpG`gKwU!6FE1 z7X)DC7)*(5g}lh`4`{i~DZcWupZI`K)_4P)VE{@gc7@Xsd^86zl~_mOYH?I4!aGeX z^E(_=L6?PgveDQ+r%P@UISEXrkn`LHJZ##+!-anV>6h)IkKp;E@p8+3&(5%kS2)ld*J*rJccZM0iyaAx7+F~GW1UWFK&3X$PE1^}NH zgAG9ck5K!{07OwU@j@Do>TbH=CDEo#4m0cEyAuXy_<&jlzJVcKweSJ5 z&=q~iIn18$w8yb=rmEmHxVEUA^?RwnB?6Qlp1os8@*dWTGL2bhzZ!s*xqScR?EPL` zo(JwNdKUUYy7GtvZ3asXm)cgFvCx9EmAi;|w=a0iGiv%%VYKh`P0Wma4y`Xyx|T~( zAmfGbgbEEC7)j8b@WA@+5W3a61HJXC1dX@6_T|Czk0I0zBk%tnW~()VWITGI!`$c< gARL?UBrYYkwoDw4eo*CrzXGTrZ@;GF>596)00d&n@&Et; literal 0 HcmV?d00001 diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.idl b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.idl new file mode 100644 index 000000000..bd9c32547 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.idl @@ -0,0 +1,9 @@ +namespace WinMainCOMBGTaskSample +{ + [default_interface] + runtimeclass MainWindow : Microsoft.UI.Xaml.Window + { + MainWindow(); + Int32 MyProperty; + } +} diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml new file mode 100644 index 000000000..eb3e270e0 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.cpp b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.cpp new file mode 100644 index 000000000..a89876817 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.cpp @@ -0,0 +1,77 @@ +#include "pch.h" +#include "MainWindow.xaml.h" +#if __has_include("MainWindow.g.cpp") +#include "MainWindow.g.cpp" +#endif +#include "Win32BGClass.h" +#include "ToastNotificationCreator.h" + +using namespace winrt; +using namespace Microsoft::UI::Xaml; +namespace winrt +{ + using namespace winrt::Windows::ApplicationModel::Background; +} + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace winrt::WinMainCOMBGTaskSample::implementation +{ + int32_t MainWindow::MyProperty() + { + throw hresult_not_implemented(); + } + + void MainWindow::MyProperty(int32_t /* value */) + { + throw hresult_not_implemented(); + } + + void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&) + { + myButton().Content(box_value(L"BG Task Registered, Delete Toast Notification to trigger BG Task")); + RegisterTask(winrt::ToastNotificationHistoryChangedTrigger(), L"Win32BGTask", __uuidof(Win32BGTask), true); + ToastNotificationCreator(); + } + + + void MainWindow::UnregisterDuplicateTask(_In_ hstring taskName) + { + auto allRegistrations = BackgroundTaskRegistration::AllTasks(); + for (auto taskPair : allRegistrations) + { + IBackgroundTaskRegistration task = taskPair.Value(); + if (taskName == task.Name()) + { + task.Unregister(true); + } + } + } + + hresult MainWindow::RegisterTask(_In_ IBackgroundTrigger trigger, _In_ hstring taskName, _In_ guid classId, _In_ bool UnregisterOldTask) + { + hresult hr; + + try + { + if (UnregisterOldTask) + { + UnregisterDuplicateTask(taskName); + } + + BackgroundTaskBuilder taskBuilder; + taskBuilder.SetTrigger(trigger); + taskBuilder.Name(taskName); + taskBuilder.SetTaskEntryPointClsid(classId); + + taskBuilder.Register(); + } + catch (...) + { + hr = to_hresult(); + } + + return hr; + } +} diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.h b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.h new file mode 100644 index 000000000..882efb13d --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/MainWindow.xaml.h @@ -0,0 +1,28 @@ +#pragma once + +#include "MainWindow.g.h" + +namespace winrt::WinMainCOMBGTaskSample::implementation +{ + struct MainWindow : MainWindowT + { + MainWindow() + { + // Xaml objects should not call InitializeComponent during construction. + // See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent + } + + int32_t MyProperty(); + void MyProperty(int32_t value); + void MainWindow::UnregisterDuplicateTask(_In_ winrt::hstring taskName); + winrt::hresult MainWindow::RegisterTask(_In_ winrt::Windows::ApplicationModel::Background::IBackgroundTrigger trigger, _In_ hstring taskName, _In_ guid classId, _In_ bool UnregisterOldTask = false); + void myButton_Click(IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& args); + }; +} + +namespace winrt::WinMainCOMBGTaskSample::factory_implementation +{ + struct MainWindow : MainWindowT + { + }; +} diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Package.appxmanifest b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Package.appxmanifest new file mode 100644 index 000000000..f9d1e7cec --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Package.appxmanifest @@ -0,0 +1,64 @@ + + + + + + + + + + WinMainCOMBGTaskSample + godlyalias + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/README.md b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/README.md new file mode 100644 index 000000000..e82bd61c7 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/README.md @@ -0,0 +1,34 @@ +--- +page_type: sample +languages: +- cpp +products: +- windows +- windows-api-win32 +- windows-app-sdk +name: WinMainCOMBGTaskSample sample +urlFragment: WinMainCOMBGTaskSample +description: Demonstrates how to use register background task in a win32 application. +extendedZipContent: +- path: LICENSE +- target: LICENSE +--- + +# WinMainCOMBGTaskSample sample + +This sample application demonstrates how a **WinUI3** app can register Background Task. In this sample usage of ToastNotificationHistoryChangedTrigger is demonstrated which can be easily changed to any supported triggers. On clicking the button on the UI, background task gets registered and a toast notification will get pushed, when user deletes this toast notification background task gets triggered and push another toast notification to notify that BackgroundTask have been triggered. + +## Prerequisites + +* See [System requirements for Windows app development](https://docs.microsoft.com/windows/apps/windows-app-sdk/system-requirements). +* Make sure that your development environment is set up correctly—see [Install tools for developing apps for Windows 10 and Windows 11](https://docs.microsoft.com/windows/apps/windows-app-sdk/set-up-your-development-environment). + + +## Building and running the sample + +* Open the solution file (`.sln`) in Visual Studio. +* Press Ctrl+Shift+B, or select **Build** \> **Build Solution**. + +## Related Links + +- [Windows App SDK](https://docs.microsoft.com/windows/apps/windows-app-sdk/) diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.cpp b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.cpp new file mode 100644 index 000000000..4b47fc7e9 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.cpp @@ -0,0 +1,40 @@ +#include "pch.h" +#include "RegisterForCom.h" +#include "Win32BGClass.h" + +using namespace winrt; + +namespace winrt::WinMainCOMBGTaskSample +{ + RegisterForCom::~RegisterForCom() + { + if (ComRegistrationToken != 0) + { + CoRevokeClassObject(ComRegistrationToken); + } + } + + hresult RegisterForCom::RegisterAndWait(guid classId) + { + hresult hr; + try + { + handle _taskFactoryCompletionEvent{ CreateEvent(nullptr, false, false, nullptr) }; + com_ptr taskFactory = make(); + + check_hresult(CoRegisterClassObject(classId, + taskFactory.get(), + CLSCTX_LOCAL_SERVER, + REGCLS_MULTIPLEUSE, + &ComRegistrationToken)); + + hr = S_OK; + } + catch (...) + { + hr = to_hresult(); + } + + return hr; + } +}; \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.h b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.h new file mode 100644 index 000000000..8cc5dd816 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/RegisterForCom.h @@ -0,0 +1,14 @@ +#pragma once +#include "pch.h" + +namespace winrt::WinMainCOMBGTaskSample +{ + class RegisterForCom + { + DWORD ComRegistrationToken = 0; + public: + ~RegisterForCom(); + winrt::hresult RegisterAndWait(winrt::guid classId); + static constexpr wchar_t* RegisterForComToken = L"-RegisterForBGTaskServer"; + }; +} \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.cpp b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.cpp new file mode 100644 index 000000000..4e4dae8bb --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.cpp @@ -0,0 +1,42 @@ +#include "pch.h" +#include "ToastNotificationCreator.h" + +using namespace winrt::Windows::Data::Xml::Dom; +using namespace winrt::Windows::UI::Notifications; +namespace winrt::WinMainCOMBGTaskSample { + ToastNotificationCreator::ToastNotificationCreator(bool isBGTask) + { + // Create the toast XML template + XmlDocument toastXml; + if (isBGTask) + { + toastXml.LoadXml(LR"( + + + + Notification from BG Task + Run executed successfully! + + + )"); + } + else + { + toastXml.LoadXml(LR"( + + + + Notification from WinMainCOMBGTaskSample + Delete this notification to trigger background task. + + + )"); + } + + // Create the toast notification + ToastNotification toast(toastXml); + + // Create a ToastNotifier and show the toast + ToastNotificationManager::CreateToastNotifier().Show(toast); + } +} \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.h b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.h new file mode 100644 index 000000000..1ee6b3a0e --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/ToastNotificationCreator.h @@ -0,0 +1,11 @@ +#pragma once + + +namespace winrt::WinMainCOMBGTaskSample { + class ToastNotificationCreator + { + public: + ToastNotificationCreator(bool isBGTask = false); + }; +} + diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.cpp b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.cpp new file mode 100644 index 000000000..689c078f4 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.cpp @@ -0,0 +1,29 @@ +#include "pch.h" +#include "Win32BGClass.h" +#include "ToastNotificationCreator.h" + +using namespace winrt; +namespace winrt +{ + using namespace winrt::Windows::ApplicationModel::Background; +} + +namespace winrt::WinMainCOMBGTaskSample { + + void __stdcall Win32BGTask::Run(_In_ IBackgroundTaskInstance taskInstance) + { + taskInstance.Canceled({ this, &Win32BGTask::OnCanceled }); + + TaskDeferral = taskInstance.GetDeferral(); + ToastNotificationCreator(true); + + TaskDeferral.Complete(); + } + + void __stdcall Win32BGTask::OnCanceled(_In_ IBackgroundTaskInstance /* taskInstance */, _In_ BackgroundTaskCancellationReason /* cancelReason */) + { + OutputDebugString(L"BG Task Cancelled"); + IsCanceled = true; + } + +} \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.h b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.h new file mode 100644 index 000000000..d61d95d46 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/Win32BGClass.h @@ -0,0 +1,37 @@ +#pragma once + +#include "pch.h" + +namespace winrt::WinMainCOMBGTaskSample +{ + #define CLSID_Win32BGTask "12345678-1234-1234-1234-1234567890AB" + + + struct __declspec(uuid(CLSID_Win32BGTask)) + Win32BGTask : implements + { + volatile bool IsCanceled = false; + winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral TaskDeferral = nullptr; + void Run(_In_ winrt::Windows::ApplicationModel::Background::IBackgroundTaskInstance taskInstance); + void OnCanceled(_In_ winrt::Windows::ApplicationModel::Background::IBackgroundTaskInstance /* taskInstance */, _In_ winrt::Windows::ApplicationModel::Background::BackgroundTaskCancellationReason /* cancelReason */); + + }; + + struct Win32BGTaskFactory : implements + { + HRESULT __stdcall CreateInstance(_In_opt_ IUnknown* aggregateInterface, _In_ REFIID interfaceId, _Outptr_ VOID** object) noexcept final + { + if (aggregateInterface != NULL) { + return CLASS_E_NOAGGREGATION; + } + + return make().as(interfaceId, object); + } + + HRESULT __stdcall LockServer(BOOL lock) noexcept final + { + UNREFERENCED_PARAMETER(lock); + return S_OK; + } + }; +} diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj new file mode 100644 index 000000000..d7b8d74df --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj @@ -0,0 +1,198 @@ + + + + + + + true + true + true + {b1c0cfb3-fd1f-4249-81a1-cda96129f325} + WinMainCOMBGTaskSample + WinMainCOMBGTaskSample + + $(RootNamespace) + en-US + 16.0 + false + true + Windows Store + 10.0 + 10.0 + 10.0.17763.0 + true + true + + + + + Debug + Win32 + + + Debug + x64 + + + Debug + ARM64 + + + Release + Win32 + + + Release + x64 + + + Release + ARM64 + + + + Application + v143 + Unicode + true + + + true + true + + + false + true + false + + + + + + + + + + + Use + pch.h + $(IntDir)pch.pch + Level4 + %(AdditionalOptions) /bigobj + + + + + _DEBUG;DISABLE_XAML_GENERATED_MAIN;%(PreprocessorDefinitions) + + + + + NDEBUG;DISABLE_XAML_GENERATED_MAIN;%(PreprocessorDefinitions) + + + true + true + + + + + Designer + + + + + + + + + App.xaml + + + MainWindow.xaml + + + + + + + + + + + + Create + + + App.xaml + + + MainWindow.xaml + + + + + + + + + Code + MainWindow.xaml + + + + + false + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj.filters b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj.filters new file mode 100644 index 000000000..65974cd2a --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj.filters @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + Assets + + + + + {b1c0cfb3-fd1f-4249-81a1-cda96129f325} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/app.manifest b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/app.manifest new file mode 100644 index 000000000..7435fa74a --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/app.manifest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/packages.config b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/packages.config new file mode 100644 index 000000000..ae139661e --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.cpp b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.h b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.h new file mode 100644 index 000000000..4297a7b77 --- /dev/null +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/pch.h @@ -0,0 +1,28 @@ +#pragma once +#include +#include +#include +#include + +// Undefine GetCurrentTime macro to prevent +// conflict with Storyboard::GetCurrentTime +#undef GetCurrentTime + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "winrt/Windows.UI.Notifications.h" +#include "winrt/Windows.Data.Xml.Dom.h" From 478e6d84659227d703fff1923f8274764eb81cf4 Mon Sep 17 00:00:00 2001 From: Godly Alias Date: Fri, 26 Jul 2024 02:24:19 +0530 Subject: [PATCH 2/2] Updated platform min version Signed-off-by: Godly Alias --- .../WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj index d7b8d74df..3fb245658 100644 --- a/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj +++ b/Samples/BackgroundTask/cpp-winui/WinMainBackgroundTask/WinMainCOMBGTaskSample/WinMainCOMBGTaskSample.vcxproj @@ -22,7 +22,7 @@ Windows Store 10.0 10.0 - 10.0.17763.0 + 10.0.18362.0 true true