06 2020 档案

摘要:调用SetMonitorBrightness 代码示例: #pragma comment(lib, "dxva2.lib") #include <windows.h> #include <lowlevelmonitorconfigurationapi.h> #include <physicalmon 阅读全文
posted @ 2020-06-30 17:00 strive-sun 阅读(1385) 评论(0) 推荐(1)
摘要:只需要调用WM_CTLCOLORLISTBOX和WM_CTLCOLOREDIT来分别处理编辑框和下拉列表。 Combox的创建: int xpos = 100; // Horizontal position of the window. int ypos = 100; // Vertical pos 阅读全文
posted @ 2020-06-29 10:50 strive-sun 阅读(1546) 评论(0) 推荐(0)
摘要:如果指针指向基类,但是指针在运行时指向派生类,则该基类必须具有虚拟析构函数,以便破坏派生类。如果没有虚拟析构函数,则只会运行基类的析构函数。 比如: Base* basePtr; basePtr = new Derived(1); 如果没有添加virtual,也就是没有虚拟析构函数,看下面代码示例: 阅读全文
posted @ 2020-06-24 17:53 strive-sun 阅读(813) 评论(0) 推荐(0)
摘要:一个完整的用户模式dump是基本的用户模式转储文件。 此转储文件包括进程的整个内存空间,程序的可执行映像本身,句柄表以及其他信息,这些信息对于调试器在重建转储发生时正在使用的内存中很有用。 可以将完整的用户模式转储文件“缩小”到小型转储中。只需将转储文件加载到调试器中,然后使用.dump(创建转储文 阅读全文
posted @ 2020-06-23 16:46 strive-sun 阅读(431) 评论(0) 推荐(0)
摘要:std::vector<std::byte> ReadBytes(PVOID address, SIZE_T length) { std::vector<std::byte> buffer(length); std::cout << "length" << buffer.size() << std: 阅读全文
posted @ 2020-06-22 15:10 strive-sun 阅读(379) 评论(0) 推荐(0)
摘要:这个api的功能主要是实现“透明” 原理: Transparent将hdc中bmp的特定颜色“透明化” #include <Windows.h> #pragma comment(lib,"Msimg32.lib") using namespace std; HBITMAP hBitmap; HBIT 阅读全文
posted @ 2020-06-22 10:18 strive-sun 阅读(450) 评论(0) 推荐(0)
摘要:下面的例子用于反映本地系统的日期格式变化 // locale test #include <stdio.h> #include <locale.h> #include <time.h> #include <locale> #include <Windows.h> #pragma warning(di 阅读全文
posted @ 2020-06-18 13:50 strive-sun 阅读(589) 评论(0) 推荐(0)
摘要:// Test_1.cpp : Defines the entry point for the application. // #include "framework.h" #include "Test_1.h" #include <atlimage.h> #define MAX_LOADSTRIN 阅读全文
posted @ 2020-06-16 16:20 strive-sun 阅读(1179) 评论(0) 推荐(0)
摘要:通过使用EnumWindows()和枚举窗口来手动确定EnumChildWindows()来直接确定哪个窗口在z轴上比另一个窗口高。 struct myEnumInfo { HWND hwnd1; HWND hwnd2; HWND hwndOnTop; }; BOOL CALLBACK EnumCh 阅读全文
posted @ 2020-06-15 10:19 strive-sun 阅读(532) 评论(0) 推荐(0)
摘要:void OnEraseBkGnd(HWND hwnd) { /* Vars */ HDC dc; /* Standard Device Context; used to do the painting */ /* rect = Client Rect of the window; Temp = T 阅读全文
posted @ 2020-06-12 13:38 strive-sun 阅读(754) 评论(0) 推荐(0)
摘要:#include <string> #include <sstream> #include <iostream> int main() { std::wstring keyname = L"HKEY_LOCAL_MACHINE\\SOFTWARE\\Mozilla\\Firefox"; std::w 阅读全文
posted @ 2020-06-12 10:06 strive-sun 阅读(243) 评论(0) 推荐(0)
摘要:滑动鼠标滚轮可以改变图像大小 #include <windows.h> #include <tchar.h> #include <Urlmon.h> // URLDownloadToCacheFile #pragma comment (lib, "Urlmon") #include <shlwapi 阅读全文
posted @ 2020-06-10 11:01 strive-sun 阅读(762) 评论(0) 推荐(0)
摘要:#include <string> void makebox(LPCSTR name) { std::string res(name); res += " is X"; ::MessageBoxA(nullptr, res.c_str(), res.c_str(), MB_OK); } 阅读全文
posted @ 2020-06-10 09:43 strive-sun 阅读(218) 评论(0) 推荐(0)
摘要:创建半透明的窗口,以及在窗口上绘制不透明的文本 方法: 创建Bitmap具有PixelFormat32bppPARGB像素格式的GDI + 对象。 创建一个Graphics对象以绘制该Bitmap对象。 使用GDI +将所有图形绘制到该对象中。 销毁Graphics在步骤2中创建的对象。 GetHB 阅读全文
posted @ 2020-06-09 15:37 strive-sun 阅读(1766) 评论(0) 推荐(0)
摘要:使用CreateDIBSection 可以创建一个设备无关位图 #include <windows.h> using namespace std; int main() { HDC hdc = GetDC(HWND_DESKTOP); HDC MemDC = CreateCompatibleDC(h 阅读全文
posted @ 2020-06-03 15:46 strive-sun 阅读(1185) 评论(0) 推荐(0)
摘要:使用StretchDIBits将位图数据传输到printer的dc中 #include <Windows.h> #include <algorithm> int main() { int nWidth = 16, nHeight = 16; BYTE byteBitmap[768]; std::fi 阅读全文
posted @ 2020-06-03 14:52 strive-sun 阅读(465) 评论(0) 推荐(0)