winapi 读取二进制资源文件
时间:2020-09-06 00:38:01
收藏:0
阅读:167
1 static char *get_resource(char *id, unsigned *size) 2 { 3 HRSRC hr = FindResource(GetModuleHandle(NULL), id, RT_RCDATA); 4 5 if (hr == NULL) return NULL; 6 *size = SizeofResource(GetModuleHandle(NULL), hr); 7 h = LoadResource(GetModuleHandle(NULL), hr); 8 return (char *)LockResource(h); 9 } 10 11 static void free_resource(void) 12 { 13 if (h) 14 { 15 FreeResource(h); 16 h = 0; 17 } 18 }
原文:https://www.cnblogs.com/ageane/p/winapi-res.html
评论(0)