上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 36 下一页
摘要: 只需要记住使用OpenEvent来同步Event对象。 Project A: #define _CRT_SECURE_NO_WARNINGS #include <Windows.h> #include <stdio.h> #include <time.h> HANDLE hEvent; int ma 阅读全文
posted @ 2020-12-03 10:01 strive-sun 阅读(622) 评论(0) 推荐(0) 编辑
摘要: 网上关于IFolderView2接口调用的示例有点少。 下面的例子是将桌面的图标隐藏起来,使用了FWF_NOICONS样式。 #include <ShlObj.h> // Shell API #include <atlcomcli.h> // CComPtr & Co. #include <stri 阅读全文
posted @ 2020-12-01 14:55 strive-sun 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 该函数经常被用来处理UTF-8和ANSI格式的字符串,将它们转换为宽字节(UTF-16) #include <iostream> #include <Windows.h> #include <string> #define MAXBUFFERSIZE 1024 using namespace std 阅读全文
posted @ 2020-11-27 14:26 strive-sun 阅读(516) 评论(0) 推荐(0) 编辑
摘要: 可以从Windows Sockets 2开始, 虽然微软提供了官方工具, Microsoft Network Monitor 3.4, 不过我们如果能够通过相关的代码和api的调用来深入研究的话,那就大大提升了我们的学习水平。 主要用到socket, bind 和 recvfrom函数。 代码样本: 阅读全文
posted @ 2020-11-19 15:47 strive-sun 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 错误代码: #include <iostream> int main() { int* ptr = (int*)malloc(4); int i = 1111; ptr = &i; std::cout << *ptr << std::endl; free(ptr); return 0; } 在最后释 阅读全文
posted @ 2020-11-18 15:54 strive-sun 阅读(667) 评论(0) 推荐(0) 编辑
摘要: 目标:创建一个app,使用CreateToolhelp32Snapshot扫描所有的进程,并将进程的pid和exe名字映射到内存中,再在另一个app中使用OpenFileMapping打开该映射读取相关数据 Project 1: #define _CRT_SECURE_NO_WARNINGS #in 阅读全文
posted @ 2020-11-12 15:22 strive-sun 阅读(924) 评论(0) 推荐(1) 编辑
摘要: 官方示例: CommonFileDialogModes.cpp 如果我们想要自己创建一个通用的文件对话框,则可以使用IFileOpenDialog接口,代码参考: HRESULT BasicFileOpen() { // CoCreate the File Open Dialog object. I 阅读全文
posted @ 2020-11-12 10:37 strive-sun 阅读(1273) 评论(0) 推荐(0) 编辑
摘要: #include <Windows.h> #include <stdio.h> #pragma warning(disable:4996) void PasswordCheck() { char message_console[MAX_PATH]; char key_accepted[MAX_PAT 阅读全文
posted @ 2020-11-06 10:21 strive-sun 阅读(679) 评论(0) 推荐(0) 编辑
摘要: 需要先从麦克风中采样,代码样本可以参考官方示例: WASAPI Capture Shared Event Driven 官方示例采样10s, 我们需要在WriteWaveFile函数下添加生成原始音频的代码。 // Write the contents of a WAV file. We take 阅读全文
posted @ 2020-11-03 17:55 strive-sun 阅读(345) 评论(0) 推荐(0) 编辑
摘要: std::string s = fs::temp_directory_path().append(filename).string(); LPCBYTE str = reinterpret_cast<LPCBYTE>(s.c_str()), RegSetValueExA的实战示例: // using 阅读全文
posted @ 2020-11-03 10:27 strive-sun 阅读(320) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 36 下一页