摘要:
我们可以使用D3D为游戏,科学和桌面应用程序创建3-D图形。 非官方demo实例: https://github.com/Ray1024/D3D11Tutorial 当然,我们第一步要开始认识里面的基本api。 #include <d3d11.h> #include <chrono> using n 阅读全文
摘要:
从User32.dll中导出MessageBoxW 代码: #include <Windows.h> #include <iostream> #include <functional> typedef int(__stdcall *MsgBOX) ( HWND hWnd, LPCWSTR lpTex 阅读全文
摘要:
日常文件操作的时候,在删除或者移动某个文件的时候,发现它被某些进程占用了。 那么下面的代码就可以帮助我们找出这些进程的id和name。 原理: 将资源注册到Restart Manager会话。重新启动管理器使用在会话中注册的资源列表来确定必须关闭并重新启动哪些应用程序和服务。 代码: #includ 阅读全文
摘要:
仅供参考 文档: Rendering a Stream 代码示例: #include <cstdio> #include <Windows.h> // Windows multimedia device #include <Mmdeviceapi.h> #include <Functiondisco 阅读全文
摘要:
需要首先获取特定用户的SID。 这是一些步骤, 验证输入参数。 为可能足够大的SID和域名创建缓冲区。 在循环中,调用LookupAccountName以检索提供的帐户名的SID。如果SID的缓冲区或域名的缓冲区不够大,则分别在cbSid或中返回所需的缓冲区大小cchDomainName,并在下一次 阅读全文
摘要:
检查当前句柄是否有指定的权限。 #include <iostream> #include <windows.h> #include <tchar.h> //#pragma comment(lib, "cmcfg32.lib") HANDLE hProcess; BOOL CheckWindowsPr 阅读全文
摘要:
因为是学习篇,写下是为了个人的学习与理解。故参考其他文章为多。 为什么会有死锁? 想象一下这样的情况,thread A 在run的时候需要等待thread B的结果,也就是threadprocA中添加tB.join(), 在thread B的threadProcB中添加tA.join()。结果就是线 阅读全文
摘要:
因为是学习篇,写下是为了个人的学习与理解。故参考其他文章为多。 为什么需要线程同步? 在程序中使用多线程时,一般很少有多个线程能在其生命期内进行完全独立的操作。更多的情况是一些线程进行某些处理操作,而其他的线程必须对其处理结果进行了解。正常情况下对这种处理结果的了解应当在其处理任务完成后进行。 如果 阅读全文
摘要:
对32位Windows来说,其虚拟地址空间总数就是2的32次方,即4GB。 如果没有在引导时加上/3GB或/BOOTVA选项,Windows默认最大会分2GB给内核模式程序使用,2GB给用户模式程序。 其实32位Windows不管系统物理内存有多少,它只会映射这4GB的虚拟地址空间。 也就是说,你不 阅读全文
摘要:
this指针是存在与类的成员函数中,指向被调用函数所在的类实例的地址。 根据以下程序来说明this指针, #include<iostream.h> class Point { int x, y; public: Point(int a, int b) { x=a; y=b;} void MovePo 阅读全文