Windows应用开发相关
- 开发 Windows 10 应用程序
- 通用 Windows 平台文档
- Publish Windows apps and games
- Windows Presentation Foundation
- Windows Forms
- Direct Machine Learning (DirectML)
- Create an offline installation package of Visual Studio for local installation(直接看这个篇章:Use the command line to create a local layout)
- How to: Enable a 64-Bit, x64 hosted MSVC toolset on the command line(比如:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64 10.0.19041.0
) - 如何用Visual Studio编写并实时预览Markdown文件
- 获取WINDOWS下当前用户路径 USERPROFILE(MS-DOS中回显变量值也是用echo)
- windows上 set 命令的使用
- Detecting architecture at compile time from MASM/MASM64
- How do I render my DirectX C++ engine to a C# Panel?
- Calling Native Functions from Managed Code(Platform Invocation Services, commonly referred to as P/Invoke, is a feature of Common Language Infrastructure implementations, like Microsoft's Common Language Runtime, that enables managed code to call native code.)
- C# – Calling Unmanaged DLL functions from Manage Code
- Is it possible to call a C function from C#.Net
- How to call native C# code from a C library
- Xamarin Part 4 - Dealing with Multiple Platforms
- Func delegate with no return type
- 怎么让IntPtr指向一个字符串
- 从C# String类理解Unicode(UTF8/UTF16)(C#中的Encoding类在
System.Text
下) - C#学习笔记 IEquatable 接口 IEqualityComparer 接口
- c#之lamda表达式的前世今生
- C# 9 中又来一堆关键词 init,record,with
- C# Documentation comments
- Visual Studio Use the Task List
- Doxygen and XML Doc Comment support
- 深入理解win32(一)
- 深入理解win32(二)
- theForger's Win32 API Programming Tutorial
- About Resource Files
- Using Dialog Boxes
- Will UpdateWindow() send a WM_PAINT message even if the HWND is validated?
- Win32更新窗口标题名:SetWindowTextA function
- How do I enable and disable the minimize, maximize, and close buttons in my caption bar?(To disable window resizing, use
SetWindowLong(hWnd, GWL_STYLE, GetWindowLong(hWnd, GWL_STYLE) & ~WS_SIZEBOX);
)
case WM_CREATE:
{
RECT windowRect;
GetWindowRect(hWnd, &windowRect);
// Disable the minimize button, the maximize button and window resizing.
SetWindowLongA(hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) & ~WS_MINIMIZEBOX);
SetWindowLongA(hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) & ~WS_MAXIMIZEBOX);
SetWindowLongA(hWnd, GWL_STYLE, GetWindowLongA(hWnd, GWL_STYLE) & ~WS_SIZEBOX);
break;
}
- windows api打开文件对话框
- win32api显示BMP图片的最简单方案(通过文件路径加载bitmap:
HBITMAP hbmp = LoadImage(NULL, lpszBitmapFile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); BITMAP bitmap; GetObject(hBitmap, sizeof(BITMAP), &bitmap);
。刷新绘制图像需要调用:InvalidateRect
。) - Windows Imaging Component (WIC) APIs Programming Guide
- Introduction to WIC: How to use WIC to load an image, and draw it with GDI?
- tiff 文件读取
- Getting the System Version
- win32 文件读写 异步 I/O 操作
- Win32::CreateEvent()函数
- SwitchToThread function
- YieldProcessor function
- NUMA Architecture
- SetThreadAffinityMask function (winbase.h)
- 获得当前线程的 GROUP_AFFINITY structure 则需要使用 GetThreadGroupAffinity function 接口。
- C++ 共享内存ShellCode跨进程传输
- Visual Studio 2019中,用于调试的即时窗口
- /Zc:__cplusplus (Enable updated __cplusplus macro)
- VC编译出现ITERATOR_DEBUG_LEVEL值不匹配异常
- 检测到“RuntimeLibrary”的不匹配项: 值“MT_StaticRelease”不匹配值“MD_DynamicRelease”
/NODEFAULTLIB
(Ignore Libraries)(比如,倘若要忽略 LIBCMT.lib 这个库,则可使用:/NODEFAULTLIB:LIBCMT
)- VC使用CRT调试功能检测内存泄漏
- MSVC中,Visual Studio 2019以前使用
__pragma
,比如:__pragma(loop(hint_parallel(0)))
。Visual Studio 2019起可以使用_Pragma
,比如:_Pragma("loop( hint_parallel(0))")
。 - MSVC loop pragma
- MSVC中要使用数学库的一些常量(比如
M_PI
等)需要添加宏定义:_USE_MATH_DEFINES
。 - Visual Studio 2019之你还在手工清理代码吗?
- visual studio如何查看全部断点
- Visual Studio How to set two environment variable?
- 如何利用Visual Studio通过打开指定的应用程序来调试当前的DLL项目:在当前DLL项目工程中,点击菜单栏的“项目”,选择“属性”,然后“配置属性”中的“调试”一栏中,右侧的“命令”中输入应用程序路径即可。应用程序路径最后必须是该应用文件名,当然也可以是一个批处理文件。
- windows命令行方式下打印和设置PATH变量
- Visual Studio 中引用 Windows SDK include 目录:
$(WindowsSDK_IncludePath)
- Visual Studio 中引用 Windows SDK Lib64 目录:
$(WindowsSDK_LibraryPath_x64)
;引用 ARM64 的库目录:$(WindowsSDK_LibraryPath_arm64)
- Visual Studio下对调试环境增加
PATH
路径:PATH=C:/freeglut-3.2.2/bin/;%PATH%
。(如下图所示) - (Visual Studio) Set compiler and build properties
- MSVC禁用指定warning参考:/wd。比如:
/wd"4819"
用于禁用4819编号的警告(这里的双引号可省)。 - /utf-8 (Set source and execution character sets to UTF-8)
- How to write as UTF-8 to console?(这里的关键就是调用
SetConsoleOutputCP(CP_UTF8);
) - BAT批处理文件 set命令详解
- Parallel Patterns Library (PPL)
- About Synchronization
- C++ win32和linux获取系统剩余内存
- Under windows, how to allocate a “write combining” memory block?
- Windows环境下快速写入(磁盘)文件
- Windows API笔记(五)管理虚拟内存
- Window API (四)虚拟内存管理
- 使用Visual Studio自带工具dumpbin解析PE文件
- Visual Studio中比较舒服的字体:
Consolas
。菜单栏 -> 工具 -> 选项 -> 环境 -> 字体和颜色:直接在“字体(粗体表示等宽字体)”一栏中选择即可。 - Visual Studio 2022使用文件比较工具:在Windows系统的“开始菜单”中找到“Visual Studio 2022”文件夹,点击“x64 Native Tools Command Prompt for VS 2022”,进入后可直接输入:
devenv /diff source.c target.c
。如果是用Visual Studio Code,可在命令行用:code.exe --diff source.c target.c
。 - Visual Studio安装完Node.js插件之后,node.exe 所在路径:
C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Microsoft\VisualStudio\NodeJs\win-x64\node.exe
。
使用下图模板创建项目:
请注意这个项目名与桌面DLL的区别:
这样就能生成x86、x64、ARM以及ARM64这四种目标平台了。随后我们在项目属性中,将每个平台的“生成预编译头”选项设置为 NO 即可。
通过Win32 API来获取CPU的核心个数主要分两步:第一步是通过调用 GetSystemInfo
函数来获取逻辑核心的总个数;第二步则是调用 GetLogicalProcessorInformationEx
函数来获取逻辑核与物理核的关联信息,最终即可判定出当前处理器有多少核心了。
代码如下所示:
#include <Windows.h>
#include <stdio.h>
int main(void)
{
SYSTEM_INFO sysInfo;
// 获取系统信息,
// SYSTEM_INFO结构体中可获取当前系统的逻辑处理器的个数
GetSystemInfo(&sysInfo);
// 方便起见,假定我们当前系统最多有128个关系信息
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX logicalInfos[128];
DWORD paramSize = (DWORD)sizeof(logicalInfos);
printf("Number of logical processors: %u\n", sysInfo.dwNumberOfProcessors);
// 获取指定逻辑处理器所关联的处理器核心的信息
if (GetLogicalProcessorInformationEx(RelationProcessorCore, logicalInfos, ¶mSize))
{
DWORD nCores = sysInfo.dwNumberOfProcessors;
// 当前x86架构的处理器中,一个核心最多只有两个逻辑核
if (logicalInfos[0].Processor.Flags == LTP_PC_SMT)
nCores /= 2;
printf("Number of Cores: %u\n", nCores);
}
return 0;
}
- win10开启内置Ubuntu
- Windows 10 Edge浏览器中使用Ctrl+鼠标左键可直接在新标签页打开指定的链接。
- Edge浏览器保存gif图片:只需修改一下保存文件的后缀名,将
.webp
修改为.gif
即可。 - Win10系统如何安全热插拔U盘?原来是这样
- 解决Excel打开UTF-8编码的CSV文件乱码的问题
- 解决Windows 11中微软拼音候选词窗口消失问题:右键底部拼音的“中”或“英”,然后选择“设置”,再选择“常规”,拉到最底下,打开“兼容性”开关即可工作。此外,微软日语输入法也同样设置即可。
- Win11 Windows附件在哪里查看 Win11中Windows附件查看方法
- 如何在excel表格中只复制单元格中的数值