HyperV

1
2
3
4
dism.exe /Online /Disable-Feature /FeatureName:Microsoft-Hyper-V-All
# https://www.jianshu.com/p/5f3cb933f9b6
Disable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Message

PeekMessage和GetMessage函数的主要区别

https://blog.csdn.net/gencheng/article/details/9376881

InvalidateRect(HWND) 与 ValidateRect(HWND)的区别

http://t.zoukankan.com/renyuan-p-2746020.html
InvalidateRect标脏(dirty) ValidateRect表示已经处理好可以显示

https://www.codenong.com/62553819/
消息处理必须在WndProc中完成,而不是在”主循环”中完成
https://learn.microsoft.com/zh-cn/windows/win32/learnwin32/closing-the-window

WaitMessage

线程的消息队列中无其它消息时,该函数就将控制权交给另外的线程
https://learn.microsoft.com/zh-cn/windows/win32/api/winuser/nf-winuser-waitmessage

1
2
3
4
5
6
7
8
9
10
11
12
MSG msg;
ZeroMemory(&msg, sizeof(msg));
while (msg.message != WM_QUIT)
{
if (PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
WaitMessage();
}

https://jeffpar.github.io/kbarchive/kb/074/Q74042/
https://github.com/wch/r-source/blob/trunk/src/extra/graphapp/events.c
void waitevent(void)

1
2
3
GetMessage差不多相当于PeekMessage + WaitMessage 🤔
macOS -> nextEventMatchingMask:untilDate:inMode:dequeue:
sendEvent: postEvent:atStart: sendAction:to:from:

MsgWaitForMultipleObjectsEx

https://learn.microsoft.com/zh-cn/windows/win32/api/winuser/nf-winuser-msgwaitformultipleobjectsex

WaitForMultipleObjectsEx

https://learn.microsoft.com/zh-cn/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjectsex
如果你有创建窗口的线程,请使用 MsgWaitForMultipleObjects 或 MsgWaitForMultipleObjectsEx,而不是 WaitForMultipleObjectsEx。

Env

Windows设置环境变量

https://blog.csdn.net/uddiqpl/article/details/126391711

1
2
3
4
5
6
7
8
set/setx/wmic都不合适
reg query HKCU\Environment
reg query HKCU\Environment /v PATH
默认REG_SZ无法被set获取到
setx RUSTUP_DIST_SERVER "https://mirrors.tuna.tsinghua.edu.cn/rustup"
# reg add HKCU\Environment /v RUSTUP_DIST_SERVER /t REG_EXPAND_SZ /d https://mirrors.tuna.tsinghua.edu.cn/rustup/f
reg query HKCU\Environment /v RUSTUP_DIST_SERVER
有点扭曲setx设置 reg delete删除

非Unicode程序的语言

https://www.cnblogs.com/rickerliang/p/3732027.html
https://www.zhihu.com/question/536400200

开启之后msvc cl就不会报936的4819问题 不然需要添加/utf-8标记
https://learn.microsoft.com/zh-cn/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8

http://www.dnxtc.net/zixun/WIN11yingyong/2021-08-16/9360.html
win11家庭版升级专业版详细步骤(多种方法)

https://zhuanlan.zhihu.com/p/540878468