上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页
摘要: MSDN的文章参考: 使用互斥对象 一开始没看懂是啥意思,后面研究之后发现, 重点在这段代码, while (dwCount < 20) { dwWaitResult = WaitForSingleObject( ghMutex, // handle to mutex INFINITE); // n 阅读全文
posted @ 2021-01-12 18:02 strive-sun 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 仅适用于同一台电脑的两个进程聊天,对于不同电脑之前的聊天需要依靠tcp/ip协议。 两个进程是通过发送WM_COPYDATA 消息来传输字节的。 代码如下: Server.cpp #include <Windows.h> #include <stdio.h> #include <iostream> 阅读全文
posted @ 2021-01-11 16:12 strive-sun 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 这个框框好像删不掉,就先放这边吧。。。 #define WIN32_LEAN_AND_MEAN #include <unknwn.h> #include <windows.h> #include <dwmapi.h> #include <gdiplus.h> #include <objidl.h> 阅读全文
posted @ 2021-01-07 16:43 strive-sun 阅读(1946) 评论(2) 推荐(0) 编辑
摘要: #include <tchar.h> #include <windows.h> #include <mmsystem.h> // for MCI functions // Link to winmm.lib (usually included in project settings) #pragma 阅读全文
posted @ 2021-01-06 18:09 strive-sun 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 我们可以使用D3D为游戏,科学和桌面应用程序创建3-D图形。 非官方demo实例: https://github.com/Ray1024/D3D11Tutorial 当然,我们第一步要开始认识里面的基本api。 #include <d3d11.h> #include <chrono> using n 阅读全文
posted @ 2020-12-31 15:16 strive-sun 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 从User32.dll中导出MessageBoxW 代码: #include <Windows.h> #include <iostream> #include <functional> typedef int(__stdcall *MsgBOX) ( HWND hWnd, LPCWSTR lpTex 阅读全文
posted @ 2020-12-28 17:48 strive-sun 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 日常文件操作的时候,在删除或者移动某个文件的时候,发现它被某些进程占用了。 那么下面的代码就可以帮助我们找出这些进程的id和name。 原理: 将资源注册到Restart Manager会话。重新启动管理器使用在会话中注册的资源列表来确定必须关闭并重新启动哪些应用程序和服务。 代码: #includ 阅读全文
posted @ 2020-12-28 17:30 strive-sun 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 仅供参考 文档: Rendering a Stream 代码示例: #include <cstdio> #include <Windows.h> // Windows multimedia device #include <Mmdeviceapi.h> #include <Functiondisco 阅读全文
posted @ 2020-12-23 15:08 strive-sun 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 需要首先获取特定用户的SID。 这是一些步骤, 验证输入参数。 为可能足够大的SID和域名创建缓冲区。 在循环中,调用LookupAccountName以检索提供的帐户名的SID。如果SID的缓冲区或域名的缓冲区不够大,则分别在cbSid或中返回所需的缓冲区大小cchDomainName,并在下一次 阅读全文
posted @ 2020-12-22 14:52 strive-sun 阅读(620) 评论(0) 推荐(0) 编辑
摘要: 检查当前句柄是否有指定的权限。 #include <iostream> #include <windows.h> #include <tchar.h> //#pragma comment(lib, "cmcfg32.lib") HANDLE hProcess; BOOL CheckWindowsPr 阅读全文
posted @ 2020-12-21 15:26 strive-sun 阅读(213) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页