01 2021 档案
摘要:微软文档:Geometries overview 本篇通过官方文档学习,整理出来的demo,初始样本请先创建一个普通的desktop app。 // Test_Direct2D_Brush.cpp : Defines the entry point for the application. // #
阅读全文
摘要:#include <Windows.h> #include <WinSafer.h> #include <stdio.h> #include <sddl.h> bool _IsNewProcessLaunched() { // Create the restricted token. SAFER_L
阅读全文
摘要:用作复习,下面是第一个getchar()是用来接受字符,第二个是用来接受回车符 char a; while (1) { a = getchar(); getchar(); // scanf_s("%[^\n]"); std::cout << "Hello" ; std::cout << a ; }
阅读全文
摘要:这里需要两个app. parent.cpp #include <Windows.h> #include <stdio.h> int main() { SECURITY_ATTRIBUTES se = {}; se.nLength = sizeof(SECURITY_ATTRIBUTES); se.b
阅读全文
摘要:微软文档:Brushes overview 本篇通过官方文档学习,整理出来的demo,初始样本请先创建一个普通的desktop app。 // Test_Direct2D_Brush.cpp : Defines the entry point for the application. // #inc
阅读全文
摘要:偶然碰到这类技术博客,甚感欣慰,但奈何技术水平达不到,很多都难以理解,故记录在此,用作日后学习。 国内有类似的中文翻译,比如:突破Windows极限:物理内存 但是外文链接已经失效,看不到原汁原味的英文,所以下面我整理出最新的链接。 外网资源: 突破Windows的极限:物理内存 突破Windows
阅读全文
摘要:这种错误,很多情况下是类型不匹配 LPTSTR表示为指向常量TCHAR字符串的长指针 TCHAR可以是wchar_t或char,基于项目是多字节还是宽字节版本。 看下面的代码,代码来源:Example: Open a File for Reading DisplayError(TEXT("Creat
阅读全文
摘要:#include <Windows.h> #include <iostream> #include <thread> #include <tchar.h> using namespace std; HWINEVENTHOOK EventHook; BOOL WINAPI HandlerRoutine
阅读全文
摘要:在进行D2D学习的时候,发现了这样一篇文档, Direct2D Quickstart for Windows 8 只有这么一小段介绍, Direct2D is a native-code, immediate-mode API for creating 2D graphics. This topic
阅读全文
摘要:前段时间稍微看了点Direct3D, 觉得挺有意思的,但是想着要有3D得先从2D开始。故开始了D2D旅行。 如标题所示,CreateHwndRenderTarget 是在用来创建一个渲染到窗口的渲染目标。 创建渲染目标并且可以使用硬件加速时,可以在计算机的GPU上分配资源。通过一次创建渲染目标并保留
阅读全文
摘要:参考这篇教程:Simple Windows Service in C++ 安装service需要在管理员权限下运行cmd,并输入下面的命令行 C:\>sc create "My Sample Service" binPath= C:\SampleService.exe My Sample Servi
阅读全文
摘要:目标: 创建一个父进程和子进程,在子进程的控制台窗口输入数据,数据通过管道发送给父进程,父进程的控制台窗口读取数据,最后将数据打印出来。 Parent.cpp //CMD.exe #include <windows.h> #include <tchar.h> #include <stdio.h> #
阅读全文
摘要:MSDN的文章参考: 使用互斥对象 一开始没看懂是啥意思,后面研究之后发现, 重点在这段代码, while (dwCount < 20) { dwWaitResult = WaitForSingleObject( ghMutex, // handle to mutex INFINITE); // n
阅读全文
摘要:仅适用于同一台电脑的两个进程聊天,对于不同电脑之前的聊天需要依靠tcp/ip协议。 两个进程是通过发送WM_COPYDATA 消息来传输字节的。 代码如下: Server.cpp #include <Windows.h> #include <stdio.h> #include <iostream>
阅读全文
摘要:这个框框好像删不掉,就先放这边吧。。。 #define WIN32_LEAN_AND_MEAN #include <unknwn.h> #include <windows.h> #include <dwmapi.h> #include <gdiplus.h> #include <objidl.h>
阅读全文
摘要:#include <tchar.h> #include <windows.h> #include <mmsystem.h> // for MCI functions // Link to winmm.lib (usually included in project settings) #pragma
阅读全文