摘要: 有.rc文件,其中包含用于exe文件详细信息的版本,说明等。 如何获得在代码内使用的值?例如,要获取ProductName。 IDI_ICON1 ICON DISCARDABLE "abc-logo.ico" #if defined(UNDER_CE) #include <winbase.h> #e 阅读全文
posted @ 2019-11-13 16:05 strive-sun 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 今天在论坛看见关于指针使用的讨论,原帖:https://bbs.csdn.net/topics/394991693 我整理一下他们所说的几种方法,可能涉及到内存泄漏 case 1: #include <stdlib.h> #include <stdio.h> int *min(int x, int 阅读全文
posted @ 2019-11-12 09:33 strive-sun 阅读(172) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <stdio.h> #include <WINDOWS.H> #include <shellapi.h> #include <gdiplus.h> #include <Shlwapi.h> #pragma comment (lib,"Shlw 阅读全文
posted @ 2019-11-11 16:22 strive-sun 阅读(799) 评论(0) 推荐(0) 编辑
摘要: #include <windows.h> #include <gdiplus.h> HBITMAP LoadBitmapFromResource(DWORD ResourceID, bool transparent = true) { HANDLE hGlobal = NULL; ULONG_PTR 阅读全文
posted @ 2019-11-08 14:24 strive-sun 阅读(1967) 评论(0) 推荐(0) 编辑
摘要: HDC hdc, hdcTemp; RECT rect; BYTE* bitPointer; int x, y; int red, green, blue, alpha; while(true) { hdc = GetDC(HWND_DESKTOP); GetWindowRect(hWND_Desk 阅读全文
posted @ 2019-11-08 09:49 strive-sun 阅读(986) 评论(0) 推荐(0) 编辑
摘要: include <Windows.h> #include <iostream> int main() { HANDLE handle = CreateFile(L"OneNote", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE 阅读全文
posted @ 2019-11-07 18:11 strive-sun 阅读(1803) 评论(0) 推荐(0) 编辑
摘要: 另外使用createfile函数将捕捉后的图片储存为文件 #include <Windows.h> #include <stdio.h> #include <assert.h> void scrshot() { Sleep(1000); BITMAP bmpScreen; HWND hwnd = G 阅读全文
posted @ 2019-11-06 16:56 strive-sun 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 问题代码: #include <iostream> int *foo() { int a = 5; return &a; } int main() { int *p = foo(); std::cout << *p; *p = 8; std::cout << *p; } 最后会打印:58 理论上,a 阅读全文
posted @ 2019-11-06 15:58 strive-sun 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 用到ShellExecuteEx 为了防止属性对话框无法成功打开(程序运行太快,以至于没有时间打开属性对话框,程序就结束了) 调用SHSetInstanceExplorer并使其保持活动状态,直到该COM对象被释放: #include <windows.h> #include <shlobj_cor 阅读全文
posted @ 2019-11-05 15:58 strive-sun 阅读(999) 评论(2) 推荐(1) 编辑
摘要: 需要知道GetDC与BeginPaint的区别,这里有一篇不错的文章。 简洁的就是说:BeginPaint() 和EndPaint() 可以删除消息队列中的WM_PAINT消息,并使无效区域有效。 GetDC()和ReleaseDC()并不删除也不能使无效区域有效,因此当程序跳出 WM_PAINT 阅读全文
posted @ 2019-11-01 18:17 strive-sun 阅读(331) 评论(0) 推荐(0) 编辑