上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 39 下一页
摘要: 可以从Windows Sockets 2开始, 虽然微软提供了官方工具, Microsoft Network Monitor 3.4, 不过我们如果能够通过相关的代码和api的调用来深入研究的话,那就大大提升了我们的学习水平。 主要用到socket, bind 和 recvfrom函数。 代码样本: 阅读全文
posted @ 2020-11-19 15:47 strive-sun 阅读(317) 评论(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 阅读(691) 评论(0) 推荐(0)
摘要: 目标:创建一个app,使用CreateToolhelp32Snapshot扫描所有的进程,并将进程的pid和exe名字映射到内存中,再在另一个app中使用OpenFileMapping打开该映射读取相关数据 Project 1: #define _CRT_SECURE_NO_WARNINGS #in 阅读全文
posted @ 2020-11-12 15:22 strive-sun 阅读(973) 评论(0) 推荐(1)
摘要: 官方示例: CommonFileDialogModes.cpp 如果我们想要自己创建一个通用的文件对话框,则可以使用IFileOpenDialog接口,代码参考: HRESULT BasicFileOpen() { // CoCreate the File Open Dialog object. I 阅读全文
posted @ 2020-11-12 10:37 strive-sun 阅读(1621) 评论(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 阅读(758) 评论(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 阅读(382) 评论(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 阅读(349) 评论(0) 推荐(0)
摘要: 如果要将exe的输出重定向到cmd,则可以使用匿名管道将子进程的标准输入和输出句柄重定向。请注意,命名管道也可以用于重定向进程I / O //CMD.exe #include <windows.h> #include <tchar.h> #include <stdio.h> #include <st 阅读全文
posted @ 2020-10-27 09:38 strive-sun 阅读(327) 评论(0) 推荐(0)
摘要: 跟创建普通的win32窗口一样,线程中的窗口也需要注册和窗口处理过程 // Test_WM_CLOSE.cpp : Defines the entry point for the application. // #include "framework.h" #include "Test_WM_CLO 阅读全文
posted @ 2020-10-20 15:19 strive-sun 阅读(754) 评论(0) 推荐(0)
摘要: #include <iostream> #include <Windows.h> #include <ShlObj.h> #include <Shlwapi.h> #pragma comment(lib, "Shell32.lib") #pragma comment(lib, "Shlwapi.li 阅读全文
posted @ 2020-10-16 12:02 strive-sun 阅读(130) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 39 下一页