Line | |
---|
1 | #include "stdafx.h"
|
---|
2 |
|
---|
3 | namespace ActiveBasic { namespace Resource {
|
---|
4 |
|
---|
5 | HICON 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.