米老虎

个人知识管理系统

C#桌面应用最大化最小化

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
private int WM_SYSCOMMAND = 0x112;
private long SC_MAXIMIZE = 0xF030;
private long SC_MINIMIZE = 0xF020;
private long SC_CLOSE = 0xF060;
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_SYSCOMMAND)
{
if (m.WParam.ToInt64() == SC_MAXIMIZE)
{
//MessageBox.Show("MAXIMIZE ");
return;
}
if (m.WParam.ToInt64() == SC_MINIMIZE)
{
//MessageBox.Show("MINIMIZE ");
return;
}
if (m.WParam.ToInt64() == SC_CLOSE)
{
//MessageBox.Show("CLOSE ");
return;
}
}
base.WndProc(ref m);
}

npm国内源设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
一、修改成淘宝镜像源
1. 命令

npm config set registry https://registry.npm.taobao.org

2. 验证命令

npm config get registry

如果返回https://registry.npm.taobao.org,说明镜像配置成功。

二、修改成华为云镜像源
1. 命令

npm config set registry https://mirrors.huaweicloud.com/repository/npm/

2. 验证命令

npm config get registry

如果返回https://mirrors.huaweicloud.com/repository/npm/,说明镜像配置成功。

三、通过使用淘宝cnpm安装
1. 安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

2. 使用cnpm

cnpm install xxx

windows terminal 右键菜单

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// https://github.com/KUTlime/PowerShell-Open-Here-Module

// 安装
Install-Module -Name OpenHere
Import-Module -Name OpenHere

// 添加
Set-OpenHereShortcut -ShortcutType:WindowsTerminal
Set-OpenHereShortcut -ShortcutType:CMD
Set-OpenHereShortcut -ShortcutType:PowerShellCore

// 自定义
Set-OpenHereShortcut -ShortcutType:WindowsPowerShell`
-RootName 'Old PowerShell' `
-OpenHere 'I''m lazy' `
-OpenHereAsAdmin 'I''m lazy admin

// 删除
Remove-OpenHereShortcut -ShortcutType:WindowsTerminal