├── setup.ico
├── Notes
├── Notes.rc
├── resource.h
├── NoteDlg.cpp
├── NotesDlg.cpp
├── defintion.h
├── app
│ ├── AppCtrl.cpp
│ ├── AppCtrl.h
│ ├── Config.h
│ ├── NoteConfig.h
│ ├── Note.h
│ ├── Note.cpp
│ ├── Config.cpp
│ └── NoteConfig.cpp
├── res
│ ├── Notes.ico
│ └── Notes.rc2
├── stdafx.cpp
├── ref
│ ├── XFile.h
│ ├── RawInput.h
│ ├── Utility.h
│ ├── Log.h
│ ├── HotKey.h
│ ├── Cvt.h
│ ├── RawInput.cpp
│ ├── XFile.cpp
│ ├── Registry.h
│ ├── Shell.h
│ ├── Cvt.cpp
│ ├── HotKey.cpp
│ ├── Utility.cpp
│ ├── Ini.h
│ ├── Log.cpp
│ ├── Ini.cpp
│ ├── Registry.cpp
│ ├── Shell.cpp
│ ├── Path.h
│ └── Path.cpp
├── targetver.h
├── packages.config
├── Notes.h
├── control
│ ├── HotKeyEdit.h
│ └── HotKeyEdit.cpp
├── NotesDlg.h
├── NoteDlg.h
├── Notes.cpp
├── stdafx.h
├── ReadMe.txt
└── Notes.vcxproj.filters
├── themes
├── default
│ ├── src
│ │ ├── themes
│ │ │ ├── tailwind.scss
│ │ │ ├── style.scss
│ │ │ └── app.scss
│ │ ├── components
│ │ │ ├── icons
│ │ │ │ ├── IconSupport.vue
│ │ │ │ ├── IconTooling.vue
│ │ │ │ ├── IconCommunity.vue
│ │ │ │ ├── IconDocumentation.vue
│ │ │ │ └── IconEcosystem.vue
│ │ │ ├── HelloWorld.vue
│ │ │ ├── WelcomeItem.vue
│ │ │ └── TheWelcome.vue
│ │ ├── router
│ │ │ └── index.ts
│ │ ├── stores
│ │ │ └── counter.ts
│ │ ├── main.ts
│ │ ├── views
│ │ │ ├── HomeView.vue
│ │ │ └── NoteItem.vue
│ │ ├── utils
│ │ │ └── index.ts
│ │ └── App.vue
│ ├── public
│ │ ├── logo.png
│ │ └── favicon.ico
│ ├── .vscode
│ │ └── extensions.json
│ ├── postcss.config.js
│ ├── .prettierrc.json
│ ├── tsconfig.json
│ ├── env.d.ts
│ ├── tailwind.config.js
│ ├── tsconfig.app.json
│ ├── .gitignore
│ ├── tsconfig.node.json
│ ├── .eslintrc.cjs
│ ├── vite.config.ts
│ ├── index.html
│ ├── README.md
│ └── package.json
└── simple
│ ├── src
│ ├── themes
│ │ ├── tailwind.scss
│ │ ├── style.scss
│ │ └── app.scss
│ ├── components
│ │ ├── icons
│ │ │ ├── IconSupport.vue
│ │ │ ├── IconTooling.vue
│ │ │ ├── IconCommunity.vue
│ │ │ ├── IconDocumentation.vue
│ │ │ └── IconEcosystem.vue
│ │ ├── HelloWorld.vue
│ │ ├── WelcomeItem.vue
│ │ └── TheWelcome.vue
│ ├── router
│ │ └── index.ts
│ ├── stores
│ │ └── counter.ts
│ ├── main.ts
│ ├── views
│ │ ├── HomeView.vue
│ │ └── NoteItem.vue
│ ├── utils
│ │ └── index.ts
│ └── App.vue
│ ├── public
│ ├── logo.png
│ └── favicon.ico
│ ├── .vscode
│ └── extensions.json
│ ├── postcss.config.js
│ ├── .prettierrc.json
│ ├── tsconfig.json
│ ├── env.d.ts
│ ├── tailwind.config.js
│ ├── tsconfig.app.json
│ ├── .gitignore
│ ├── tsconfig.node.json
│ ├── .eslintrc.cjs
│ ├── vite.config.ts
│ ├── index.html
│ ├── README.md
│ └── package.json
├── .gitignore
├── README.md
├── Notes.sln
├── setup.iss
└── setupx64.iss
/setup.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/setup.ico
--------------------------------------------------------------------------------
/Notes/Notes.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/Notes.rc
--------------------------------------------------------------------------------
/Notes/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/resource.h
--------------------------------------------------------------------------------
/Notes/NoteDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/NoteDlg.cpp
--------------------------------------------------------------------------------
/Notes/NotesDlg.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/NotesDlg.cpp
--------------------------------------------------------------------------------
/Notes/defintion.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/defintion.h
--------------------------------------------------------------------------------
/Notes/app/AppCtrl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/app/AppCtrl.cpp
--------------------------------------------------------------------------------
/Notes/res/Notes.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/res/Notes.ico
--------------------------------------------------------------------------------
/Notes/res/Notes.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/Notes/res/Notes.rc2
--------------------------------------------------------------------------------
/themes/default/src/themes/tailwind.scss:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
--------------------------------------------------------------------------------
/themes/simple/src/themes/tailwind.scss:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
--------------------------------------------------------------------------------
/themes/default/src/themes/style.scss:
--------------------------------------------------------------------------------
1 | @import 'app.scss';
2 | @import 'tailwind.scss';
3 | @import 'markdown.scss'
--------------------------------------------------------------------------------
/themes/simple/src/themes/style.scss:
--------------------------------------------------------------------------------
1 | @import 'app.scss';
2 | @import 'tailwind.scss';
3 | @import 'markdown.scss'
--------------------------------------------------------------------------------
/themes/default/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/themes/default/public/logo.png
--------------------------------------------------------------------------------
/themes/simple/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/themes/simple/public/logo.png
--------------------------------------------------------------------------------
/themes/default/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/themes/default/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/themes/default/public/favicon.ico
--------------------------------------------------------------------------------
/themes/simple/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3 | }
4 |
--------------------------------------------------------------------------------
/themes/simple/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/imlinhanchao/sticky_notes/HEAD/themes/simple/public/favicon.ico
--------------------------------------------------------------------------------
/themes/default/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/themes/simple/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/themes/default/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/prettierrc",
3 | "semi": false,
4 | "tabWidth": 2,
5 | "singleQuote": true,
6 | "printWidth": 100,
7 | "trailingComma": "none"
8 | }
--------------------------------------------------------------------------------
/themes/default/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [],
3 | "references": [
4 | {
5 | "path": "./tsconfig.node.json"
6 | },
7 | {
8 | "path": "./tsconfig.app.json"
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/themes/simple/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/prettierrc",
3 | "semi": false,
4 | "tabWidth": 2,
5 | "singleQuote": true,
6 | "printWidth": 100,
7 | "trailingComma": "none"
8 | }
--------------------------------------------------------------------------------
/themes/simple/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [],
3 | "references": [
4 | {
5 | "path": "./tsconfig.node.json"
6 | },
7 | {
8 | "path": "./tsconfig.app.json"
9 | }
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/themes/default/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | declare module '*.vue' {
3 | import { defineComponent } from 'vue'
4 | const Component: ReturnType
5 | export default Component
6 | }
--------------------------------------------------------------------------------
/themes/simple/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | declare module '*.vue' {
3 | import { defineComponent } from 'vue'
4 | const Component: ReturnType
5 | export default Component
6 | }
--------------------------------------------------------------------------------
/Notes/stdafx.cpp:
--------------------------------------------------------------------------------
1 |
2 | // stdafx.cpp : source file that includes just the standard includes
3 | // Notes.pch will be the pre-compiled header
4 | // stdafx.obj will contain the pre-compiled type information
5 |
6 | #include "stdafx.h"
7 |
8 |
9 |
--------------------------------------------------------------------------------
/themes/default/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
4 | theme: {
5 | extend: {},
6 | },
7 | plugins: [],
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/themes/simple/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
4 | theme: {
5 | extend: {},
6 | },
7 | plugins: [],
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/Notes/ref/XFile.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Easy {
4 |
5 | class XFile
6 | {
7 | public:
8 | static bool ReadFile(CString sFile, CString& data);
9 | static bool WriteFile(CString sFile, CString data);
10 | static bool AppendFile(CString sFile, CString data);
11 | };
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/themes/default/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.dom.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4 | "exclude": ["src/**/__tests__/*"],
5 | "compilerOptions": {
6 | "composite": true,
7 | "baseUrl": ".",
8 | "paths": {
9 | "@/*": ["./src/*"]
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/themes/simple/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.dom.json",
3 | "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
4 | "exclude": ["src/**/__tests__/*"],
5 | "compilerOptions": {
6 | "composite": true,
7 | "baseUrl": ".",
8 | "paths": {
9 | "@/*": ["./src/*"]
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Notes/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Including SDKDDKVer.h defines the highest available Windows platform.
4 |
5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/Notes/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/themes/default/src/components/icons/IconSupport.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/themes/simple/src/components/icons/IconSupport.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/Notes/app/AppCtrl.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "NoteDlg.h"
3 |
4 | class CAppCtrl
5 | {
6 | public:
7 | CAppCtrl(void);
8 | ~CAppCtrl(void);
9 |
10 | void Init();
11 | void New(CString sName = _T(""));
12 | bool CheckEdit();
13 | void MouseThrough(bool bThrough=true);
14 | void Visible(bool bShow);
15 |
16 | private:
17 | vector m_NoteListDlg;
18 | };
19 |
20 |
--------------------------------------------------------------------------------
/themes/default/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHashHistory } from 'vue-router'
2 | import HomeView from '../views/HomeView.vue'
3 |
4 | const router = createRouter({
5 | history: createWebHashHistory(),
6 | routes: [
7 | {
8 | path: '/',
9 | name: 'home',
10 | component: HomeView
11 | }
12 | ]
13 | })
14 |
15 | export default router
16 |
--------------------------------------------------------------------------------
/themes/default/src/stores/counter.ts:
--------------------------------------------------------------------------------
1 | import { ref, computed } from 'vue'
2 | import { defineStore } from 'pinia'
3 |
4 | export const useCounterStore = defineStore('counter', () => {
5 | const count = ref(0)
6 | const doubleCount = computed(() => count.value * 2)
7 | function increment() {
8 | count.value++
9 | }
10 |
11 | return { count, doubleCount, increment }
12 | })
13 |
--------------------------------------------------------------------------------
/themes/simple/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import { createRouter, createWebHashHistory } from 'vue-router'
2 | import HomeView from '../views/HomeView.vue'
3 |
4 | const router = createRouter({
5 | history: createWebHashHistory(),
6 | routes: [
7 | {
8 | path: '/',
9 | name: 'home',
10 | component: HomeView
11 | }
12 | ]
13 | })
14 |
15 | export default router
16 |
--------------------------------------------------------------------------------
/themes/simple/src/stores/counter.ts:
--------------------------------------------------------------------------------
1 | import { ref, computed } from 'vue'
2 | import { defineStore } from 'pinia'
3 |
4 | export const useCounterStore = defineStore('counter', () => {
5 | const count = ref(0)
6 | const doubleCount = computed(() => count.value * 2)
7 | function increment() {
8 | count.value++
9 | }
10 |
11 | return { count, doubleCount, increment }
12 | })
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | *release
3 | *debug
4 | *debughttp
5 | *ipch
6 | *.sdf
7 | *.aps
8 | *.user
9 | *.opensdf
10 | *.suo
11 | *.tmp
12 | *.zip
13 | *.rar
14 | *.7z
15 | _*
16 | Thumbs.db
17 | *.obj
18 | *.pdb
19 | *.user
20 | *.aps
21 | *.pch
22 | *.vspscc
23 | *_i.c
24 | *_p.c
25 | *.ncb
26 | *.suo
27 | *.tlb
28 | *.tlh
29 | *.bak
30 | *.cache
31 | *.ilk
32 | *.log
33 | *.lib
34 | *.sbr
35 | obj/
36 | _ReSharper*/
37 | .vs/
38 | packages/
39 | output/
--------------------------------------------------------------------------------
/themes/default/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/themes/simple/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | .DS_Store
12 | dist
13 | dist-ssr
14 | coverage
15 | *.local
16 |
17 | /cypress/videos/
18 | /cypress/screenshots/
19 |
20 | # Editor directories and files
21 | .vscode/*
22 | !.vscode/extensions.json
23 | .idea
24 | *.suo
25 | *.ntvs*
26 | *.njsproj
27 | *.sln
28 | *.sw?
29 |
--------------------------------------------------------------------------------
/themes/default/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/node18/tsconfig.json",
3 | "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
4 | "compilerOptions": {
5 | "composite": true,
6 | "module": "esnext",
7 | "allowSyntheticDefaultImports": true,
8 | "moduleResolution": "node",
9 | "resolveJsonModule": true,
10 | "types": [
11 | "element-plus/global"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/themes/simple/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/node18/tsconfig.json",
3 | "include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
4 | "compilerOptions": {
5 | "composite": true,
6 | "module": "esnext",
7 | "allowSyntheticDefaultImports": true,
8 | "moduleResolution": "node",
9 | "resolveJsonModule": true,
10 | "types": [
11 | "element-plus/global"
12 | ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Notes/ref/RawInput.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Easy {
4 |
5 | typedef enum RAW_TYPE
6 | {
7 | RAW_TYPE_HID = 0x01,
8 | RAW_TYPE_KB = 0x02,
9 | RAW_TYPE_MS = 0x04,
10 | };
11 |
12 | class CRawInput
13 | {
14 | CRawInput();
15 | ~CRawInput();
16 |
17 | public:
18 | static bool Register(HWND hWnd, WORD wRawType);
19 | static bool Remove(HWND hWnd, WORD wRawType);
20 |
21 | private:
22 | static bool SetRawInput(HWND hWnd, WORD wRawType, bool bRegister);
23 | };
24 |
25 | }
--------------------------------------------------------------------------------
/themes/default/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | require('@rushstack/eslint-patch/modern-module-resolution')
3 |
4 | module.exports = {
5 | root: true,
6 | 'extends': [
7 | 'plugin:vue/vue3-essential',
8 | 'eslint:recommended',
9 | '@vue/eslint-config-typescript',
10 | '@vue/eslint-config-prettier/skip-formatting'
11 | ],
12 | parserOptions: {
13 | ecmaVersion: 'latest'
14 | },
15 | overrides: [
16 | {
17 | files: ['*.config.js'],
18 | env: {
19 | node: true,
20 | },
21 | },
22 | ],
23 | }
24 |
--------------------------------------------------------------------------------
/themes/simple/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | require('@rushstack/eslint-patch/modern-module-resolution')
3 |
4 | module.exports = {
5 | root: true,
6 | 'extends': [
7 | 'plugin:vue/vue3-essential',
8 | 'eslint:recommended',
9 | '@vue/eslint-config-typescript',
10 | '@vue/eslint-config-prettier/skip-formatting'
11 | ],
12 | parserOptions: {
13 | ecmaVersion: 'latest'
14 | },
15 | overrides: [
16 | {
17 | files: ['*.config.js'],
18 | env: {
19 | node: true,
20 | },
21 | },
22 | ],
23 | }
24 |
--------------------------------------------------------------------------------
/Notes/ref/Utility.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Easy
4 | {
5 |
6 | typedef struct _MODULE_VER { // Module version
7 | WORD wMajor;
8 | WORD wMinor;
9 | WORD wRevision;
10 | WORD wBuild;
11 |
12 | CString ToString()
13 | {
14 | return Cvt::ToString(_T("%d.%d.%d"), wMajor, wMinor, wRevision);
15 | }
16 | }MODULE_VER;
17 |
18 | class Utility
19 | {
20 | public:
21 | static bool IsWow64();
22 | static MODULE_VER GetVersion(CString sModuleName);
23 | static void SetAutoRun(bool bAuto);
24 | static HANDLE ProgramLock(CString sInstanceName);
25 | };
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/themes/simple/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from 'node:url'
2 | import legacy from '@vitejs/plugin-legacy'
3 |
4 | import { defineConfig } from 'vite'
5 | import vue from '@vitejs/plugin-vue'
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig({
9 | base: './',
10 | plugins: [
11 | legacy({
12 | targets: ['defaults', 'not IE 11']
13 | }),
14 | vue()
15 | ],
16 | resolve: {
17 | alias: {
18 | '@': fileURLToPath(new URL('./src', import.meta.url))
19 | }
20 | },
21 | build: {
22 | minify: 'terser'
23 | }
24 | })
25 |
--------------------------------------------------------------------------------
/themes/default/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { fileURLToPath, URL } from 'node:url'
2 | import legacy from '@vitejs/plugin-legacy'
3 |
4 | import { defineConfig } from 'vite'
5 | import vue from '@vitejs/plugin-vue'
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig({
9 | base: './',
10 | plugins: [
11 | legacy({
12 | targets: ['defaults', 'not IE 11']
13 | }),
14 | vue()
15 | ],
16 | resolve: {
17 | alias: {
18 | '@': fileURLToPath(new URL('./src', import.meta.url))
19 | }
20 | },
21 | build: {
22 | minify: 'terser'
23 | }
24 | })
25 |
--------------------------------------------------------------------------------
/Notes/Notes.h:
--------------------------------------------------------------------------------
1 |
2 | // Notes.h : main header file for the PROJECT_NAME application
3 | //
4 |
5 | #pragma once
6 |
7 | #ifndef __AFXWIN_H__
8 | #error "include 'stdafx.h' before including this file for PCH"
9 | #endif
10 |
11 | #include "resource.h" // main symbols
12 |
13 |
14 | // CNotesApp:
15 | // See Notes.cpp for the implementation of this class
16 | //
17 |
18 | class CNotesApp : public CWinApp
19 | {
20 | public:
21 | CNotesApp();
22 |
23 | // Overrides
24 | public:
25 | virtual BOOL InitInstance();
26 |
27 | // Implementation
28 |
29 | DECLARE_MESSAGE_MAP()
30 | };
31 |
32 | extern CNotesApp theApp;
--------------------------------------------------------------------------------
/Notes/app/Config.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class CConfig
4 | {
5 | public:
6 | static void LoadNoteGroup(vector &lstName);
7 | static bool GetNoteGroup(CString sName, NoteGroup &group);
8 | static void SetNoteGroup(NoteGroup group);
9 | static bool RenameNoteGroup(CString sOldName, CString sNewName);
10 |
11 | static void LoadSetting(Setting &setting);
12 | static void SaveSetting(Setting setting);
13 | static Setting& GetCurrentSetting();
14 |
15 | static void SearchThemes(vector& lstName);
16 |
17 | static CString NotesDir();
18 |
19 | private:
20 | static Setting m_setting;
21 | };
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Sticky Notes | 贴纸便签
6 |
7 | 这是一个 Windows 桌面应用,可以用来记录你的工作事项,然后钉在桌面上,随时可以查看修改。不需要修改的时候,可以完全成为桌面上一个半透明的区块,而不会影响到你的工作。
8 |
9 | ## ✨ 功能
10 | 1. 📝 新建便签
11 | 2. 📌 钉在桌面上
12 |
13 | ## 使用方法
14 | 1. 下载 [Sticky Notes](https://github.com/imlinhanchao/sticky_notes/releases)。
15 | 2. 运行 `Notes.exe`。
16 | 3. 按下快捷键 `Win + Shift + F8` 新建便签。
17 | 4. 写上你的工作事项,然后按下 `Ctrl + Enter` 添加。
18 | 5. 完成编写后,点击便签右上角的⚪,转为半透明。
19 | 6. 点击便签右上角的🔒,可以锁定便签,然后就无法点击到了。
20 | 7. 需要修改便签内容时,把鼠标移动到便签上,按下快捷键 `Win + Shift + F7`,解锁便签。
21 | 8. 快捷键可以在系统托盘的图标右键菜单 `Setting` 中修改。
22 |
23 | > 使用有任何需求改进,欢迎给我提出 issue ~
24 |
25 |
--------------------------------------------------------------------------------
/Notes/app/NoteConfig.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class CNoteConfig
4 | {
5 | public:
6 | static void LoadNoteGroup(vector &lstName);
7 | static bool GetNoteGroup(CString sName, NoteGroup &group);
8 | static void SetNoteGroup(NoteGroup group);
9 | static bool RenameNoteGroup(CString sOldName, CString sNewName);
10 |
11 | static void LoadSetting(Setting &setting);
12 | static void SaveSetting(Setting setting);
13 | static Setting& GetCurrentSetting();
14 |
15 | static void SearchThemes(vector& lstName);
16 |
17 | static CString NotesDir();
18 |
19 | static CString GetJsonString(rapidjson::GenericValue>& data);
20 |
21 | private:
22 | static Setting m_setting;
23 | };
24 |
25 |
--------------------------------------------------------------------------------
/Notes/app/Note.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class CNote
4 | {
5 | public:
6 | CNote();
7 | CNote(CString sName);
8 | ~CNote(void);
9 |
10 | bool Create(CString sName);
11 | bool Rename(CString sName);
12 | CString GetName();
13 |
14 | NoteGroup& GetNoteGroup();
15 | void SetNoteGroup(NoteGroup group);
16 | void SetNoteItems(vector items);
17 |
18 | void SetNoteItem(NoteItem item, int nIndex, bool bNew = false);
19 | void UpdateRect(CRect rc);
20 | void UpdateOpacity(int nOpacity);
21 | void UpdateOpacityAble(bool bOpacityAble);
22 | void UpdateTopMost(bool bTopMost);
23 | void UpdateBgColor(COLORREF clrBg);
24 | void UpdateTitle(CString sTitle);
25 | void MakeTask(NoteItem item);
26 | void Hide();
27 | void Clear();
28 |
29 | private:
30 | NoteGroup m_noteGroup;
31 | };
32 |
33 |
--------------------------------------------------------------------------------
/Notes/ref/Log.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | typedef enum {
4 | LOG_FILE = 1 << 0,
5 | LOG_PRINT = 1 << 1,
6 | LOG_DEBUG = 1 << 2,
7 | LOG_LIST = 1 << 3,
8 | LOG_ALL = 0xffffff
9 | }LOG_TYPE;
10 |
11 |
12 | class CLogApp
13 | {
14 | public:
15 | CLogApp(void);
16 | ~CLogApp(void);
17 |
18 | static void SetList(CListBox* pList) { m_pListBox = pList; }
19 | static void Init(DWORD dwType, CString sPath=_T(""));
20 | static CString Write(const TCHAR* pszFormat, ...);
21 | static CString Debug(const TCHAR* pszFormat, ...);
22 | static CString Print(const TCHAR* pszFormat, ...);
23 | static CString List(const TCHAR* pszFormat, ...);
24 | static CString WriteFile(const TCHAR* pszFormat, ...);
25 | private:
26 | static CString GetCurDirectory();
27 |
28 | static DWORD m_dwLogType;
29 | static CString m_sPath;
30 | static CListBox* m_pListBox;
31 | };
32 |
--------------------------------------------------------------------------------
/themes/default/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
{{ msg }}
10 |
11 | You’ve successfully created a project with
12 | Vite +
13 | Vue 3. What's next?
14 |
15 |
16 |
17 |
18 |
41 |
--------------------------------------------------------------------------------
/themes/simple/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
{{ msg }}
10 |
11 | You’ve successfully created a project with
12 | Vite +
13 | Vue 3. What's next?
14 |
15 |
16 |
17 |
18 |
41 |
--------------------------------------------------------------------------------
/Notes/ref/HotKey.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Easy {
4 |
5 | typedef void (CALLBACK* HOTKEYCALLBACK)(LPVOID lpParam);
6 | typedef struct _HOTKEY_CALL
7 | {
8 | HOTKEYCALLBACK callback;
9 | LPVOID lpParam;
10 | } HOTKEY_CALL, *PHOTKEY_CALL;
11 |
12 | class CHotKey
13 | {
14 | public:
15 | CHotKey(void);
16 | ~CHotKey(void);
17 |
18 | static bool SetWithCall(DWORD dwHotKey, HOTKEYCALLBACK pCallback, LPVOID lpParam, HWND hWnd = NULL);
19 | static bool RemoveHotKey(DWORD dwHotKey, HWND hWnd = NULL);
20 | static bool SetHotKey(DWORD dwHotKey, HWND hWnd = NULL);
21 | static CString GetHotKeyName(DWORD dwHotKey);
22 | static USHORT GetHotKeyCode(CString sHotKey);
23 |
24 | static void Execute(DWORD dwHotKey);
25 |
26 | protected:
27 | static UINT GetModifiers(DWORD dwHotKey);
28 | static bool IsExtendedKey(DWORD vKey);
29 |
30 | static map m_HotKeyCallback;
31 | };
32 |
33 | }
--------------------------------------------------------------------------------
/themes/default/src/main.ts:
--------------------------------------------------------------------------------
1 | import { library } from "@fortawesome/fontawesome-svg-core";
2 | import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
3 | import { fas } from "@fortawesome/free-solid-svg-icons";
4 | import { far } from "@fortawesome/free-regular-svg-icons";
5 | import { fab } from "@fortawesome/free-brands-svg-icons";
6 | import ElementPlus from "element-plus";
7 | import "./themes/style.scss";
8 | import "element-plus/dist/index.css";
9 | import "element-plus/theme-chalk/dark/css-vars.css";
10 |
11 | import { createApp } from 'vue'
12 | import { createPinia } from 'pinia'
13 |
14 | import App from './App.vue'
15 | import router from './router'
16 |
17 | library.add(fas)
18 | library.add(far)
19 | library.add(fab)
20 |
21 | const app = createApp(App)
22 | app.use(createPinia())
23 | app.component("font-awesome-icon", FontAwesomeIcon)
24 | app.use(router);
25 | app.use(ElementPlus).mount('#app')
26 |
--------------------------------------------------------------------------------
/themes/simple/src/main.ts:
--------------------------------------------------------------------------------
1 | import { library } from "@fortawesome/fontawesome-svg-core";
2 | import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
3 | import { fas } from "@fortawesome/free-solid-svg-icons";
4 | import { far } from "@fortawesome/free-regular-svg-icons";
5 | import { fab } from "@fortawesome/free-brands-svg-icons";
6 | import ElementPlus from "element-plus";
7 | import "./themes/style.scss";
8 | import "element-plus/dist/index.css";
9 | import "element-plus/theme-chalk/dark/css-vars.css";
10 |
11 | import { createApp } from 'vue'
12 | import { createPinia } from 'pinia'
13 |
14 | import App from './App.vue'
15 | import router from './router'
16 |
17 | library.add(fas)
18 | library.add(far)
19 | library.add(fab)
20 |
21 | const app = createApp(App)
22 | app.use(createPinia())
23 | app.component("font-awesome-icon", FontAwesomeIcon)
24 | app.use(router);
25 | app.use(ElementPlus).mount('#app')
26 |
--------------------------------------------------------------------------------
/themes/simple/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sticky
8 |
28 |
29 |
30 |
31 |

32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/themes/default/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Sticky
8 |
28 |
29 |
30 |
31 |

32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/themes/default/src/components/icons/IconTooling.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/themes/simple/src/components/icons/IconTooling.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
19 |
20 |
--------------------------------------------------------------------------------
/Notes/ref/Cvt.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define _ttof _tstof
4 |
5 | namespace Easy {
6 |
7 | class Cvt
8 | {
9 | public:
10 | static COleDateTime ToDateTime(CString sDateTime); // 'YYYY-MM-DD HH:mm:SS' -> DateTime
11 |
12 | static CString ToString(bool bValue); // true -> '1'; false -> '0';
13 | static CString ToString(int nValue);
14 | static CString ToString(long nValue);
15 | static CString ToString(UINT nValue);
16 | static CString ToString(DWORD dwValue);
17 | static CString ToString(float fValue, int nPrecision=0); // P=0 -> No limited; P=1 -> '0.0'; P=2 -> '0.00'; ...
18 | static CString ToString(double fValue, int nPrecision=0);
19 | static CString ToString(COleDateTime date); // DateTime -> 'YYYY-MM-DD HH:mm:SS'
20 | static CString ToString(const TCHAR* pszFormat, ...);
21 | static CString ToString(CTime time, CString sFormat=_T("%Y-%m-%d %H:%M:%S"));
22 | static vector SplitString(CString sData, CString sSp);
23 | static CString ToHex(COLORREF color);
24 | static COLORREF ToColor(CString sHex);
25 |
26 | };
27 |
28 | }
--------------------------------------------------------------------------------
/Notes/control/HotKeyEdit.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "afxwin.h"
3 |
4 | class CHotKeyEdit : public CEdit
5 | {
6 | public:
7 | CHotKeyEdit(void);
8 | ~CHotKeyEdit(void);
9 |
10 | enum { SHIFT = 1, CONTROL= 2, ALT = 4, WIN = 8 };
11 |
12 | void SetSingleKey(bool bSingle, bool bHotKey=false);
13 |
14 | private:
15 | afx_msg void OnRawInput(UINT nInputcode, HRAWINPUT hRawInput);
16 | afx_msg void OnEnSetfocus();
17 | afx_msg void OnEnKillfocus();
18 | afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
19 | afx_msg void OnTimer(UINT_PTR nIDEvent);
20 | virtual BOOL PreTranslateMessage(MSG* pMsg);
21 |
22 | DECLARE_MESSAGE_MAP()
23 |
24 | void PushKey(USHORT vKeyCode);
25 | void PopKey( USHORT vKeyCode );
26 | void ShowKeys(void);
27 | bool IsExtendKey(USHORT vKeyCode);
28 |
29 | USHORT m_uKeyCode;
30 | bool m_bSingleKey;
31 | bool m_bHotKey;
32 | bool m_bRecord;
33 | USHORT m_uExtendKey;
34 |
35 | public:
36 | static DWORD GetHotKeyByString(CString sHotKey);
37 | void SetHotKey(DWORD dwHotKey);
38 | DWORD GetHotKey(void);
39 | };
40 |
41 |
--------------------------------------------------------------------------------
/themes/default/src/components/icons/IconCommunity.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/themes/simple/src/components/icons/IconCommunity.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/themes/simple/src/components/icons/IconDocumentation.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/themes/default/src/components/icons/IconDocumentation.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/Notes/ref/RawInput.cpp:
--------------------------------------------------------------------------------
1 | #include "StdAfx.h"
2 | #include "RawInput.h"
3 |
4 | namespace Easy {
5 |
6 | CRawInput::CRawInput()
7 | {
8 |
9 | }
10 |
11 | CRawInput::~CRawInput()
12 | {
13 |
14 | }
15 |
16 | bool CRawInput::SetRawInput(HWND hWnd, WORD wRawType, bool bRegister)
17 | {
18 | RAWINPUTDEVICE rid[3];
19 | memset (rid, 0, sizeof (rid));
20 |
21 | int n = 0;
22 |
23 | if (RAW_TYPE_HID & wRawType)
24 | {
25 | rid[n].usUsagePage = 0xFF00;
26 | rid[n].usUsage = 0x01;
27 | rid[n].dwFlags = bRegister ? RIDEV_INPUTSINK : RIDEV_REMOVE;
28 | rid[n].hwndTarget = bRegister ? hWnd : NULL;
29 | n++;
30 | }
31 |
32 | if (RAW_TYPE_KB & wRawType)
33 | {
34 | rid[n].usUsagePage = 0x01;
35 | rid[n].usUsage = 0x06;
36 | rid[n].dwFlags = bRegister ? RIDEV_INPUTSINK | RIDEV_NOHOTKEYS : RIDEV_REMOVE;
37 | rid[n].hwndTarget = bRegister ? hWnd : NULL;
38 | n++;
39 | }
40 |
41 | if (RAW_TYPE_MS & wRawType)
42 | {
43 | rid[n].usUsagePage = 0x01;
44 | rid[n].usUsage = 0x02;
45 | rid[n].dwFlags = bRegister ? RIDEV_INPUTSINK : RIDEV_REMOVE;
46 | rid[n].hwndTarget = bRegister ? hWnd : NULL;
47 | n++;
48 | }
49 |
50 | return RegisterRawInputDevices(rid, n, sizeof (RAWINPUTDEVICE)) == TRUE; // Register listen device input
51 | }
52 |
53 | bool CRawInput::Register( HWND hWnd, WORD wRawType )
54 | {
55 | return SetRawInput(hWnd, wRawType, true);
56 | }
57 |
58 | bool CRawInput::Remove( HWND hWnd, WORD wRawType )
59 | {
60 | return SetRawInput(hWnd, wRawType, false);
61 | }
62 |
63 | }
--------------------------------------------------------------------------------
/Notes/ref/XFile.cpp:
--------------------------------------------------------------------------------
1 | #include "stdafx.h"
2 | #include "XFile.h"
3 |
4 | namespace Easy {
5 |
6 | bool XFile::ReadFile(CString sFile, CString& data)
7 | {
8 | CFile file;
9 |
10 | if (!file.Open(sFile, CFile::modeRead))
11 | {
12 | return false;
13 | }
14 |
15 | data = _T("");
16 |
17 | int nLen = file.GetLength() + 1;
18 | char* utf8Buf = new char[nLen];
19 | ZeroMemory(utf8Buf, nLen);
20 |
21 | file.Read(utf8Buf, nLen - 1);
22 |
23 | MultiByteToWideChar(CP_UTF8, 0, utf8Buf, -1, data.GetBuffer(nLen), nLen);
24 | data.ReleaseBuffer();
25 |
26 | file.Close();
27 | return true;
28 | }
29 |
30 | bool XFile::WriteFile(CString sFile, CString data)
31 | {
32 | CFile file;
33 |
34 | if (!file.Open(sFile, CFile::modeCreate | CFile::modeWrite))
35 | {
36 | return false;
37 | }
38 |
39 | int nLen = WideCharToMultiByte(CP_UTF8, 0, data, -1, NULL, 0, NULL, NULL);
40 | char* utf8Buf = new char[nLen];
41 | WideCharToMultiByte(CP_UTF8, 0, data, -1, utf8Buf, nLen, NULL, NULL);
42 |
43 | file.Write(utf8Buf, (nLen - 1) * sizeof(char));
44 | data.ReleaseBuffer();
45 |
46 | file.Close();
47 | return true;
48 | }
49 |
50 | bool XFile::AppendFile(CString sFile, CString data)
51 | {
52 | CStdioFile file;
53 |
54 | if (!file.Open(sFile, CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite))
55 | {
56 | return false;
57 | }
58 |
59 | file.SeekToEnd();
60 | file.Write(data.GetBuffer(), data.GetLength() * sizeof(TCHAR));
61 | data.ReleaseBuffer();
62 |
63 | file.Close();
64 | return true;
65 | }
66 |
67 | }
--------------------------------------------------------------------------------
/themes/default/src/components/WelcomeItem.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
87 |
--------------------------------------------------------------------------------
/themes/simple/src/components/WelcomeItem.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
87 |
--------------------------------------------------------------------------------
/themes/default/README.md:
--------------------------------------------------------------------------------
1 | # notes
2 |
3 | This template should help get you started developing with Vue 3 in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8 |
9 | ## Type Support for `.vue` Imports in TS
10 |
11 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
12 |
13 | If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
14 |
15 | 1. Disable the built-in TypeScript Extension
16 | 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17 | 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18 | 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19 |
20 | ## Customize configuration
21 |
22 | See [Vite Configuration Reference](https://vitejs.dev/config/).
23 |
24 | ## Project Setup
25 |
26 | ```sh
27 | npm install
28 | ```
29 |
30 | ### Compile and Hot-Reload for Development
31 |
32 | ```sh
33 | npm run dev
34 | ```
35 |
36 | ### Type-Check, Compile and Minify for Production
37 |
38 | ```sh
39 | npm run build
40 | ```
41 |
42 | ### Lint with [ESLint](https://eslint.org/)
43 |
44 | ```sh
45 | npm run lint
46 | ```
47 |
--------------------------------------------------------------------------------
/themes/default/src/themes/app.scss:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | color: var(--el-text-color-primary);
5 | background-color: var(--background-color);
6 | }
7 |
8 | #app {
9 | height: 100vh;
10 | .el-textarea {
11 | --el-input-bg-color: transparent;
12 | font-size: 16px;
13 | --el-input-border-color: transparent;
14 | --el-input-hover-border-color: transparent;
15 | --el-input-focus-border-color: transparent;
16 | }
17 |
18 | .el-button {
19 | --el-button-text-color: var(--el-text-color-primary);
20 | font-size: inherit;
21 | }
22 |
23 | .el-checkbox__inner {
24 | border-color: var(--el-text-color-primary);
25 | background-color: transparent;
26 | border-width: 2px;
27 | }
28 | .el-checkbox__input.is-checked .el-checkbox__inner {
29 | background-color: var(--el-text-color-primary);
30 | border-color: var(--el-text-color-primary);;
31 | &::after {
32 | border-color: var(--background-color);
33 | }
34 | }
35 |
36 | .el-color-picker__trigger {
37 | border: none;
38 | .el-color-picker__color {
39 | border-color: var(--el-text-color-primary);
40 | .el-color-picker__icon {
41 | color: var(--el-text-color-primary);
42 | }
43 | }
44 | }
45 |
46 | .el-input.no-border {
47 | --el-input-bg-color: transparent;
48 | --el-input-border-color: transparent;
49 | --el-input-hover-border-color: transparent;
50 | --el-input-focus-border-color: transparent;
51 | }
52 | }
53 |
54 |
55 | ::-webkit-scrollbar {
56 | width: 7px;
57 | height: 7px;
58 | }
59 |
60 | ::-webkit-scrollbar-thumb {
61 | background: #FFF;
62 | }
63 |
64 | :root {
65 | --background-color: #fff;
66 | }
67 |
68 | @media (prefers-color-scheme: dark) {
69 | :root {
70 | --background-color: #0b0f14;
71 | }
72 | }
73 |
74 | .drag-ghost {
75 | opacity: 0.5;
76 | }
--------------------------------------------------------------------------------
/themes/simple/README.md:
--------------------------------------------------------------------------------
1 | # notes
2 |
3 | This template should help get you started developing with Vue 3 in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
8 |
9 | ## Type Support for `.vue` Imports in TS
10 |
11 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
12 |
13 | If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
14 |
15 | 1. Disable the built-in TypeScript Extension
16 | 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17 | 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18 | 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
19 |
20 | ## Customize configuration
21 |
22 | See [Vite Configuration Reference](https://vitejs.dev/config/).
23 |
24 | ## Project Setup
25 |
26 | ```sh
27 | npm install
28 | ```
29 |
30 | ### Compile and Hot-Reload for Development
31 |
32 | ```sh
33 | npm run dev
34 | ```
35 |
36 | ### Type-Check, Compile and Minify for Production
37 |
38 | ```sh
39 | npm run build
40 | ```
41 |
42 | ### Lint with [ESLint](https://eslint.org/)
43 |
44 | ```sh
45 | npm run lint
46 | ```
47 |
--------------------------------------------------------------------------------
/themes/simple/src/themes/app.scss:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | color: var(--el-text-color-primary);
5 | background-color: transparent;
6 | }
7 |
8 | #app {
9 | height: 100vh;
10 | .el-textarea {
11 | --el-input-bg-color: transparent;
12 | font-size: 16px;
13 | --el-input-border-color: transparent;
14 | --el-input-hover-border-color: transparent;
15 | --el-input-focus-border-color: transparent;
16 | }
17 |
18 | .el-button {
19 | --el-button-text-color: var(--el-text-color-primary);
20 | font-size: inherit;
21 | }
22 |
23 | .el-checkbox__inner {
24 | border-color: var(--el-text-color-primary);
25 | background-color: transparent;
26 | border-width: 2px;
27 | }
28 | .el-checkbox__input.is-checked .el-checkbox__inner {
29 | background-color: var(--el-text-color-primary);
30 | border-color: var(--el-text-color-primary);;
31 | &::after {
32 | border-color: var(--background-color);
33 | }
34 | }
35 |
36 | .el-color-picker__trigger {
37 | border: none;
38 | .el-color-picker__color {
39 | border-color: var(--el-text-color-primary);
40 | .el-color-picker__icon {
41 | color: var(--el-text-color-primary);
42 | }
43 | }
44 | }
45 |
46 | .el-input.no-border {
47 | --el-input-bg-color: transparent;
48 | --el-input-border-color: transparent;
49 | --el-input-hover-border-color: transparent;
50 | --el-input-focus-border-color: transparent;
51 | }
52 | }
53 |
54 |
55 | ::-webkit-scrollbar {
56 | width: 7px;
57 | height: 7px;
58 | }
59 |
60 | ::-webkit-scrollbar-thumb {
61 | background: #FFF;
62 | }
63 |
64 | .drag-ghost {
65 | opacity: 0.5;
66 | }
67 |
68 | .hidden-unlock {
69 | display: none;
70 | }
71 |
72 | .mouse-lock {
73 | .hidden-lock {
74 | display: none;
75 | }
76 | .hidden-unlock {
77 | display: block;
78 | }
79 | }
--------------------------------------------------------------------------------
/themes/default/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "notes",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "run-p type-check build-only",
8 | "preview": "vite preview",
9 | "build-only": "vite build",
10 | "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
11 | "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
12 | "format": "prettier --write src/"
13 | },
14 | "dependencies": {
15 | "@element-plus/icons-vue": "^2.1.0",
16 | "@fortawesome/fontawesome-svg-core": "^6.4.0",
17 | "@fortawesome/free-brands-svg-icons": "^6.4.0",
18 | "@fortawesome/free-regular-svg-icons": "^6.4.0",
19 | "@fortawesome/free-solid-svg-icons": "^6.4.0",
20 | "@fortawesome/vue-fontawesome": "^3.0.3",
21 | "@types/marked": "^5.0.0",
22 | "@vitejs/plugin-legacy": "^4.0.4",
23 | "@vueuse/core": "^10.1.2",
24 | "element-plus": "^2.3.5",
25 | "marked": "^5.0.4",
26 | "pinia": "^2.0.36",
27 | "sass": "^1.62.1",
28 | "scss-loader": "^0.0.1",
29 | "terser": "^5.17.7",
30 | "vue": "^3.3.2",
31 | "vue-router": "^4.2.0",
32 | "vuedraggable": "^4.1.0"
33 | },
34 | "devDependencies": {
35 | "@rushstack/eslint-patch": "^1.2.0",
36 | "@tsconfig/node18": "^2.0.1",
37 | "@types/node": "^18.16.8",
38 | "@vitejs/plugin-vue": "^4.2.3",
39 | "@vue/eslint-config-prettier": "^7.1.0",
40 | "@vue/eslint-config-typescript": "^11.0.3",
41 | "@vue/tsconfig": "^0.4.0",
42 | "autoprefixer": "^10.4.14",
43 | "eslint": "^8.39.0",
44 | "eslint-plugin-vue": "^9.11.0",
45 | "npm-run-all": "^4.1.5",
46 | "postcss": "^8.4.24",
47 | "prettier": "^2.8.8",
48 | "tailwindcss": "^3.3.2",
49 | "typescript": "~5.0.4",
50 | "vite": "^4.3.5",
51 | "vue-tsc": "^1.6.4"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/themes/simple/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "notes",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "vite",
7 | "build": "run-p type-check build-only",
8 | "preview": "vite preview",
9 | "build-only": "vite build",
10 | "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
11 | "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
12 | "format": "prettier --write src/"
13 | },
14 | "dependencies": {
15 | "@element-plus/icons-vue": "^2.1.0",
16 | "@fortawesome/fontawesome-svg-core": "^6.4.0",
17 | "@fortawesome/free-brands-svg-icons": "^6.4.0",
18 | "@fortawesome/free-regular-svg-icons": "^6.4.0",
19 | "@fortawesome/free-solid-svg-icons": "^6.4.0",
20 | "@fortawesome/vue-fontawesome": "^3.0.3",
21 | "@types/marked": "^5.0.0",
22 | "@vitejs/plugin-legacy": "^4.0.4",
23 | "@vueuse/core": "^10.1.2",
24 | "element-plus": "^2.3.5",
25 | "marked": "^5.0.4",
26 | "pinia": "^2.0.36",
27 | "sass": "^1.62.1",
28 | "scss-loader": "^0.0.1",
29 | "terser": "^5.17.7",
30 | "vue": "^3.3.2",
31 | "vue-router": "^4.2.0",
32 | "vuedraggable": "^4.1.0"
33 | },
34 | "devDependencies": {
35 | "@rushstack/eslint-patch": "^1.2.0",
36 | "@tsconfig/node18": "^2.0.1",
37 | "@types/node": "^18.16.8",
38 | "@vitejs/plugin-vue": "^4.2.3",
39 | "@vue/eslint-config-prettier": "^7.1.0",
40 | "@vue/eslint-config-typescript": "^11.0.3",
41 | "@vue/tsconfig": "^0.4.0",
42 | "autoprefixer": "^10.4.14",
43 | "eslint": "^8.39.0",
44 | "eslint-plugin-vue": "^9.11.0",
45 | "npm-run-all": "^4.1.5",
46 | "postcss": "^8.4.24",
47 | "prettier": "^2.8.8",
48 | "tailwindcss": "^3.3.2",
49 | "typescript": "~5.0.4",
50 | "vite": "^4.3.5",
51 | "vue-tsc": "^1.6.4"
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Notes.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.6.33723.286
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Notes", "Notes\Notes.vcxproj", "{6769A8F9-CF54-47BB-8262-FE3D739E79AB}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Win32 = Debug|Win32
11 | Debug|x64 = Debug|x64
12 | DebugHttp|Win32 = DebugHttp|Win32
13 | DebugHttp|x64 = DebugHttp|x64
14 | Release|Win32 = Release|Win32
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Debug|Win32.ActiveCfg = Debug|Win32
19 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Debug|Win32.Build.0 = Debug|Win32
20 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Debug|x64.ActiveCfg = Debug|x64
21 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Debug|x64.Build.0 = Debug|x64
22 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.DebugHttp|Win32.ActiveCfg = DebugHttp|Win32
23 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.DebugHttp|Win32.Build.0 = DebugHttp|Win32
24 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.DebugHttp|x64.ActiveCfg = DebugHttp|x64
25 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.DebugHttp|x64.Build.0 = DebugHttp|x64
26 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Release|Win32.ActiveCfg = Release|Win32
27 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Release|Win32.Build.0 = Release|Win32
28 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Release|x64.ActiveCfg = Release|x64
29 | {6769A8F9-CF54-47BB-8262-FE3D739E79AB}.Release|x64.Build.0 = Release|x64
30 | EndGlobalSection
31 | GlobalSection(SolutionProperties) = preSolution
32 | HideSolutionNode = FALSE
33 | EndGlobalSection
34 | GlobalSection(ExtensibilityGlobals) = postSolution
35 | SolutionGuid = {F49CC348-7203-46C4-9085-BA9779C913EF}
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/themes/default/src/components/icons/IconEcosystem.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/themes/simple/src/components/icons/IconEcosystem.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/Notes/NotesDlg.h:
--------------------------------------------------------------------------------
1 |
2 | // NotesDlg.h : header file
3 | //
4 |
5 | #pragma once
6 | #include "control/HotKeyEdit.h"
7 |
8 | // CNotesDlg dialog
9 | class CNotesDlg : public CDialogEx
10 | {
11 | // Construction
12 | public:
13 | CNotesDlg(CWnd* pParent = NULL); // standard constructor
14 |
15 | // Dialog Data
16 | enum { IDD = IDD_NOTES_DIALOG, WM_TRAYICON = WM_USER + 100 };
17 |
18 | protected:
19 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
20 |
21 |
22 | // Implementation
23 | protected:
24 | HICON m_hIcon;
25 |
26 | // Generated message map functions
27 | virtual BOOL OnInitDialog();
28 | virtual BOOL PreTranslateMessage(MSG* pMsg);
29 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
30 | afx_msg void OnPaint();
31 | afx_msg HCURSOR OnQueryDragIcon();
32 | afx_msg void OnClose();
33 | afx_msg LRESULT OnTrayIcon(WPARAM wParam, LPARAM lParam);
34 | afx_msg void OnNew();
35 | afx_msg void OnHideall();
36 | afx_msg void OnShowall();
37 | afx_msg void OnShow();
38 | afx_msg void OnQuit();
39 | afx_msg void OnBnClickedBtnBrowse();
40 | afx_msg void OnBnClickedOk();
41 | virtual void OnCancel();
42 |
43 | DECLARE_MESSAGE_MAP()
44 |
45 | void Init();
46 | void InitSetting(Setting setting);
47 | Setting ReadSetting();
48 | void SetHotKey(Setting setting);
49 | void ClearHotKey(Setting setting);
50 | void SetTrayIcon();
51 | void SetWindownAlpha(float fAlpha);
52 | bool ShowInTaskbar(HWND hWnd, bool isShow);
53 |
54 | CHotKeyEdit m_ActiveHKey;
55 | CHotKeyEdit m_UnActiveHKey;
56 | CHotKeyEdit m_ActiveAllHKey;
57 | CHotKeyEdit m_NewHKey;
58 | CMenu m_MenuTray;
59 | NOTIFYICONDATA m_nid;
60 |
61 | HANDLE m_Instance;
62 | public:
63 | static bool m_bIsNoticeRuntime;
64 | static CAppCtrl m_ctrl;
65 | Setting m_setting;
66 | afx_msg void OnDestroy();
67 | afx_msg void OnBnClickedBtnBrowseRuntime();
68 | afx_msg void OnMenuThroughAllOn();
69 | afx_msg void OnMenuThroughAllOff();
70 | };
71 |
--------------------------------------------------------------------------------
/Notes/NoteDlg.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 |
4 | // CNoteDlg dialog
5 |
6 | class CNoteDlg : public CDialogEx
7 | {
8 | DECLARE_DYNAMIC(CNoteDlg)
9 |
10 | public:
11 | CNoteDlg(CWnd* pParent = NULL); // standard constructor
12 | virtual ~CNoteDlg();
13 |
14 | // Dialog Data
15 | enum { IDD = IDD_DLG_NOTE };
16 |
17 | protected:
18 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
19 | virtual BOOL OnInitDialog();
20 | afx_msg void OnSize(UINT nType, int cx, int cy);
21 | afx_msg LRESULT OnNcHitTest(CPoint point);
22 | afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
23 | afx_msg BOOL OnEraseBkgnd(CDC* pDC);
24 | afx_msg void OnPaint();
25 | afx_msg void OnRawInput(UINT nInputcode, HRAWINPUT hRawInput);
26 | afx_msg void OnMove(int x, int y);
27 |
28 | DECLARE_MESSAGE_MAP()
29 |
30 | void Init();
31 |
32 | void SendNoteItems();
33 | void SendNoteSetting();
34 | void SendMouseThrough();
35 |
36 | void InitWebView();
37 | HRESULT OnCreateEnvironmentCompleted(HRESULT result, ICoreWebView2Environment* environment);
38 | HRESULT OnCreateCoreWebView2ControllerCompleted(HRESULT result, ICoreWebView2Controller* controller);
39 | HRESULT OnWebMessageReceived(ICoreWebView2* webview, ICoreWebView2WebMessageReceivedEventArgs* args);
40 | HRESULT OnDocumentReady(ICoreWebView2* webview, ICoreWebView2NavigationCompletedEventArgs* args);
41 |
42 | void SendMessageToWeb(CString sEvent, rapidjson::GenericValue>& data, Document::AllocatorType& allocator);
43 | void ExecuteScript(CString sJavascript, ICoreWebView2ExecuteScriptCompletedHandler* handler);
44 | const TCHAR* GetDocumentReadyJavascript();
45 | void OnMouseMoving(CPoint pt);
46 |
47 | private:
48 | Microsoft::WRL::ComPtr m_webViewEnvironment;
49 | Microsoft::WRL::ComPtr m_controller;
50 | Microsoft::WRL::ComPtr m_webView;
51 | CBrush m_brush;
52 | bool m_bMoveWindow;
53 | CRect m_BeginMoveRect;
54 | CPoint m_BeginMovePoint;
55 |
56 | public:
57 | CNote m_Note;
58 |
59 | void SetWindownAlpha(float fAlpha);
60 | void SetMouseThrough(bool bThought);
61 | bool IsMouseThrough();
62 | };
63 |
--------------------------------------------------------------------------------
/Notes/ref/Registry.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Easy {
4 |
5 | class Registry
6 | {
7 | public:
8 | Registry();
9 | Registry(HKEY hKey, bool bWOW6432 = false);
10 |
11 | void Init(HKEY hKey, bool bWOW6432 = false);
12 | bool IsExisted(CString sSubKey);
13 | bool CreateKey(CString sSubKey);
14 | bool DeleteKey(CString sSubKey);
15 |
16 | bool DeleteValue(CString sSubKey, CString sValueName);
17 |
18 | bool Read(CString sSubKey, CString sValueName, int& nValue);
19 | bool Read(CString sSubKey, CString sValueName, bool& bValue);
20 | bool Read(CString sSubKey, CString sValueName, UINT& nValue);
21 | bool Read(CString sSubKey, CString sValueName, long& nValue);
22 | bool Read(CString sSubKey, CString sValueName, DWORD& dwValue);
23 | bool Read(CString sSubKey, CString sValueName, CString& sValue);
24 | bool Read(CString sSubKey, CString sValueName, LPVOID lpData, DWORD& dwDataSize);
25 |
26 | bool Write(CString sSubKey, CString sValueName, int nValue);
27 | bool Write(CString sSubKey, CString sValueName, bool bValue);
28 | bool Write(CString sSubKey, CString sValueName, UINT nValue);
29 | bool Write(CString sSubKey, CString sValueName, long nValue);
30 | bool Write(CString sSubKey, CString sValueName, DWORD dwValue);
31 | bool Write(CString sSubKey, CString sValueName, CString sValue);
32 | bool Write(CString sSubKey, CString sValueName, LPVOID lpData, DWORD dwDataSize, DWORD dwType);
33 |
34 |
35 | /*!
36 | * @brief GetLastError
37 | *
38 | * Get the last error code
39 | * @return DWORD the error code
40 | */
41 | DWORD GetLastError();
42 |
43 | /*!
44 | * @brief GetLastErrorMsg
45 | *
46 | * Get the last error message
47 | * @return CString the error message
48 | */
49 | CString GetLastErrorMsg();
50 |
51 | private:
52 |
53 | /*!
54 | * @brief FormatLastError
55 | *
56 | * format the last error code to string
57 | * @param dwLastError the error code want to format
58 | * @return CString the error message
59 | */
60 | CString FormatLastError(DWORD dwLastError);
61 |
62 | CString m_sLastError;
63 | DWORD m_nLastError;
64 |
65 | HKEY m_hKey;
66 | DWORD m_dwWOW6432;
67 | };
68 |
69 | }
--------------------------------------------------------------------------------
/setup.iss:
--------------------------------------------------------------------------------
1 | ; Script generated by the Inno Setup Script Wizard.
2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3 |
4 | #define MyAppName "Sticky Note"
5 | #define MyAppVersion "1.1.2"
6 | #define MyAppPublisher "Hancel.Lin"
7 | #define MyAppURL "https://github.com/imlinhanchao/sticky_notes"
8 | #define MyAppExeName "Notes.exe"
9 |
10 | [Setup]
11 | ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13 | AppId={{CD1E65B4-0A4C-4853-B4EA-F447CD00B780}
14 | AppName={#MyAppName}
15 | AppVersion={#MyAppVersion}
16 | AppVerName={#MyAppName}
17 | AppPublisher={#MyAppPublisher}
18 | AppPublisherURL={#MyAppURL}
19 | AppSupportURL={#MyAppURL}
20 | AppUpdatesURL={#MyAppURL}
21 | DefaultDirName={autopf}\StickyNotes
22 | UninstallDisplayIcon={app}\unins000.exe
23 | DisableProgramGroupPage=yes
24 | LicenseFile=LICENSE
25 | ; Remove the following line to run in administrative install mode (install for all users.)
26 | PrivilegesRequired=lowest
27 | PrivilegesRequiredOverridesAllowed=dialog
28 | OutputDir=output
29 | OutputBaseFilename=Sticky.Notes.{#MyAppVersion}
30 | SetupIconFile=setup.ico
31 | Compression=lzma
32 | SolidCompression=yes
33 | WizardStyle=modern
34 |
35 | [Languages]
36 | Name: "english"; MessagesFile: "compiler:Default.isl"
37 |
38 | [Tasks]
39 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
40 |
41 | [Files]
42 | Source: "Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
43 | Source: "Release\WebView2Loader.dll"; DestDir: "{app}"; Flags: ignoreversion
44 | Source: "themes\default\dist\*"; DestDir: "{app}\themes\Default"; Flags: ignoreversion recursesubdirs createallsubdirs
45 | Source: "themes\simple\dist\*"; DestDir: "{app}\themes\Simple"; Flags: ignoreversion recursesubdirs createallsubdirs
46 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
47 |
48 | [Icons]
49 | Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
50 | Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
51 |
52 | [Run]
53 | Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
54 |
55 | [UninstallDelete]
56 | Type: files; Name: "{userstartup}\setting.ini"
57 | Type: filesandordirs; Name: "{app}\{#MyAppExeName}.WebView2"
--------------------------------------------------------------------------------
/setupx64.iss:
--------------------------------------------------------------------------------
1 | ; Script generated by the Inno Setup Script Wizard.
2 | ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3 |
4 | #define MyAppName "Sticky Note"
5 | #define MyAppVersion "1.1.2"
6 | #define MyAppPublisher "Hancel.Lin"
7 | #define MyAppURL "https://github.com/imlinhanchao/sticky_notes"
8 | #define MyAppExeName "Notes.exe"
9 |
10 | [Setup]
11 | ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12 | ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13 | AppId={{CD1E65B4-0A4C-4853-B4EA-F447CD00B780}
14 | AppName={#MyAppName}
15 | AppVersion={#MyAppVersion}
16 | AppVerName={#MyAppName}
17 | AppPublisher={#MyAppPublisher}
18 | AppPublisherURL={#MyAppURL}
19 | AppSupportURL={#MyAppURL}
20 | AppUpdatesURL={#MyAppURL}
21 | DefaultDirName={autopf}\StickyNotes
22 | UninstallDisplayIcon={app}\unins000.exe
23 | DisableProgramGroupPage=yes
24 | LicenseFile=LICENSE
25 | ; Remove the following line to run in administrative install mode (install for all users.)
26 | PrivilegesRequired=lowest
27 | PrivilegesRequiredOverridesAllowed=dialog
28 | OutputDir=output
29 | OutputBaseFilename=Sticky.Notes.{#MyAppVersion}.x64
30 | SetupIconFile=setup.ico
31 | Compression=lzma
32 | SolidCompression=yes
33 | WizardStyle=modern
34 |
35 | [Languages]
36 | Name: "english"; MessagesFile: "compiler:Default.isl"
37 |
38 | [Tasks]
39 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
40 |
41 | [Files]
42 | Source: "x64\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
43 | Source: "x64\Release\WebView2Loader.dll"; DestDir: "{app}"; Flags: ignoreversion
44 | Source: "themes\default\dist\*"; DestDir: "{app}\themes\Default"; Flags: ignoreversion recursesubdirs createallsubdirs
45 | Source: "themes\simple\dist\*"; DestDir: "{app}\themes\Simple"; Flags: ignoreversion recursesubdirs createallsubdirs
46 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
47 |
48 | [Icons]
49 | Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
50 | Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
51 |
52 | [Run]
53 | Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
54 |
55 | [UninstallDelete]
56 | Type: files; Name: "{userstartup}\setting.ini"
57 | Type: filesandordirs; Name: "{app}\{#MyAppExeName}.WebView2"
--------------------------------------------------------------------------------
/Notes/ref/Shell.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Easy {
4 |
5 | class Shell
6 | {
7 | public:
8 | Shell(void);
9 | ~Shell(void);
10 |
11 | typedef enum SHELL_TYPE { CONSOLE = 0, APP };
12 |
13 | /*!
14 | * @brief Execute
15 | *
16 | * Execute a program
17 | * @param sPath The path of program.
18 | * @param sCommand The command line with program
19 | * @param type The type of program to execute
20 | * @param bShow Show the program window or not. Not work for all program.
21 | * @return bool Execute success or not
22 | */
23 | bool Execute(CString sPath, CString sCommand=_T(""), SHELL_TYPE type=APP, bool bShow=true, CString sWorkDirectory=_T(""));
24 |
25 | /*!
26 | * @brief IsRunning
27 | *
28 | * Is the program running
29 | * @return bool True means running, false was not.
30 | */
31 | bool IsRunning(void);
32 |
33 | /*!
34 | * @brief Stop
35 | *
36 | * Stop run the program.
37 | * @return bool Stop success or not
38 | */
39 | bool Stop(void);
40 |
41 | /*!
42 | * @brief GetOutput
43 | *
44 | * Get the program output, work for console application.
45 | * @return CString The output string.
46 | */
47 | CString GetOutput(void);
48 |
49 | /*!
50 | * @brief GetOutput
51 | *
52 | * Get the program window handle.
53 | * @return HWND The window handle.
54 | */
55 | HWND GetWnd(void);
56 |
57 | /*!
58 | * @brief GetLastError
59 | *
60 | * Get the last error code
61 | * @return DWORD the error code
62 | */
63 | DWORD GetLastError();
64 |
65 | /*!
66 | * @brief GetLastErrorMsg
67 | *
68 | * Get the last error message
69 | * @return CString the error message
70 | */
71 | CString GetLastErrorMsg();
72 |
73 | private:
74 | static DWORD WINAPI ShellThread(LPVOID lpParam);
75 | static BOOL WINAPI EnumWindowsProc(HWND hWnd, LPARAM lParam);
76 |
77 | bool ExecuteConsole(CString sPath, CString sCommand, bool bShow, CString sWorkDirectory);
78 | bool ExecuteApplication(CString sPath, CString sCommand, bool bShow, CString sWorkDirectory);
79 |
80 | /*!
81 | * @brief GetSystemError
82 | *
83 | * used to get system error and save it
84 | */
85 | void GetSystemError();
86 |
87 | /*!
88 | * @brief FormatLastError
89 | *
90 | * format the last error code to string
91 | * @param dwLastError the error code want to format
92 | * @return CString the error message
93 | */
94 | CString FormatLastError(DWORD dwLastError);
95 |
96 | CString m_sLastError;
97 | DWORD m_nLastError;
98 |
99 | PROCESS_INFORMATION m_pi;
100 | HANDLE m_hRead;
101 |
102 | bool m_bRunning;
103 | HWND m_hWnd;
104 | CString m_sOutput;
105 | };
106 |
107 | }
108 |
--------------------------------------------------------------------------------
/Notes/Notes.cpp:
--------------------------------------------------------------------------------
1 |
2 | // Notes.cpp : Defines the class behaviors for the application.
3 | //
4 |
5 | #include "stdafx.h"
6 | #include "Notes.h"
7 | #include "NotesDlg.h"
8 |
9 | #ifdef _DEBUG
10 | #define new DEBUG_NEW
11 | #endif
12 |
13 |
14 | // CNotesApp
15 |
16 | BEGIN_MESSAGE_MAP(CNotesApp, CWinApp)
17 | ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
18 | END_MESSAGE_MAP()
19 |
20 |
21 | // CNotesApp construction
22 |
23 | CNotesApp::CNotesApp()
24 | {
25 | // support Restart Manager
26 | m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
27 |
28 | // TODO: add construction code here,
29 | // Place all significant initialization in InitInstance
30 | }
31 |
32 |
33 | // The one and only CNotesApp object
34 |
35 | CNotesApp theApp;
36 |
37 |
38 | // CNotesApp initialization
39 |
40 | BOOL CNotesApp::InitInstance()
41 | {
42 | // InitCommonControlsEx() is required on Windows XP if an application
43 | // manifest specifies use of ComCtl32.dll version 6 or later to enable
44 | // visual styles. Otherwise, any window creation will fail.
45 | INITCOMMONCONTROLSEX InitCtrls;
46 | InitCtrls.dwSize = sizeof(InitCtrls);
47 | // Set this to include all the common control classes you want to use
48 | // in your application.
49 | InitCtrls.dwICC = ICC_WIN95_CLASSES;
50 | InitCommonControlsEx(&InitCtrls);
51 |
52 | CWinApp::InitInstance();
53 |
54 |
55 | AfxEnableControlContainer();
56 |
57 | // Create the shell manager, in case the dialog contains
58 | // any shell tree view or shell list view controls.
59 | CShellManager *pShellManager = new CShellManager;
60 |
61 | // Standard initialization
62 | // If you are not using these features and wish to reduce the size
63 | // of your final executable, you should remove from the following
64 | // the specific initialization routines you do not need
65 | // Change the registry key under which our settings are stored
66 | // TODO: You should modify this string to be something appropriate
67 | // such as the name of your company or organization
68 | SetRegistryKey(_T("Local AppWizard-Generated Applications"));
69 |
70 | CNotesDlg dlg;
71 | m_pMainWnd = &dlg;
72 | INT_PTR nResponse = dlg.DoModal();
73 | if (nResponse == IDOK)
74 | {
75 | // TODO: Place code here to handle when the dialog is
76 | // dismissed with OK
77 | }
78 | else if (nResponse == IDCANCEL)
79 | {
80 | // TODO: Place code here to handle when the dialog is
81 | // dismissed with Cancel
82 | }
83 |
84 | // Delete the shell manager created above.
85 | if (pShellManager != NULL)
86 | {
87 | delete pShellManager;
88 | }
89 |
90 | // Since the dialog has been closed, return FALSE so that we exit the
91 | // application, rather than start the application's message pump.
92 | return FALSE;
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/Notes/stdafx.h:
--------------------------------------------------------------------------------
1 |
2 | // stdafx.h : include file for standard system include files,
3 | // or project specific include files that are used frequently,
4 | // but are changed infrequently
5 |
6 | #pragma once
7 |
8 | #ifndef _SECURE_ATL
9 | #define _SECURE_ATL 1
10 | #endif
11 |
12 | #ifndef VC_EXTRALEAN
13 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
14 | #endif
15 |
16 | #include "targetver.h"
17 |
18 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
19 |
20 | // turns off MFC's hiding of some common and often safely ignored warning messages
21 | #define _AFX_ALL_WARNINGS
22 |
23 | #include // MFC core and standard components
24 | #include // MFC extensions
25 |
26 |
27 | #include // MFC Automation classes
28 |
29 |
30 |
31 | #ifndef _AFX_NO_OLE_SUPPORT
32 | #include // MFC support for Internet Explorer 4 Common Controls
33 | #endif
34 | #ifndef _AFX_NO_AFXCMN_SUPPORT
35 | #include // MFC support for Windows Common Controls
36 | #endif // _AFX_NO_AFXCMN_SUPPORT
37 |
38 | #include // MFC support for ribbons and control bars
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | #ifdef _UNICODE
49 | #if defined _M_IX86
50 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
51 | #elif defined _M_X64
52 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
53 | #else
54 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
55 | #endif
56 | #endif
57 |
58 | #include
59 | #include
60 |
61 | // include WebView2
62 | #include "WebView2.h"
63 |
64 | // include Json
65 | #include "rapidjson/document.h"
66 | #include "rapidjson/writer.h"
67 | #include "rapidjson/stringbuffer.h"
68 |
69 | using namespace rapidjson;
70 |
71 | #include "resource.h"
72 |
73 | #include
74 | #include
75 | #include