Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
67d0771
Enabled settings syncing accross all windowss
soumyamahunt Apr 20, 2020
74262ee
Updated branch.
soumyamahunt Apr 20, 2020
73bc699
Codefactor changes.
soumyamahunt Apr 20, 2020
c50834a
Made security improvement.
soumyamahunt Apr 20, 2020
a9f16e8
Small refactoring.
soumyamahunt Apr 20, 2020
ccd7500
Made some enhancements.
soumyamahunt Apr 20, 2020
ef92863
Updated branch.
soumyamahunt Apr 21, 2020
ed9402f
Merge branch 'master' into multi-window
soumyamahunt Apr 21, 2020
f51a3d7
Merge branch 'master' into multi-window
soumyamahunt Apr 22, 2020
a527e8c
Added syncing of recent list accross all windows.
soumyamahunt Apr 22, 2020
d19f6e7
Improved syncing perfermance.
soumyamahunt May 2, 2020
95e607f
Improved perfermance.
soumyamahunt May 2, 2020
1ef07ac
Implemented desktop extension to save file anywhere.
soumyamahunt May 7, 2020
6474d6c
fix
soumyamahunt May 8, 2020
bd5392e
fix.
soumyamahunt May 8, 2020
e6a3c28
Updated branch and made methods more robust.
soumyamahunt May 10, 2020
f2fcf77
Exit extensions when app closed.
soumyamahunt May 10, 2020
4a022c9
Fully implemented saving system file as admin.
soumyamahunt May 11, 2020
b023c58
Made code more readable.
soumyamahunt May 11, 2020
c3f665a
Updated branch.
soumyamahunt May 11, 2020
c7acdc5
Merge branch 'master' into multi-window
soumyamahunt May 11, 2020
af43797
Updated branch.
soumyamahunt May 11, 2020
2ddfbcf
fix.
soumyamahunt May 11, 2020
02b6c37
Updated branch.
soumyamahunt May 11, 2020
368eda7
Updated branch.
soumyamahunt May 11, 2020
e8158f4
fix
soumyamahunt May 11, 2020
9ec73cb
Merge remote-tracking branch 'JasonStein/master' into desktop-extension
soumyamahunt May 11, 2020
6339e8a
fix.
soumyamahunt May 11, 2020
860d866
fix.
soumyamahunt May 11, 2020
122655c
fix.
soumyamahunt May 12, 2020
894fcb2
fix.
soumyamahunt May 12, 2020
3fb8a3d
Open any kind of file.
soumyamahunt May 14, 2020
6abfdb9
refinement.
soumyamahunt May 15, 2020
7afd461
fix.
soumyamahunt Jun 3, 2020
50ef6e9
Implemented settings and recently opened file list syncing across all…
soumyamahunt Jun 26, 2020
281edc7
fixed.
soumyamahunt Jun 26, 2020
4692e7e
Updated branch.
soumyamahunt Jun 27, 2020
2bb7a86
fixed.
soumyamahunt Jun 27, 2020
b46d77e
fixed.
soumyamahunt Jun 27, 2020
3ceb369
fixed.
soumyamahunt Jun 27, 2020
6a9131a
fixed.
soumyamahunt Jun 27, 2020
1cb6890
fixed.
soumyamahunt Jun 27, 2020
780a2a6
fixed.
soumyamahunt Jun 27, 2020
ed22a33
fixed.
soumyamahunt Jul 3, 2020
1896672
fixed.
soumyamahunt Jul 15, 2020
9fd4c66
fixed.
soumyamahunt Jul 15, 2020
e5168bd
fixed.
soumyamahunt Jul 15, 2020
f581db5
fixed.
soumyamahunt Jul 15, 2020
e8641ed
fixed.
soumyamahunt Jul 15, 2020
008b3ee
fixed.
soumyamahunt Jul 15, 2020
733721c
fixed.
soumyamahunt Jul 15, 2020
86eee77
fixed.
soumyamahunt Jul 15, 2020
7294f62
fixed.
soumyamahunt Jul 15, 2020
7ca455e
fixed.
soumyamahunt Jul 15, 2020
670cb2c
fixed.
soumyamahunt Jul 15, 2020
abb566c
fixed.
soumyamahunt Jul 25, 2020
1db7aa3
Implemented sharing data via memory-mapped-file for faster ipc.
soumyamahunt Aug 5, 2020
879885a
update references.
soumyamahunt Aug 5, 2020
2ad49c9
fixed saving error.
soumyamahunt Aug 5, 2020
c6d16d8
code refinement.
soumyamahunt Aug 6, 2020
1c3519f
Replaced wcf with pipes.
soumyamahunt Aug 6, 2020
914acc3
Moved to dotnet core.
soumyamahunt Aug 6, 2020
731e6ae
resolved conflicts.
soumyamahunt Aug 6, 2020
4d0a942
removed redundant files.
soumyamahunt Aug 6, 2020
611f20b
fixed.
soumyamahunt Aug 7, 2020
9c19b5f
fix for pipeline.
soumyamahunt Aug 7, 2020
62d5662
pipeline fix.
soumyamahunt Aug 7, 2020
0eab962
pipeline fix.
soumyamahunt Aug 7, 2020
16eb4ff
fix pipeline.
soumyamahunt Aug 7, 2020
3118ce9
pipeline fix.
soumyamahunt Aug 7, 2020
d327d5d
pipeline fix.
soumyamahunt Aug 7, 2020
0643063
fixed pipeline.
soumyamahunt Aug 7, 2020
6d850c8
fixed pipeline.
soumyamahunt Aug 7, 2020
07adf95
pipeline fix.
soumyamahunt Aug 7, 2020
37c7382
pipeline fix.
soumyamahunt Aug 7, 2020
d33fa95
code-refactor and added documentation.
soumyamahunt Aug 7, 2020
215a272
pipeline fix.
soumyamahunt Aug 7, 2020
ef331ac
Moved to dotnet 5.
soumyamahunt Aug 7, 2020
69f2030
Merge branch 'master' into desktop-extension
soumyamahunt Aug 7, 2020
629efb5
Fixed extension crashing.
soumyamahunt Aug 8, 2020
3080f67
Added ARM builds for desktop extension.
soumyamahunt Aug 8, 2020
1cff733
updated targets.
soumyamahunt Aug 8, 2020
fb9e3f0
Implemented handling multiple sessions.
soumyamahunt Aug 8, 2020
9ae0cb8
Fixed compiling with "Any Cpu" option.
soumyamahunt Aug 8, 2020
b7b5215
code-refinement.
soumyamahunt Aug 8, 2020
2bee194
code-refinement.
soumyamahunt Aug 9, 2020
22882d6
fixed instance handling.
soumyamahunt Aug 9, 2020
b07af34
Implemented crash-analytics for desktop extension.
soumyamahunt Aug 17, 2020
f92e508
Added better error handling.
soumyamahunt Aug 25, 2020
58091bd
Code refactor.
soumyamahunt Sep 18, 2020
1352a80
Code refactor.
soumyamahunt Sep 23, 2020
cd7c133
Code refactor.
soumyamahunt Sep 23, 2020
59097e6
Merge branch 'master' into desktop-extension
soumyamahunt Nov 11, 2020
1ed3342
Updated app limitations list.
soumyamahunt Nov 12, 2020
5e347c6
Merge branch 'desktop-extension' of https://github.com/soumyamahunt/N…
soumyamahunt Nov 12, 2020
e60544a
Updated target framework to use winrt apis.
soumyamahunt Nov 12, 2020
3d70549
Moved to Win32 from .NET for desktop extension to reuce deployment size.
soumyamahunt Nov 30, 2020
0c80fd2
code refactor.
soumyamahunt Nov 30, 2020
05b04a6
code refactor.
soumyamahunt Dec 1, 2020
a474d5f
code refactor.
soumyamahunt Dec 1, 2020
78bacec
Implemented error logging.
soumyamahunt Dec 3, 2020
845bad6
Fixed github action.
soumyamahunt Dec 3, 2020
21dfdce
Fixed github action.
soumyamahunt Dec 3, 2020
7e293b8
Fixed Github task.
soumyamahunt Dec 3, 2020
a9d21de
code refactor.
soumyamahunt Dec 4, 2020
b4e7d64
Fixed reading from pipe in some cases.
soumyamahunt Dec 5, 2020
0ea00b1
code refactor.
soumyamahunt Dec 6, 2020
1442d26
Initial commit to integrate AppCenter crashanalytics.
soumyamahunt Dec 8, 2020
68a368d
Fix github workflow.
soumyamahunt Dec 8, 2020
7bfc5f2
code refactor.
soumyamahunt Dec 8, 2020
6e3e890
Fix workflow.
soumyamahunt Dec 9, 2020
236e635
Fixed workflow.
soumyamahunt Dec 9, 2020
0074b39
Fix workflow.
soumyamahunt Dec 9, 2020
b958c49
Fix workflow.
soumyamahunt Dec 9, 2020
03eaed9
Fix workflow.
soumyamahunt Dec 9, 2020
4620473
Fix workflow.
soumyamahunt Dec 9, 2020
f415f70
Fix workflow.
soumyamahunt Dec 10, 2020
1a65233
Workflow fix.
soumyamahunt Dec 10, 2020
fe4a0fd
Fix workflow.
soumyamahunt Dec 10, 2020
3e81308
Fix workflow.
soumyamahunt Dec 10, 2020
34b36ee
Fix workflow.
soumyamahunt Dec 10, 2020
e47cd29
Fix workflow.
soumyamahunt Dec 10, 2020
661751e
Fix workflow.
soumyamahunt Dec 10, 2020
5ecc8e8
Fix workflow.
soumyamahunt Dec 10, 2020
d00a40d
Fix workflow.
soumyamahunt Dec 10, 2020
ce21e0c
code refactor.
soumyamahunt Dec 10, 2020
1049053
Merge branch 'master' into desktop-extension
soumyamahunt Dec 10, 2020
728e758
code refactor.
soumyamahunt Dec 10, 2020
6ebbef1
code refactor.
soumyamahunt Dec 11, 2020
777cce7
Implemented custom event tracking.
soumyamahunt Dec 14, 2020
3bdbf70
code refactor.
soumyamahunt Dec 15, 2020
df40892
Implemented getting stacktrace in appcenter.
soumyamahunt Dec 16, 2020
ac72a76
Merge branch 'master' into desktop-extension
soumyamahunt Dec 16, 2020
c844c49
code-refactor.
soumyamahunt Dec 16, 2020
64df99b
code refactor.
soumyamahunt Dec 18, 2020
cfda6d9
code refactor.
soumyamahunt Dec 19, 2020
4b15f5c
Added crash analytics for background task.
soumyamahunt Dec 20, 2020
2cc55a3
code refactor.
soumyamahunt Dec 21, 2020
3104d28
code refactor.
soumyamahunt Dec 21, 2020
10cb5cd
code refactor.
soumyamahunt Dec 22, 2020
74367bb
code refactor.
soumyamahunt Dec 22, 2020
1edee0e
Added more crash analytics.
soumyamahunt Dec 23, 2020
e4ed603
Updated vcpkg.
soumyamahunt Dec 23, 2020
91f0461
Neglect BOM during pipe write in uwp app.
soumyamahunt Dec 23, 2020
d725321
Updated C++ language version.
soumyamahunt Dec 24, 2020
612c98b
code-refactor.
soumyamahunt Jan 2, 2021
14cc0fa
Implemented process syncronization to indicate client of connecting t…
soumyamahunt Jan 2, 2021
6a6af48
Better lifetime management for desktop extension.
soumyamahunt Jan 3, 2021
3df5a01
Clean up unnecessary references.
soumyamahunt Jan 3, 2021
4392113
Fix desktop extension lifetime.
soumyamahunt Jan 3, 2021
e1c950d
Added functionality to rename system files.
soumyamahunt Jan 5, 2021
f49f5c8
Resolved merge conflicts.
soumyamahunt Jan 5, 2021
b0d5e21
Code refactor.
soumyamahunt Jan 5, 2021
198e1af
code refacor.
soumyamahunt Jan 7, 2021
e78ad35
Merge branch 'master' into settings-sync
soumyamahunt Jan 9, 2021
09ae658
Merge branch 'master' into desktop-extension
soumyamahunt Jan 9, 2021
086f217
Removed AppServiceConnection as IPC.
soumyamahunt Jan 9, 2021
30d9b0a
Modified script execution policy.
soumyamahunt Jan 9, 2021
567d99b
Modified build tasks.
soumyamahunt Jan 9, 2021
018327a
Upadted branch.
soumyamahunt Jan 10, 2021
1d97006
Implemented redirecting file activation from desktop extension to uwp…
soumyamahunt Jan 12, 2021
b752782
Cleaned up package manifest.
soumyamahunt Jan 12, 2021
92c62da
Implemented win32 app that replaces Windows Notepad functionality wit…
soumyamahunt Jan 13, 2021
e2d9e69
Fix build errors.
soumyamahunt Jan 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
configuration: [Debug, Release]
env:
Solution_Name: src\Notepads.sln
Project_Path: src\Notepads\Notepads.csproj
Project_Path: src\Notepads.Package\Notepads.Package.wapproj

runs-on: windows-latest
steps:
Expand All @@ -29,6 +29,12 @@ jobs:
env:
Configuration: ${{ matrix.configuration }}

- name: Setup NuGet
uses: NuGet/setup-nuget@v1.0.5

- name: Restore NuGet packages
run: nuget restore $env:Solution_Name

- name: Build
run: |
msbuild $env:Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:AppxPackageSigningEnabled=false /p:AppxBundlePlatforms="$env:Appx_Bundle_Platforms"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,4 @@ healthchecksdb
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Thumbs.db
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ So here comes the “Notepads” 🎉 (s stands for Sets).

## Platform limitations (UWP):

* You won't be able to save files to system folders due to UWP restriction (windows, system32, etc.).
* You cannot associate potentially harmful file types (.cmd, .bat etc.) with Notepads.
* Notepads does not work well with large files; the file size limit is set to 1MB for now. I will add large file support later.

Expand Down
17 changes: 15 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,23 @@ steps:
- task: VSBuild@1
inputs:
platform: 'x64'
solution: '$(solution)'
solution: '**/*.wapproj'
configuration: '$(buildConfiguration)'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)"
msbuildArgs: '/t:build;_GenerateAppxPackage
/p:AppxBundlePlatforms="$(buildPlatform)"
/p:AppxPackageDir="$(appxPackageDir)"
/p:AppxBundle=Always
/p:UapAppxPackageBuildMode=StoreUpload
/p:AppxPackageSigningEnabled=false'

- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**\bin\$(BuildConfiguration)\**'
TargetFolder: '$(build.artifactstagingdirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
144 changes: 144 additions & 0 deletions src/Notepad/Notepad.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props')" />
<PropertyGroup Label="Globals">
<CppWinRTOptimized>true</CppWinRTOptimized>
<CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
<MinimalCoreWin>true</MinimalCoreWin>
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{0f39c2eb-f8c6-473e-b26a-0714385798f5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Notepad</RootNamespace>
<OutDir>$(ProjectDir)bin\$(Platform)\$(Configuration)\</OutDir>
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>
<AppContainerApplication>false</AppContainerApplication>
<AppxPackage>false</AppxPackage>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup>
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<PreprocessorDefinitions>_CONSOLE;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<AdditionalOptions>%(AdditionalOptions) /permissive- /bigobj</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.201217.4\build\native\Microsoft.Windows.CppWinRT.targets'))" />
</Target>
</Project>
33 changes: 33 additions & 0 deletions src/Notepad/Notepad.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
73 changes: 73 additions & 0 deletions src/Notepad/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#include "pch.h"
#include "iostream"

#ifndef _DEBUG
#define AUMID L"19282JackieLiu.Notepads-Beta_echhpq9pdbte8!App"
#else
#define AUMID L"Notepads-Dev_ezhh5fms182ha!App"
#endif

#define OPEN L"open"
#define PRINT L"print"

#define NOTEPADPRINTCOMMAND L"/p"
#define NOTEPADOPENWITHANSIENCODINGCOMMAND L"/a"
#define NOTEPADOPENWITHUTF16ENCODINGCOMMAND L"/w"

using namespace std;
using namespace winrt;

#ifndef _DEBUG
INT APIENTRY wWinMain(_In_ HINSTANCE /* hInstance */, _In_opt_ HINSTANCE /* hPrevInstance */, _In_ LPWSTR /* lpCmdLine */, _In_ INT /* nCmdShow */)
#else
INT main()
#endif
{
init_apartment();

LPWSTR* szArglist = NULL;
INT nArgs;
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
if (szArglist && nArgs > 1)
{
LPCTSTR verb = OPEN;
if (wcscmp(NOTEPADPRINTCOMMAND, szArglist[1]) == 0) verb = PRINT;
bool isOpenRequested = (wcscmp(OPEN, verb) == 0);

INT ct = nArgs - isOpenRequested ? 1 : 2;
HRESULT hr = E_OUTOFMEMORY;
com_ptr< IShellItemArray> ppsia = NULL;
PIDLIST_ABSOLUTE* rgpidl = new(std::nothrow) PIDLIST_ABSOLUTE[ct];
if (rgpidl)
{
hr = S_OK;
INT cpidl;
for (cpidl = 0; SUCCEEDED(hr) && cpidl < ct; cpidl++)
{
hr = SHParseDisplayName(szArglist[cpidl + isOpenRequested ? 1 : 2], NULL, &rgpidl[cpidl], 0, NULL);
}

if (cpidl > 0 && SUCCEEDED(SHCreateShellItemArrayFromIDLists(cpidl, rgpidl, ppsia.put())))
{
com_ptr<IApplicationActivationManager> appActivationMgr = NULL;
if (SUCCEEDED(CoCreateInstance(CLSID_ApplicationActivationManager, NULL, CLSCTX_LOCAL_SERVER, __uuidof(appActivationMgr), appActivationMgr.put_void())))
{
DWORD pid = 0;
appActivationMgr->ActivateForFile(AUMID, ppsia.get(), verb, &pid);
}
appActivationMgr.~com_ptr();
}

for (INT i = 0; i < cpidl; i++)
{
CoTaskMemFree(rgpidl[i]);
}
}

ppsia.~com_ptr();
delete[] rgpidl;
}

LocalFree(szArglist);
uninit_apartment();
}
4 changes: 4 additions & 0 deletions src/Notepad/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Windows.CppWinRT" version="2.0.201217.4" targetFramework="native" />
</packages>
9 changes: 9 additions & 0 deletions src/Notepad/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once
#pragma comment(lib, "Shell32")
#define STRICT
#define STRICT_TYPED_ITEMIDS
#include <Windows.h>
#include <shellapi.h>
#include <ShlObj_core.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
21 changes: 1 addition & 20 deletions src/Notepads.Controls/Notepads.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{7AA5E631-B663-420E-A08F-002CD81DF855}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
Expand All @@ -17,25 +17,6 @@
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
Expand Down
7 changes: 7 additions & 0 deletions src/Notepads.DesktopExtension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# vcpkg generated files #
#########################
**/vcpkg_installed/

# AppCenter version file #
##########################
appcenter-sdk-version.txt
8 changes: 8 additions & 0 deletions src/Notepads.DesktopExtension/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Application x:Class="Notepads.DesktopExtension.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Notepads.DesktopExtension">
<Application.Resources>

</Application.Resources>
</Application>
Loading