Last change
on this file since 781 was 781, checked in by イグトランス (egtra), 13 years ago |
abdev新ソース用プロジェクトabdev-implとAB全体の単体テスト用プロジェクトab-testの追加。LoadIcon代替関数の作成(テスト未記述)。
|
File size:
790 bytes
|
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 | int 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,
|
---|
18 | cxDesired, cyDesired, load);
|
---|
19 | }
|
---|
20 |
|
---|
21 | }}
|
---|
22 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.