source: dev/branches/egtra/ab5.0/abdev/abdev-impl/Resource/Load.cpp@ 782

Last change on this file since 782 was 782, checked in by イグトランス (egtra), 13 years ago

アイコン読込のテストのコードを整理。

File size: 788 bytes
Line 
1#include "stdafx.h"
2
3namespace ActiveBasic { namespace Resource {
4
5HICON LoadIcon(HINSTANCE hinst, USHORT id, int cxDesired, int cyDesired, UINT load)
6{
7 auto hrsrc = FindResource(hinst, MAKEINTRESOURCE(id), RT_GROUP_ICON);
8 auto hMem = LoadResource(hinst, hrsrc);
9 auto pResource = LockResource(hMem);
10
11 auto idIcon = LookupIconIdFromDirectoryEx(reinterpret_cast<PBYTE>(pResource), TRUE, cxDesired, cyDesired, load);
12 auto hrsrcIcon = FindResource(hinst, MAKEINTRESOURCE(idIcon), MAKEINTRESOURCE(RT_ICON));
13 auto hIconMem = LoadResource(hinst, hrsrcIcon);
14 auto pResourceIcon = LockResource(hIconMem);
15
16 return CreateIconFromResourceEx(reinterpret_cast<PBYTE>(pResourceIcon),
17 SizeofResource(hinst, hrsrcIcon), TRUE, 0x00030000, cxDesired, cyDesired, load);
18}
19
20}}
21
Note: See TracBrowser for help on using the repository browser.