10 2020 档案
摘要:如果要将exe的输出重定向到cmd,则可以使用匿名管道将子进程的标准输入和输出句柄重定向。请注意,命名管道也可以用于重定向进程I / O //CMD.exe #include <windows.h> #include <tchar.h> #include <stdio.h> #include <st
阅读全文
摘要:跟创建普通的win32窗口一样,线程中的窗口也需要注册和窗口处理过程 // Test_WM_CLOSE.cpp : Defines the entry point for the application. // #include "framework.h" #include "Test_WM_CLO
阅读全文
摘要:#include <iostream> #include <Windows.h> #include <ShlObj.h> #include <Shlwapi.h> #pragma comment(lib, "Shell32.lib") #pragma comment(lib, "Shlwapi.li
阅读全文
摘要:Suspend: 挂起指定的线程 备注:不要永远挂起线程, 因为在Win32中,进程堆是线程安全的对象,并且由于在不访问堆的情况下很难在Win32中完成很多工作,因此在Win32中挂起线程极有可能使进程死锁。 那么,为什么首先还要有SuspendThread函数呢? 调试器在调试过程中使用它冻结进程
阅读全文
摘要:ListView_GetItemPosition : Gets the position of a list-view item 理论上获得桌面图标的正确方法是使用shell项,=> IFolderView::GetItemPosition 但是为了学习ListView_GetItemPositio
阅读全文
摘要:比如: Google Chrome: 类似于任务管理器中显示名字,见下图 那么我们就需要使用VerQueryValue, 从指定的版本信息资源中检索指定的版本信息。若要检索适当的资源,在调用VerQueryValue之前,必须首先调用GetFileVersionInfoSize函数,然后再调用Get
阅读全文
摘要:两种方法: 第一种是使用WMI进行后台轮询 第二种是查询注册表对应的DNS键值 Here: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces[\interface-name] 使用RegNotifyChangeKey
阅读全文
摘要:简单的demo: #include <iostream> #include <fstream> #include <windows.h> typedef struct { std::uint32_t biSize; std::int32_t biWidth; std::int32_t biHeigh
阅读全文