├── .gitattributes
├── .gitignore
├── README.md
├── UWP_FullTrust_1
├── FullTrust
│ ├── App.config
│ ├── FullTrust.csproj
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── Package
│ ├── Assets
│ │ ├── LargeTile.scale-100.png
│ │ ├── LargeTile.scale-200.png
│ │ ├── SmallTile.scale-100.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.targetsize-16.png
│ │ ├── Square44x44Logo.targetsize-48.png
│ │ ├── StoreLogo.scale-100.png
│ │ ├── StoreLogo.scale-200.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ └── Wide310x150Logo.scale-200.png
│ ├── Package.appxmanifest
│ ├── Package.wapproj
│ └── Package.xml
├── README.md
├── UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── Unused_Square150x150Logo.scale-200.png
│ │ ├── Unused_Square44x44Logo.scale-200.png
│ │ ├── Unused_Square44x44Logo.targetsize-24_altform-unplated.png
│ │ └── Unused_StoreLogo.png
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── UWP.csproj
└── UWP_FullTrust_1.sln
├── UWP_FullTrust_2
├── FullTrust_Background
│ ├── App.config
│ ├── FullTrust_Background.csproj
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── FullTrust_WPF
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── FullTrust_WPF.csproj
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
├── FullTrust_Win32
│ ├── FullTrust_Win32.cpp
│ ├── FullTrust_Win32.h
│ ├── FullTrust_Win32.ico
│ ├── FullTrust_Win32.rc
│ ├── FullTrust_Win32.vcxproj
│ ├── FullTrust_Win32.vcxproj.filters
│ ├── Resource.h
│ ├── small.ico
│ ├── stdafx.cpp
│ ├── stdafx.h
│ └── targetver.h
├── FullTrust_WindowsForms
│ ├── App.config
│ ├── Form1.Designer.cs
│ ├── Form1.cs
│ ├── Form1.resx
│ ├── FullTrust_WindowsForms.csproj
│ ├── Program.cs
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
├── Launcher
│ ├── App.config
│ ├── Launcher.csproj
│ ├── Program.cs
│ └── Properties
│ │ └── AssemblyInfo.cs
├── Package
│ ├── Assets
│ │ ├── LargeTile.scale-100.png
│ │ ├── LargeTile.scale-200.png
│ │ ├── SmallTile.scale-100.png
│ │ ├── SmallTile.scale-200.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.targetsize-16.png
│ │ ├── Square44x44Logo.targetsize-48.png
│ │ ├── StoreLogo.scale-100.png
│ │ ├── StoreLogo.scale-200.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ └── Wide310x150Logo.scale-200.png
│ ├── Package.appxmanifest
│ ├── Package.wapproj
│ └── Package.xml
├── README.md
├── UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── Unused_Square150x150Logo.scale-200.png
│ │ ├── Unused_Square44x44Logo.scale-200.png
│ │ ├── Unused_Square44x44Logo.targetsize-24_altform-unplated.png
│ │ └── Unused_StoreLogo.png
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── UWP.csproj
└── UWP_FullTrust_2.sln
└── UWP_FullTrust_3
├── FullTrust
├── App.config
├── App.xaml
├── App.xaml.cs
├── FullTrust.csproj
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
└── SingleInstance.cs
├── Package
├── Assets
│ ├── LargeTile.scale-100.png
│ ├── LargeTile.scale-200.png
│ ├── SmallTile.scale-100.png
│ ├── SmallTile.scale-200.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-200.png
│ ├── Square150x150Logo.scale-100.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square44x44Logo.altform-unplated_targetsize-16.png
│ ├── Square44x44Logo.altform-unplated_targetsize-48.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.targetsize-16.png
│ ├── Square44x44Logo.targetsize-48.png
│ ├── StoreLogo.scale-100.png
│ ├── StoreLogo.scale-200.png
│ ├── Wide310x150Logo.scale-100.png
│ └── Wide310x150Logo.scale-200.png
├── Package.appxmanifest
├── Package.wapproj
└── Package.xml
├── README.md
├── UWP
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── Unused_Square150x150Logo.scale-200.png
│ ├── Unused_Square44x44Logo.scale-200.png
│ ├── Unused_Square44x44Logo.targetsize-24_altform-unplated.png
│ └── Unused_StoreLogo.png
├── MainPage.xaml
├── MainPage.xaml.cs
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
└── UWP.csproj
└── UWP_FullTrust_3.sln
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UWP with Desktop Extension Tutorial
2 |
3 | Sharing the code for the tutorial from my blog: https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/
4 |
5 | You will need the following setup to run these projects:
6 | - Windows 10 build 16299 or later
7 | - Windows SDK build 16299
8 | - Visual Studio 2017 Update 5 or later
9 |
10 | To Build/Deploy and Run the sample projects see the read.me for each individual project:
11 |
12 | - Part 1 - Hello World (MS Store: https://www.microsoft.com/store/apps/9ND9W9HWSWNS)
13 | - Part 2 - Launching multiple processes, passing in launch arguments (MS Store: https://www.microsoft.com/store/apps/9PLMLGKSCZQW)
14 | - Part 3 - Communication between UWP and Desktop code (MS Store: https://www.microsoft.com/store/apps/9NR0G35Q2F65)
15 |
16 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/FullTrust/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/FullTrust/FullTrust.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}
8 | Exe
9 | FullTrust
10 | FullTrust
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/FullTrust/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace FullTrust
8 | {
9 | class Program
10 | {
11 | static void Main(string[] args)
12 | {
13 | Console.Title = "Hello World";
14 | Console.WriteLine("This process runs at the full privileges of the user and has access to the entire public desktop API surface");
15 | Console.WriteLine("\r\nPress any key to exit ...");
16 | Console.ReadLine();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/FullTrust/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FullTrust")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FullTrust")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("78822bee-fe4f-4f79-8148-eeaff8d00915")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/Package/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UWP Desktop Extension Sample 1
6 | Stefan Wick
7 | Assets\StoreLogo.png
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/Package/Package.wapproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 |
6 |
7 |
8 | Debug
9 | x86
10 |
11 |
12 | Release
13 | x86
14 |
15 |
16 | Debug
17 | x64
18 |
19 |
20 | Release
21 | x64
22 |
23 |
24 | Debug
25 | AnyCPU
26 |
27 |
28 | Release
29 | AnyCPU
30 |
31 |
32 | Debug
33 | ARM
34 |
35 |
36 | Release
37 | ARM
38 |
39 |
40 |
41 | $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
42 |
43 |
44 |
45 | 3077591f-c010-4f98-9811-125233f93da9
46 | 10.0.16299.0
47 | 10.0.14393.0
48 | en-US
49 | Package_StoreKey.pfx
50 | ..\UWP\UWP.csproj
51 | FDF9AB29DF3EA3C7FEC1556B17B9B785A635A80B
52 | True
53 | x86|x64|arm
54 |
55 |
56 | Always
57 |
58 |
59 | Always
60 |
61 |
62 | Always
63 |
64 |
65 | Always
66 |
67 |
68 | Always
69 |
70 |
71 | Always
72 |
73 |
74 |
75 | Designer
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/README.md:
--------------------------------------------------------------------------------
1 | # UWP with Desktop Extension Tutorial - Part 1
2 |
3 | Sharing the code for the tutorial from my blog: https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/
4 |
5 | This sample app can also be downloaded from the Microsoft Store:
6 | https://www.microsoft.com/store/apps/9ND9W9HWSWNS
7 |
8 | You will need the following setup to run these projects:
9 | - Windows 10 build 16299 or later
10 | - Windows SDK build 16299
11 | - Visual Studio 2017 Update 5 or later
12 |
13 |
14 | Build/Deploy and Run the sample
15 | -------------------------------
16 | - Set "Package" project as Startup project in VS solution explorer
17 | - Select x86 or x64 platform (change from AnyCPU)
18 | - Press F5 to run!
19 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Navigation;
17 |
18 | namespace UWP
19 | {
20 | ///
21 | /// Provides application-specific behavior to supplement the default Application class.
22 | ///
23 | sealed partial class App : Application
24 | {
25 | ///
26 | /// Initializes the singleton application object. This is the first line of authored code
27 | /// executed, and as such is the logical equivalent of main() or WinMain().
28 | ///
29 | public App()
30 | {
31 | this.InitializeComponent();
32 | this.Suspending += OnSuspending;
33 | }
34 |
35 | ///
36 | /// Invoked when the application is launched normally by the end user. Other entry points
37 | /// will be used such as when the application is launched to open a specific file.
38 | ///
39 | /// Details about the launch request and process.
40 | protected override void OnLaunched(LaunchActivatedEventArgs e)
41 | {
42 | Frame rootFrame = Window.Current.Content as Frame;
43 |
44 | // Do not repeat app initialization when the Window already has content,
45 | // just ensure that the window is active
46 | if (rootFrame == null)
47 | {
48 | // Create a Frame to act as the navigation context and navigate to the first page
49 | rootFrame = new Frame();
50 |
51 | rootFrame.NavigationFailed += OnNavigationFailed;
52 |
53 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
54 | {
55 | //TODO: Load state from previously suspended application
56 | }
57 |
58 | // Place the frame in the current Window
59 | Window.Current.Content = rootFrame;
60 | }
61 |
62 | if (e.PrelaunchActivated == false)
63 | {
64 | if (rootFrame.Content == null)
65 | {
66 | // When the navigation stack isn't restored navigate to the first page,
67 | // configuring the new page by passing required information as a navigation
68 | // parameter
69 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
70 | }
71 | // Ensure the current window is active
72 | Window.Current.Activate();
73 | }
74 | }
75 |
76 | ///
77 | /// Invoked when Navigation to a certain page fails
78 | ///
79 | /// The Frame which failed navigation
80 | /// Details about the navigation failure
81 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
82 | {
83 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
84 | }
85 |
86 | ///
87 | /// Invoked when application execution is being suspended. Application state is saved
88 | /// without knowing whether the application will be terminated or resumed with the contents
89 | /// of memory still intact.
90 | ///
91 | /// The source of the suspend request.
92 | /// Details about the suspend request.
93 | private void OnSuspending(object sender, SuspendingEventArgs e)
94 | {
95 | var deferral = e.SuspendingOperation.GetDeferral();
96 | //TODO: Save application state and stop any background activity
97 | deferral.Complete();
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Assets/Unused_Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/UWP/Assets/Unused_Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Assets/Unused_Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/UWP/Assets/Unused_Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Assets/Unused_Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/UWP/Assets/Unused_Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Assets/Unused_StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_1/UWP/Assets/Unused_StoreLogo.png
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.Foundation;
8 | using Windows.Foundation.Collections;
9 | using Windows.Foundation.Metadata;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Navigation;
17 |
18 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
19 |
20 | namespace UWP
21 | {
22 | ///
23 | /// An empty page that can be used on its own or navigated to within a Frame.
24 | ///
25 | public sealed partial class MainPage : Page
26 | {
27 | public MainPage()
28 | {
29 | this.InitializeComponent();
30 | }
31 |
32 | private async void Button_Click(object sender, RoutedEventArgs e)
33 | {
34 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
35 | {
36 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | UWP
7 | swick
8 | Assets\Unused_StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP/UWP.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x86
7 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}
8 | AppContainerExe
9 | Properties
10 | UWP
11 | UWP
12 | en-US
13 | UAP
14 | 10.0.16299.0
15 | 10.0.14393.0
16 | 14
17 | 512
18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
19 | true
20 | UWP_TemporaryKey.pfx
21 |
22 |
23 | true
24 | bin\x86\Debug\
25 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
26 | ;2008
27 | full
28 | x86
29 | false
30 | prompt
31 | true
32 |
33 |
34 | bin\x86\Release\
35 | TRACE;NETFX_CORE;WINDOWS_UWP
36 | true
37 | ;2008
38 | pdbonly
39 | x86
40 | false
41 | prompt
42 | true
43 | true
44 |
45 |
46 | true
47 | bin\ARM\Debug\
48 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
49 | ;2008
50 | full
51 | ARM
52 | false
53 | prompt
54 | true
55 |
56 |
57 | bin\ARM\Release\
58 | TRACE;NETFX_CORE;WINDOWS_UWP
59 | true
60 | ;2008
61 | pdbonly
62 | ARM
63 | false
64 | prompt
65 | true
66 | true
67 |
68 |
69 | true
70 | bin\x64\Debug\
71 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
72 | ;2008
73 | full
74 | x64
75 | false
76 | prompt
77 | true
78 |
79 |
80 | bin\x64\Release\
81 | TRACE;NETFX_CORE;WINDOWS_UWP
82 | true
83 | ;2008
84 | pdbonly
85 | x64
86 | false
87 | prompt
88 | true
89 | true
90 |
91 |
92 | PackageReference
93 |
94 |
95 |
96 | App.xaml
97 |
98 |
99 | MainPage.xaml
100 |
101 |
102 |
103 |
104 |
105 | Designer
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | MSBuild:Compile
119 | Designer
120 |
121 |
122 | MSBuild:Compile
123 | Designer
124 |
125 |
126 |
127 |
128 | 6.0.8
129 |
130 |
131 |
132 |
133 | Windows Desktop Extensions for the UWP
134 |
135 |
136 |
137 | 14.0
138 |
139 |
140 |
147 |
--------------------------------------------------------------------------------
/UWP_FullTrust_1/UWP_FullTrust_1.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27428.2005
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWP", "UWP\UWP.csproj", "{3576D733-5DE4-4F3E-91B7-63B1D615E508}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915} = {78822BEE-FE4F-4F79-8148-EEAFF8D00915}
9 | EndProjectSection
10 | EndProject
11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FullTrust", "FullTrust\FullTrust.csproj", "{78822BEE-FE4F-4F79-8148-EEAFF8D00915}"
12 | EndProject
13 | Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Package", "Package\Package.wapproj", "{3077591F-C010-4F98-9811-125233F93DA9}"
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Debug|ARM = Debug|ARM
19 | Debug|x64 = Debug|x64
20 | Debug|x86 = Debug|x86
21 | Release|Any CPU = Release|Any CPU
22 | Release|ARM = Release|ARM
23 | Release|x64 = Release|x64
24 | Release|x86 = Release|x86
25 | EndGlobalSection
26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
27 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|Any CPU.ActiveCfg = Debug|x86
28 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|ARM.ActiveCfg = Debug|ARM
29 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|ARM.Build.0 = Debug|ARM
30 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|x64.ActiveCfg = Debug|x64
31 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|x64.Build.0 = Debug|x64
32 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|x86.ActiveCfg = Debug|x86
33 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Debug|x86.Build.0 = Debug|x86
34 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|Any CPU.ActiveCfg = Release|x86
35 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|ARM.ActiveCfg = Release|ARM
36 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|ARM.Build.0 = Release|ARM
37 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|x64.ActiveCfg = Release|x64
38 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|x64.Build.0 = Release|x64
39 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|x86.ActiveCfg = Release|x86
40 | {3576D733-5DE4-4F3E-91B7-63B1D615E508}.Release|x86.Build.0 = Release|x86
41 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|Any CPU.Build.0 = Debug|Any CPU
43 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|ARM.ActiveCfg = Debug|Any CPU
44 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|ARM.Build.0 = Debug|Any CPU
45 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|x64.ActiveCfg = Debug|Any CPU
46 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|x64.Build.0 = Debug|Any CPU
47 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|x86.ActiveCfg = Debug|Any CPU
48 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Debug|x86.Build.0 = Debug|Any CPU
49 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|Any CPU.ActiveCfg = Release|Any CPU
50 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|Any CPU.Build.0 = Release|Any CPU
51 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|ARM.ActiveCfg = Release|Any CPU
52 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|ARM.Build.0 = Release|Any CPU
53 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|x64.ActiveCfg = Release|Any CPU
54 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|x64.Build.0 = Release|Any CPU
55 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|x86.ActiveCfg = Release|Any CPU
56 | {78822BEE-FE4F-4F79-8148-EEAFF8D00915}.Release|x86.Build.0 = Release|Any CPU
57 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
59 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
60 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|ARM.ActiveCfg = Debug|ARM
61 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|ARM.Build.0 = Debug|ARM
62 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|ARM.Deploy.0 = Debug|ARM
63 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|x64.ActiveCfg = Debug|x64
64 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|x64.Build.0 = Debug|x64
65 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|x64.Deploy.0 = Debug|x64
66 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|x86.ActiveCfg = Debug|x86
67 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|x86.Build.0 = Debug|x86
68 | {3077591F-C010-4F98-9811-125233F93DA9}.Debug|x86.Deploy.0 = Debug|x86
69 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
70 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|Any CPU.Build.0 = Release|Any CPU
71 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|Any CPU.Deploy.0 = Release|Any CPU
72 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|ARM.ActiveCfg = Release|ARM
73 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|ARM.Build.0 = Release|ARM
74 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|ARM.Deploy.0 = Release|ARM
75 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|x64.ActiveCfg = Release|x64
76 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|x64.Build.0 = Release|x64
77 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|x64.Deploy.0 = Release|x64
78 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|x86.ActiveCfg = Release|x86
79 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|x86.Build.0 = Release|x86
80 | {3077591F-C010-4F98-9811-125233F93DA9}.Release|x86.Deploy.0 = Release|x86
81 | EndGlobalSection
82 | GlobalSection(SolutionProperties) = preSolution
83 | HideSolutionNode = FALSE
84 | EndGlobalSection
85 | GlobalSection(ExtensibilityGlobals) = postSolution
86 | SolutionGuid = {E7FC2A0A-FA91-4950-B4F3-4D760FB2E416}
87 | EndGlobalSection
88 | EndGlobal
89 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Background/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Background/FullTrust_Background.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {FFBB3D28-662D-42E2-9F29-546D6F5AD5B9}
8 | WinExe
9 | FullTrust_Background
10 | FullTrust_Background
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Background/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace FullTrust_Background
9 | {
10 | class Program
11 | {
12 | static AutoResetEvent done = new AutoResetEvent(false);
13 | static void Main(string[] args)
14 | {
15 | Thread bgThread = new Thread(ThreadProc);
16 | bgThread.Start(done);
17 | done.WaitOne();
18 | }
19 |
20 | static void ThreadProc(object unused)
21 | {
22 | // keep this up ofr 60sec, just for demo purposes
23 | Thread.Sleep(60000);
24 | done.Set();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Background/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FullTrust_Background")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FullTrust_Background")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("ffbb3d28-662d-42e2-9f29-546d6f5ad5b9")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace FullTrust_WPF
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/FullTrust_WPF.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {61B2AB7C-732C-4A3D-81FC-613F9F317330}
8 | WinExe
9 | FullTrust_WPF
10 | FullTrust_WPF
11 | v4.6.1
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | 4.0
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | MSBuild:Compile
55 | Designer
56 |
57 |
58 | MSBuild:Compile
59 | Designer
60 |
61 |
62 | App.xaml
63 | Code
64 |
65 |
66 | MainWindow.xaml
67 | Code
68 |
69 |
70 |
71 |
72 | Code
73 |
74 |
75 | True
76 | True
77 | Resources.resx
78 |
79 |
80 | True
81 | Settings.settings
82 | True
83 |
84 |
85 | ResXFileCodeGenerator
86 | Resources.Designer.cs
87 |
88 |
89 | SettingsSingleFileGenerator
90 | Settings.Designer.cs
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace FullTrust_WPF
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 |
27 | // display command line parameters, if any
28 | string[] args = Environment.GetCommandLineArgs();
29 | if (args.Length > 1)
30 | {
31 | List parameters = new List();
32 | for (int i=1; iCultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FullTrust_WPF.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FullTrust_WPF.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FullTrust_WPF.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WPF/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.cpp
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.h
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.ico
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.rc
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/FullTrust_Win32.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 | Header Files
26 |
27 |
28 | Header Files
29 |
30 |
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 |
40 |
41 | Resource Files
42 |
43 |
44 |
45 |
46 | Resource Files
47 |
48 |
49 | Resource Files
50 |
51 |
52 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/Resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/Resource.h
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/small.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/small.ico
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/stdafx.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/stdafx.cpp
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/stdafx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/stdafx.h
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_Win32/targetver.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/FullTrust_Win32/targetver.h
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FullTrust_WindowsForms
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.SuspendLayout();
32 | //
33 | // Form1
34 | //
35 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
37 | this.ClientSize = new System.Drawing.Size(800, 450);
38 | this.Name = "Form1";
39 | this.Text = "Desktop Process (Windows Forms)";
40 | this.ResumeLayout(false);
41 |
42 | }
43 |
44 | #endregion
45 | }
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace FullTrust_WindowsForms
12 | {
13 | public partial class Form1 : Form
14 | {
15 | public Form1()
16 | {
17 | InitializeComponent();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/FullTrust_WindowsForms.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {286DE3E4-61A2-4A37-9302-8B11646301B8}
8 | WinExe
9 | FullTrust_WindowsForms
10 | FullTrust_WindowsForms
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | Form
50 |
51 |
52 | Form1.cs
53 |
54 |
55 |
56 |
57 | Form1.cs
58 |
59 |
60 | ResXFileCodeGenerator
61 | Resources.Designer.cs
62 | Designer
63 |
64 |
65 | True
66 | Resources.resx
67 |
68 |
69 | SettingsSingleFileGenerator
70 | Settings.Designer.cs
71 |
72 |
73 | True
74 | Settings.settings
75 | True
76 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace FullTrust_WindowsForms
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FullTrust_WindowsForms")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FullTrust_WindowsForms")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("286de3e4-61a2-4a37-9302-8b11646301b8")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FullTrust_WindowsForms.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FullTrust_WindowsForms.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FullTrust_WindowsForms.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/FullTrust_WindowsForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Launcher/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Launcher/Launcher.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {901A731E-A00D-4AC8-A247-C7BDA2BB3C3E}
8 | WinExe
9 | Launcher
10 | Launcher
11 | v4.6.1
12 | 512
13 | true
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | False
42 | ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | ..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0\Windows.winmd
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Launcher/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Linq;
5 | using System.Reflection;
6 | using System.Text;
7 | using System.Threading;
8 | using System.Threading.Tasks;
9 | using Windows.Storage;
10 |
11 | namespace Launcher
12 | {
13 | class Program
14 | {
15 | static void Main(string[] args)
16 | {
17 | // determine the package root, based on own location
18 | string result = Assembly.GetExecutingAssembly().Location;
19 | int index = result.LastIndexOf("\\");
20 | string rootPath = $"{result.Substring(0, index)}\\..\\";
21 |
22 | // process object to keep track of your child process
23 | Process newProcess = null;
24 |
25 | if (args.Length > 2)
26 | {
27 | // launch process based on parameter
28 | switch (args[2])
29 | {
30 | case "/background":
31 | newProcess = Process.Start(rootPath + @"FullTrust_Background\FullTrust_Background.exe");
32 | break;
33 | case "/wpf":
34 | newProcess = Process.Start(rootPath + @"FullTrust_WPF\FullTrust_WPF.exe");
35 | break;
36 | case "/winforms":
37 | newProcess = Process.Start(rootPath + @"FullTrust_WindowsForms\FullTrust_WindowsForms.exe");
38 | break;
39 | case "/win32":
40 | newProcess = Process.Start(rootPath + @"FullTrust_Win32\FullTrust_Win32.exe");
41 | break;
42 | case "/mstsc":
43 | Process.Start(@"mstsc.exe");
44 | break;
45 | case "/parameters":
46 | string parameters = ApplicationData.Current.LocalSettings.Values["parameters"] as string;
47 | newProcess = Process.Start(rootPath + @"FullTrust_WPF\FullTrust_WPF.exe", parameters);
48 | break;
49 | }
50 | }
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Launcher/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Launcher")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Launcher")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("901a731e-a00d-4ac8-a247-c7bda2bb3c3e")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/Package/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UWP Desktop Extension Sample 2
6 | Stefan Wick
7 | Assets\StoreLogo.png
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/Package/Package.wapproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 |
6 |
7 |
8 | Debug
9 | x86
10 |
11 |
12 | Release
13 | x86
14 |
15 |
16 | Debug
17 | x64
18 |
19 |
20 | Release
21 | x64
22 |
23 |
24 | Debug
25 | AnyCPU
26 |
27 |
28 | Release
29 | AnyCPU
30 |
31 |
32 |
33 | $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
34 |
35 |
36 |
37 | 8b6a07b4-263a-4923-a53f-2f67fe8ab587
38 | 10.0.16299.0
39 | 10.0.14393.0
40 | en-US
41 | Package_StoreKey.pfx
42 | ..\UWP\UWP.csproj
43 | True
44 | x86|x64
45 | 87B79ED88134B4E2EE229D9EC1B393C4BAA73333
46 |
47 |
48 | Always
49 |
50 |
51 | Always
52 |
53 |
54 | Always
55 |
56 |
57 | Always
58 |
59 |
60 | Always
61 |
62 |
63 | Always
64 |
65 |
66 |
67 | Designer
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/README.md:
--------------------------------------------------------------------------------
1 | # UWP with Desktop Extension Tutorial - Part 2
2 |
3 | Sharing the code for the tutorial from my blog: https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-2/
4 |
5 | This sample app can also be downloaded from the Microsoft Store:
6 | https://www.microsoft.com/store/apps/9PLMLGKSCZQW
7 |
8 | You will need the following setup to run these projects:
9 | - Windows 10 build 16299 or later
10 | - Windows SDK build 16299
11 | - Visual Studio 2017 Update 5 or later
12 |
13 |
14 | Build/Deploy and Run the sample
15 | -------------------------------
16 | - Set "Package" project as Startup project in VS solution explorer
17 | - Select x86 or x64 platform (change from AnyCPU)
18 | - Press F5 to run!
19 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Navigation;
17 |
18 | namespace UWP
19 | {
20 | ///
21 | /// Provides application-specific behavior to supplement the default Application class.
22 | ///
23 | sealed partial class App : Application
24 | {
25 | ///
26 | /// Initializes the singleton application object. This is the first line of authored code
27 | /// executed, and as such is the logical equivalent of main() or WinMain().
28 | ///
29 | public App()
30 | {
31 | this.InitializeComponent();
32 | this.Suspending += OnSuspending;
33 | }
34 |
35 | ///
36 | /// Invoked when the application is launched normally by the end user. Other entry points
37 | /// will be used such as when the application is launched to open a specific file.
38 | ///
39 | /// Details about the launch request and process.
40 | protected override void OnLaunched(LaunchActivatedEventArgs e)
41 | {
42 | Frame rootFrame = Window.Current.Content as Frame;
43 |
44 | // Do not repeat app initialization when the Window already has content,
45 | // just ensure that the window is active
46 | if (rootFrame == null)
47 | {
48 | // Create a Frame to act as the navigation context and navigate to the first page
49 | rootFrame = new Frame();
50 |
51 | rootFrame.NavigationFailed += OnNavigationFailed;
52 |
53 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
54 | {
55 | //TODO: Load state from previously suspended application
56 | }
57 |
58 | // Place the frame in the current Window
59 | Window.Current.Content = rootFrame;
60 | }
61 |
62 | if (e.PrelaunchActivated == false)
63 | {
64 | if (rootFrame.Content == null)
65 | {
66 | // When the navigation stack isn't restored navigate to the first page,
67 | // configuring the new page by passing required information as a navigation
68 | // parameter
69 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
70 | }
71 | // Ensure the current window is active
72 | Window.Current.Activate();
73 | }
74 | }
75 |
76 | ///
77 | /// Invoked when Navigation to a certain page fails
78 | ///
79 | /// The Frame which failed navigation
80 | /// Details about the navigation failure
81 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
82 | {
83 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
84 | }
85 |
86 | ///
87 | /// Invoked when application execution is being suspended. Application state is saved
88 | /// without knowing whether the application will be terminated or resumed with the contents
89 | /// of memory still intact.
90 | ///
91 | /// The source of the suspend request.
92 | /// Details about the suspend request.
93 | private void OnSuspending(object sender, SuspendingEventArgs e)
94 | {
95 | var deferral = e.SuspendingOperation.GetDeferral();
96 | //TODO: Save application state and stop any background activity
97 | deferral.Complete();
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Assets/Unused_Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/UWP/Assets/Unused_Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Assets/Unused_Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/UWP/Assets/Unused_Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Assets/Unused_Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/UWP/Assets/Unused_Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Assets/Unused_StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_2/UWP/Assets/Unused_StoreLogo.png
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.Foundation;
8 | using Windows.Foundation.Collections;
9 | using Windows.Foundation.Metadata;
10 | using Windows.Storage;
11 | using Windows.UI.Xaml;
12 | using Windows.UI.Xaml.Controls;
13 | using Windows.UI.Xaml.Controls.Primitives;
14 | using Windows.UI.Xaml.Data;
15 | using Windows.UI.Xaml.Input;
16 | using Windows.UI.Xaml.Media;
17 | using Windows.UI.Xaml.Navigation;
18 |
19 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
20 |
21 | namespace UWP
22 | {
23 | ///
24 | /// An empty page that can be used on its own or navigated to within a Frame.
25 | ///
26 | public sealed partial class MainPage : Page
27 | {
28 | public MainPage()
29 | {
30 | this.InitializeComponent();
31 | }
32 |
33 | private async void btnClick_WPF(object sender, RoutedEventArgs e)
34 | {
35 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
36 | {
37 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("WPF");
38 | }
39 | }
40 |
41 | private async void btnClick_WinForms(object sender, RoutedEventArgs e)
42 | {
43 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
44 | {
45 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("WinForms");
46 | }
47 | }
48 |
49 | private async void btnClick_Win32(object sender, RoutedEventArgs e)
50 | {
51 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
52 | {
53 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Win32");
54 | }
55 | }
56 |
57 | private async void btnClick_Background(object sender, RoutedEventArgs e)
58 | {
59 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
60 | {
61 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Background");
62 | }
63 | }
64 |
65 | private async void btnClick_System(object sender, RoutedEventArgs e)
66 | {
67 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
68 | {
69 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("RemoteDesktop");
70 | }
71 | }
72 |
73 | private async void btnClick_Parameters(object sender, RoutedEventArgs e)
74 | {
75 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
76 | {
77 | // store command line parameters in local settings
78 | // so the Lancher can retrieve them and pass them on
79 | ApplicationData.Current.LocalSettings.Values["parameters"] = tbParameters.Text;
80 |
81 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync("Parameters");
82 | }
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | UWP
18 | swick
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/UWP_FullTrust_2/UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace FullTrust
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/FullTrust.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}
8 | WinExe
9 | FullTrust
10 | FullTrust
11 | v4.6.1
12 | 512
13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 4
15 | true
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 | FullTrust.App
38 |
39 |
40 |
41 |
42 |
43 |
44 | False
45 | ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | 4.0
55 |
56 |
57 | ..\..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0\Windows.winmd
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | MSBuild:Compile
66 | Designer
67 |
68 |
69 | MSBuild:Compile
70 | Designer
71 |
72 |
73 | App.xaml
74 | Code
75 |
76 |
77 | MainWindow.xaml
78 | Code
79 |
80 |
81 |
82 |
83 | Code
84 |
85 |
86 | True
87 | True
88 | Resources.resx
89 |
90 |
91 | True
92 | Settings.settings
93 | True
94 |
95 |
96 | ResXFileCodeGenerator
97 | Resources.Designer.cs
98 |
99 |
100 | SettingsSingleFileGenerator
101 | Settings.Designer.cs
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Threading;
10 | using Windows.ApplicationModel;
11 | using Windows.ApplicationModel.AppService;
12 | using Windows.Foundation.Collections;
13 |
14 | namespace FullTrust
15 | {
16 | ///
17 | /// Interaction logic for MainWindow.xaml
18 | ///
19 | public partial class MainWindow : Window
20 | {
21 | private double d1, d2;
22 | private AppServiceConnection connection = null;
23 |
24 | public MainWindow()
25 | {
26 | InitializeComponent();
27 | InitializeAppServiceConnection();
28 | }
29 |
30 | ///
31 | /// Open connection to UWP app service
32 | ///
33 | private async void InitializeAppServiceConnection()
34 | {
35 | connection = new AppServiceConnection();
36 | connection.AppServiceName = "SampleInteropService";
37 | connection.PackageFamilyName = Package.Current.Id.FamilyName;
38 | connection.RequestReceived += Connection_RequestReceived;
39 | connection.ServiceClosed += Connection_ServiceClosed;
40 |
41 | AppServiceConnectionStatus status = await connection.OpenAsync();
42 | if (status != AppServiceConnectionStatus.Success)
43 | {
44 | // something went wrong ...
45 | MessageBox.Show(status.ToString());
46 | this.IsEnabled = false;
47 | }
48 | }
49 |
50 | ///
51 | /// Handles the event when the app service connection is closed
52 | ///
53 | private void Connection_ServiceClosed(AppServiceConnection sender, AppServiceClosedEventArgs args)
54 | {
55 | // connection to the UWP lost, so we shut down the desktop process
56 | Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
57 | {
58 | Application.Current.Shutdown();
59 | }));
60 | }
61 |
62 | ///
63 | /// Handles the event when the desktop process receives a request from the UWP app
64 | ///
65 | private async void Connection_RequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
66 | {
67 | // retrive the reg key name from the ValueSet in the request
68 | string key = args.Request.Message["KEY"] as string;
69 | int index = key.IndexOf('\\');
70 | if (index > 0)
71 | {
72 | // read the key values from the respective hive in the registry
73 | string hiveName = key.Substring(0, key.IndexOf('\\'));
74 | string keyName = key.Substring(key.IndexOf('\\') + 1);
75 | RegistryHive hive = RegistryHive.ClassesRoot;
76 |
77 | switch (hiveName)
78 | {
79 | case "HKLM":
80 | hive = RegistryHive.LocalMachine;
81 | break;
82 | case "HKCU":
83 | hive = RegistryHive.CurrentUser;
84 | break;
85 | case "HKCR":
86 | hive = RegistryHive.ClassesRoot;
87 | break;
88 | case "HKU":
89 | hive = RegistryHive.Users;
90 | break;
91 | case "HKCC":
92 | hive = RegistryHive.CurrentConfig;
93 | break;
94 | }
95 |
96 | using (RegistryKey regKey = RegistryKey.OpenRemoteBaseKey(hive, "").OpenSubKey(keyName))
97 | {
98 | // compose the response as ValueSet
99 | ValueSet response = new ValueSet();
100 | if (regKey != null)
101 | {
102 | foreach (string valueName in regKey.GetValueNames())
103 | {
104 | response.Add(valueName, regKey.GetValue(valueName).ToString());
105 | }
106 | }
107 | else
108 | {
109 | response.Add("ERROR", "KEY NOT FOUND");
110 | }
111 | // send the response back to the UWP
112 | await args.Request.SendResponseAsync(response);
113 | }
114 | }
115 | else
116 | {
117 | ValueSet response = new ValueSet();
118 | response.Add("ERROR", "INVALID REQUEST");
119 | await args.Request.SendResponseAsync(response);
120 | }
121 | }
122 |
123 | ///
124 | /// Sends a request to the UWP app
125 | ///
126 | private async void Button_Click(object sender, RoutedEventArgs e)
127 | {
128 | // ask the UWP to calculate d1 + d2
129 | ValueSet request = new ValueSet();
130 | request.Add("D1", d1);
131 | request.Add("D2", d2);
132 | AppServiceResponse response = await connection.SendMessageAsync(request);
133 | double result = (double)response.Message["RESULT"];
134 | tbResult.Text = result.ToString();
135 | }
136 |
137 | ///
138 | /// Determines whether the "equals" button should be enabled
139 | /// based on input in the text boxes
140 | ///
141 | private void tb_TextChanged(object sender, TextChangedEventArgs e)
142 | {
143 | if (double.TryParse(tb1.Text, out d1) && double.TryParse(tb2.Text, out d2))
144 | {
145 | btnCalc.IsEnabled = true;
146 | }
147 | else
148 | {
149 | btnCalc.IsEnabled = false;
150 | }
151 | }
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("FullTrust")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("FullTrust")]
15 | [assembly: AssemblyCopyright("Copyright © 2018")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FullTrust.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FullTrust.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FullTrust.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/FullTrust/SingleInstance.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualBasic.ApplicationServices;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace FullTrust
9 | {
10 | public class SingleInstanceManager : Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
11 | {
12 | private SingleInstanceApplication _application;
13 | private System.Collections.ObjectModel.ReadOnlyCollection _commandLine;
14 |
15 | public SingleInstanceManager()
16 | {
17 | IsSingleInstance = true;
18 | }
19 |
20 | protected override bool OnStartup(Microsoft.VisualBasic.ApplicationServices.StartupEventArgs eventArgs)
21 | {
22 | // First time _application is launched
23 | _commandLine = eventArgs.CommandLine;
24 | _application = new SingleInstanceApplication();
25 | _application.Run();
26 | return false;
27 | }
28 |
29 | protected override void OnStartupNextInstance(StartupNextInstanceEventArgs eventArgs)
30 | {
31 | // Subsequent launches
32 | base.OnStartupNextInstance(eventArgs);
33 | _commandLine = eventArgs.CommandLine;
34 | _application.Activate();
35 | }
36 | }
37 |
38 | public class SingleInstanceApplication : System.Windows.Application
39 | {
40 | protected override void OnStartup(System.Windows.StartupEventArgs e)
41 | {
42 | // Call the OnStartup event on our base class
43 | base.OnStartup(e);
44 |
45 | // Create our MainWindow and show it
46 | MainWindow window = new MainWindow();
47 | window.Show();
48 | }
49 |
50 | public void Activate()
51 | {
52 | // Reactivate the main window
53 | MainWindow.Activate();
54 | }
55 |
56 | [STAThread]
57 | public static void Main(string[] args)
58 | {
59 | SingleInstanceManager manager = new SingleInstanceManager();
60 | manager.Run(args);
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/Package/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UWP Desktop Extension Sample 3
6 | Stefan Wick
7 | Assets\StoreLogo.png
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/Package/Package.wapproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 15.0
5 |
6 |
7 |
8 | Debug
9 | x86
10 |
11 |
12 | Release
13 | x86
14 |
15 |
16 | Debug
17 | x64
18 |
19 |
20 | Release
21 | x64
22 |
23 |
24 | Debug
25 | AnyCPU
26 |
27 |
28 | Release
29 | AnyCPU
30 |
31 |
32 |
33 | $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\
34 |
35 |
36 |
37 | 8a39bb16-7de3-4589-9029-a90b6d143a88
38 | 10.0.16299.0
39 | 10.0.14393.0
40 | en-US
41 | Package_StoreKey.pfx
42 | ..\UWP\UWP.csproj
43 | A0FE192592240954B06C809AD9FE93B58FCCC8F6
44 | True
45 | x86|x64
46 |
47 |
48 | Always
49 |
50 |
51 | Always
52 |
53 |
54 | Always
55 |
56 |
57 | Always
58 |
59 |
60 | Always
61 |
62 |
63 | Always
64 |
65 |
66 |
67 | Designer
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/README.md:
--------------------------------------------------------------------------------
1 | # UWP with Desktop Extension Tutorial - Part 3
2 |
3 | Sharing the code for the tutorial from my blog: https://stefanwick.com/2018/04/16/uwp-with-desktop-extension-part-3/
4 |
5 | This sample app can also be downloaded from the Microsoft Store:
6 | https://www.microsoft.com/store/apps/9NR0G35Q2F65
7 |
8 | You will need the following setup to run these projects:
9 | - Windows 10 build 16299 or later
10 | - Windows SDK build 16299
11 | - Visual Studio 2017 Update 5 or later
12 |
13 |
14 | Build/Deploy and Run the sample
15 | -------------------------------
16 | - Set "Package" project as Startup project in VS solution explorer
17 | - Select x86 or x64 platform (change from AnyCPU)
18 | - Press F5 to run!
19 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.ApplicationModel.AppService;
9 | using Windows.ApplicationModel.Background;
10 | using Windows.Foundation;
11 | using Windows.Foundation.Collections;
12 | using Windows.UI.Xaml;
13 | using Windows.UI.Xaml.Controls;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | namespace UWP
17 | {
18 | ///
19 | /// Provides application-specific behavior to supplement the default Application class.
20 | ///
21 | sealed partial class App : Application
22 | {
23 | public static BackgroundTaskDeferral AppServiceDeferral = null;
24 | public static AppServiceConnection Connection = null;
25 | public static event EventHandler AppServiceDisconnected;
26 | public static event EventHandler AppServiceConnected;
27 | public static bool IsForeground = false;
28 |
29 | ///
30 | /// Initializes the singleton application object. This is the first line of authored code
31 | /// executed, and as such is the logical equivalent of main() or WinMain().
32 | ///
33 | public App()
34 | {
35 | this.InitializeComponent();
36 | this.Suspending += OnSuspending;
37 | this.EnteredBackground += App_EnteredBackground;
38 | this.LeavingBackground += App_LeavingBackground;
39 | }
40 |
41 | private void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
42 | {
43 | IsForeground = true;
44 | }
45 |
46 | private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e)
47 | {
48 | IsForeground = false;
49 | }
50 |
51 | ///
52 | /// Handles connection requests to the app service
53 | ///
54 | protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args)
55 | {
56 | base.OnBackgroundActivated(args);
57 |
58 | if (args.TaskInstance.TriggerDetails is AppServiceTriggerDetails details)
59 | {
60 | // only accept connections from callers in the same package
61 | if (details.CallerPackageFamilyName == Package.Current.Id.FamilyName)
62 | {
63 | // connection established from the fulltrust process
64 | AppServiceDeferral = args.TaskInstance.GetDeferral();
65 | args.TaskInstance.Canceled += OnTaskCanceled;
66 |
67 | Connection = details.AppServiceConnection;
68 | AppServiceConnected?.Invoke(this, args.TaskInstance.TriggerDetails as AppServiceTriggerDetails);
69 | }
70 | }
71 | }
72 |
73 | ///
74 | /// Task canceled here means the app service client is gone
75 | ///
76 | private void OnTaskCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason)
77 | {
78 | AppServiceDeferral?.Complete();
79 | AppServiceDeferral = null;
80 | Connection = null;
81 | AppServiceDisconnected?.Invoke(this, null);
82 | }
83 |
84 | ///
85 | /// Invoked when the application is launched normally by the end user. Other entry points
86 | /// will be used such as when the application is launched to open a specific file.
87 | ///
88 | /// Details about the launch request and process.
89 | protected override void OnLaunched(LaunchActivatedEventArgs e)
90 | {
91 | Frame rootFrame = Window.Current.Content as Frame;
92 |
93 | // Do not repeat app initialization when the Window already has content,
94 | // just ensure that the window is active
95 | if (rootFrame == null)
96 | {
97 | // Create a Frame to act as the navigation context and navigate to the first page
98 | rootFrame = new Frame();
99 | rootFrame.NavigationFailed += OnNavigationFailed;
100 |
101 | // Place the frame in the current Window
102 | Window.Current.Content = rootFrame;
103 | }
104 |
105 | if (e.PrelaunchActivated == false)
106 | {
107 | if (rootFrame.Content == null)
108 | {
109 | // When the navigation stack isn't restored navigate to the first page,
110 | // configuring the new page by passing required information as a navigation
111 | // parameter
112 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
113 | }
114 | // Ensure the current window is active
115 | Window.Current.Activate();
116 | }
117 | }
118 |
119 | ///
120 | /// Invoked when Navigation to a certain page fails
121 | ///
122 | /// The Frame which failed navigation
123 | /// Details about the navigation failure
124 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
125 | {
126 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
127 | }
128 |
129 | ///
130 | /// Invoked when application execution is being suspended. Application state is saved
131 | /// without knowing whether the application will be terminated or resumed with the contents
132 | /// of memory still intact.
133 | ///
134 | /// The source of the suspend request.
135 | /// Details about the suspend request.
136 | private void OnSuspending(object sender, SuspendingEventArgs e)
137 | {
138 | var deferral = e.SuspendingOperation.GetDeferral();
139 | deferral.Complete();
140 | }
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Assets/Unused_Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/UWP/Assets/Unused_Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Assets/Unused_Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/UWP/Assets/Unused_Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Assets/Unused_Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/UWP/Assets/Unused_Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Assets/Unused_StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StefanWickDev/UWP-FullTrust/3a487ad9bddc69a2dab03783322bea22dfd190a7/UWP_FullTrust_3/UWP/Assets/Unused_StoreLogo.png
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using System.Threading;
7 | using Windows.ApplicationModel;
8 | using Windows.ApplicationModel.AppService;
9 | using Windows.Foundation;
10 | using Windows.Foundation.Collections;
11 | using Windows.Foundation.Metadata;
12 | using Windows.UI.Core;
13 | using Windows.UI.Popups;
14 | using Windows.UI.Xaml;
15 | using Windows.UI.Xaml.Controls;
16 | using Windows.UI.Xaml.Controls.Primitives;
17 | using Windows.UI.Xaml.Data;
18 | using Windows.UI.Xaml.Input;
19 | using Windows.UI.Xaml.Media;
20 | using Windows.UI.Xaml.Navigation;
21 |
22 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
23 |
24 | namespace UWP
25 | {
26 | public sealed partial class MainPage : Page
27 | {
28 | public MainPage()
29 | {
30 | this.InitializeComponent();
31 | }
32 |
33 | ///
34 | /// When app is loaded, kick off the desktop process
35 | /// and listen to app service connection events
36 | ///
37 | protected async override void OnNavigatedTo(NavigationEventArgs e)
38 | {
39 | base.OnNavigatedTo(e);
40 |
41 | if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
42 | {
43 | App.AppServiceConnected += MainPage_AppServiceConnected;
44 | App.AppServiceDisconnected += MainPage_AppServiceDisconnected;
45 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
46 | }
47 | }
48 |
49 | ///
50 | /// When the desktop process is connected, get ready to send/receive requests
51 | ///
52 | private async void MainPage_AppServiceConnected(object sender, AppServiceTriggerDetails e)
53 | {
54 | App.Connection.RequestReceived += AppServiceConnection_RequestReceived;
55 | await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
56 | {
57 | // enable UI to access the connection
58 | btnRegKey.IsEnabled = true;
59 | });
60 | }
61 |
62 | ///
63 | /// When the desktop process is disconnected, reconnect if needed
64 | ///
65 | private async void MainPage_AppServiceDisconnected(object sender, EventArgs e)
66 | {
67 | await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, ()=>
68 | {
69 | // disable UI to access the connection
70 | btnRegKey.IsEnabled = false;
71 |
72 | // ask user if they want to reconnect
73 | Reconnect();
74 | });
75 | }
76 |
77 | ///
78 | /// Send request to query the registry
79 | ///
80 | private async void btnClick_ReadKey(object sender, RoutedEventArgs e)
81 | {
82 | ValueSet request = new ValueSet();
83 | request.Add("KEY", tbKey.Text);
84 | AppServiceResponse response = await App.Connection.SendMessageAsync(request);
85 |
86 | // display the response key/value pairs
87 | tbResult.Text = "";
88 | foreach (string key in response.Message.Keys)
89 | {
90 | tbResult.Text += key + " = " + response.Message[key] + "\r\n";
91 | }
92 | }
93 |
94 | ///
95 | /// Handle calculation request from desktop process
96 | /// (dummy scenario to show that connection is bi-directional)
97 | ///
98 | private async void AppServiceConnection_RequestReceived(AppServiceConnection sender, AppServiceRequestReceivedEventArgs args)
99 | {
100 | double d1 = (double)args.Request.Message["D1"];
101 | double d2 = (double)args.Request.Message["D2"];
102 | double result = d1 + d2;
103 |
104 | ValueSet response = new ValueSet();
105 | response.Add("RESULT", result);
106 | await args.Request.SendResponseAsync(response);
107 |
108 | // log the request in the UI for demo purposes
109 | await this.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
110 | {
111 | tbRequests.Text += string.Format("Request: {0} + {1} --> Response = {2}\r\n", d1, d2, result);
112 | });
113 | }
114 |
115 | ///
116 | /// Ask user if they want to reconnect to the desktop process
117 | ///
118 | private async void Reconnect()
119 | {
120 | if (App.IsForeground)
121 | {
122 | MessageDialog dlg = new MessageDialog("Connection to desktop process lost. Reconnect?");
123 | UICommand yesCommand = new UICommand("Yes", async (r) =>
124 | {
125 | await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
126 | });
127 | dlg.Commands.Add(yesCommand);
128 | UICommand noCommand = new UICommand("No", (r) => { });
129 | dlg.Commands.Add(noCommand);
130 | await dlg.ShowAsync();
131 | }
132 | }
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | UWP
18 | swick
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/UWP_FullTrust_3/UWP_FullTrust_3.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27428.2005
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FullTrust", "FullTrust\FullTrust.csproj", "{E1935318-3483-4AB0-BEA9-079ECF2A9F78}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWP", "UWP\UWP.csproj", "{CC75B2D8-C825-47FC-B42B-8EB7BF227C88}"
9 | EndProject
10 | Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "Package", "Package\Package.wapproj", "{8A39BB16-7DE3-4589-9029-A90B6D143A88}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Debug|ARM = Debug|ARM
16 | Debug|x64 = Debug|x64
17 | Debug|x86 = Debug|x86
18 | Release|Any CPU = Release|Any CPU
19 | Release|ARM = Release|ARM
20 | Release|x64 = Release|x64
21 | Release|x86 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|ARM.ActiveCfg = Debug|Any CPU
27 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|ARM.Build.0 = Debug|Any CPU
28 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|x64.ActiveCfg = Debug|Any CPU
29 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|x64.Build.0 = Debug|Any CPU
30 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|x86.ActiveCfg = Debug|Any CPU
31 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Debug|x86.Build.0 = Debug|Any CPU
32 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|Any CPU.ActiveCfg = Release|Any CPU
33 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|Any CPU.Build.0 = Release|Any CPU
34 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|ARM.ActiveCfg = Release|Any CPU
35 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|ARM.Build.0 = Release|Any CPU
36 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|x64.ActiveCfg = Release|Any CPU
37 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|x64.Build.0 = Release|Any CPU
38 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|x86.ActiveCfg = Release|Any CPU
39 | {E1935318-3483-4AB0-BEA9-079ECF2A9F78}.Release|x86.Build.0 = Release|Any CPU
40 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|Any CPU.ActiveCfg = Debug|x86
41 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|ARM.ActiveCfg = Debug|ARM
42 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|ARM.Build.0 = Debug|ARM
43 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|ARM.Deploy.0 = Debug|ARM
44 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|x64.ActiveCfg = Debug|x64
45 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|x64.Build.0 = Debug|x64
46 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|x86.ActiveCfg = Debug|x86
47 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Debug|x86.Build.0 = Debug|x86
48 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|Any CPU.ActiveCfg = Release|x86
49 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|ARM.ActiveCfg = Release|ARM
50 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|ARM.Build.0 = Release|ARM
51 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|ARM.Deploy.0 = Release|ARM
52 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|x64.ActiveCfg = Release|x64
53 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|x64.Build.0 = Release|x64
54 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|x86.ActiveCfg = Release|x86
55 | {CC75B2D8-C825-47FC-B42B-8EB7BF227C88}.Release|x86.Build.0 = Release|x86
56 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
59 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|ARM.ActiveCfg = Debug|Any CPU
60 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|ARM.Build.0 = Debug|Any CPU
61 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|ARM.Deploy.0 = Debug|Any CPU
62 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|x64.ActiveCfg = Debug|x64
63 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|x64.Build.0 = Debug|x64
64 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|x64.Deploy.0 = Debug|x64
65 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|x86.ActiveCfg = Debug|x86
66 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|x86.Build.0 = Debug|x86
67 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Debug|x86.Deploy.0 = Debug|x86
68 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|Any CPU.ActiveCfg = Release|Any CPU
69 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|Any CPU.Build.0 = Release|Any CPU
70 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|Any CPU.Deploy.0 = Release|Any CPU
71 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|ARM.ActiveCfg = Release|Any CPU
72 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|ARM.Build.0 = Release|Any CPU
73 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|ARM.Deploy.0 = Release|Any CPU
74 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|x64.ActiveCfg = Release|x64
75 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|x64.Build.0 = Release|x64
76 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|x64.Deploy.0 = Release|x64
77 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|x86.ActiveCfg = Release|x86
78 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|x86.Build.0 = Release|x86
79 | {8A39BB16-7DE3-4589-9029-A90B6D143A88}.Release|x86.Deploy.0 = Release|x86
80 | EndGlobalSection
81 | GlobalSection(SolutionProperties) = preSolution
82 | HideSolutionNode = FALSE
83 | EndGlobalSection
84 | GlobalSection(ExtensibilityGlobals) = postSolution
85 | SolutionGuid = {82821E79-3C04-4AE2-9BE9-99BC54C2C916}
86 | EndGlobalSection
87 | EndGlobal
88 |
--------------------------------------------------------------------------------