摘要: 在创建GDI对象时,比如创建笔,画刷等对象时,在调用完之后忘记删除对象了,会造成内存泄漏 我们可以通过任务管理器来快速的查看 启动任务管理器(右键单击Windows任务栏以选择任务管理器) 在Windows 10中,转到“ 详细信息”选项卡。对于Windows 7,请转到“ 进程”选项卡。 右键单击 阅读全文
posted @ 2020-01-15 11:15 strive-sun 阅读(275) 评论(0) 推荐(0)
摘要: 使用DIB部分可直接快速访问像素 例如,此测试将记事本中的所有白色像素替换为绿色像素 HDC hDCScreen = GetDC(NULL); HWND hWndDest = FindWindow(L"Notepad", NULL); if (hWndDest) { if (IsIconic(hWn 阅读全文
posted @ 2020-01-14 13:31 strive-sun 阅读(436) 评论(0) 推荐(0)
摘要: StretchDIBits用来打印图像,但是由于某种未知的原因,当图像达到特定尺寸时,它会失败。 图像数据从其他一些图像源以24位BGR格式加载到无符号int数组中。它可以在某些大小下工作,但根本无法工作。 正在测试的当前尺寸为638x1014。如果将高度更改为1013,则可以正常工作,但由于某种原 阅读全文
posted @ 2020-01-13 17:19 strive-sun 阅读(346) 评论(0) 推荐(0)
摘要: 每次到用的时候就各种查资料,我这人记性又不好,遂记录下来: 普通的编辑控件: 创建:HWND hText = CreateWindowW(L"EDIT", L"enter some text", WS_VISIBLE | WS_CHILD | ES_RIGHT, 500, 100, 200, 100 阅读全文
posted @ 2020-01-09 15:07 strive-sun 阅读(1481) 评论(0) 推荐(0)
摘要: #define UNICODE #define _UNICODE #include <windows.h> #include <objidl.h> #include <gdiplus.h> #include <tchar.h> using namespace Gdiplus; //控件库以及相关宏 阅读全文
posted @ 2020-01-08 16:31 strive-sun 阅读(576) 评论(0) 推荐(0)
摘要: string bind = "Hello"; for (int i = 0; i < bind.length(); i++) { short ch = VkKeyScanA(bind[i]); if (((ch & 0xff00) >> 8) & 0x1) { std::cout<<" This i 阅读全文
posted @ 2019-12-26 09:36 strive-sun 阅读(553) 评论(0) 推荐(0)
摘要: #include <windows.h> LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); HBITMAP g_bmp; HBITMAP g_bmpMask; HBITMAP create 阅读全文
posted @ 2019-12-23 18:01 strive-sun 阅读(423) 评论(0) 推荐(0)
摘要: 使用Remove-Module -Name Functions2 只是移除当前会话的模块 并且Import-Module -Name Functions2与 Remove-Module -Name Functions2是相对应的,只有先import才能remove,不然会提示找不到模块 使用get- 阅读全文
posted @ 2019-12-23 16:46 strive-sun 阅读(1136) 评论(0) 推荐(0)
摘要: 根据测试 int main() { int a = 4; void *p = (void*)malloc(sizeof(100)); char *p1 = (char*)malloc(sizeof(100)); int n1 = sizeof(a); int n2 = sizeof(p); // i 阅读全文
posted @ 2019-12-20 16:51 strive-sun 阅读(1259) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdint.h> #include <stdlib.h> void hexDump(void *ptr, char *buf) { static char hex[16] = { '0', '1', '2', '3', '4', '5', 阅读全文
posted @ 2019-12-20 16:41 strive-sun 阅读(802) 评论(0) 推荐(0)