diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-08-12 20:36:33 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-08-12 20:36:33 +0000 |
commit | 5d55c351109d18bb46b97c7e6142f6f321595849 (patch) | |
tree | e0423a19189dadc6ca8b5b72dd881aa97a2c1ea7 /plugins/Console | |
parent | 2e2390295cbf3f8f24a938bf957d3ecd5b86d3a6 (diff) |
icons registration moved to Load()
git-svn-id: http://svn.miranda-ng.org/main/trunk@10173 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Console')
-rw-r--r-- | plugins/Console/src/Console.cpp | 12 | ||||
-rw-r--r-- | plugins/Console/src/commonheaders.h | 1 | ||||
-rw-r--r-- | plugins/Console/src/init.cpp | 16 |
3 files changed, 19 insertions, 10 deletions
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index ee237b8df7..907d77b9d2 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -115,21 +115,13 @@ static int Openfile(TCHAR *outputFile, int selection); static HANDLE hTTBButt = 0;
-static IconItem iconList[] =
-{
- { "Show", "Console_Up", IDI_BTN_UP },
- { "Hide", "Console_Down", IDI_BTN_DN },
-};
-
static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
{
int state = IsWindowVisible(hwndConsole);
- Icon_Register(hInst, "Console", iconList, SIZEOF(iconList));
-
TTBButton ttb = { sizeof(ttb) };
- ttb.hIconHandleUp = iconList[0].hIcolib;
- ttb.hIconHandleDn = iconList[1].hIcolib;
+ ttb.hIconHandleUp = LoadIcon(IDI_BTN_UP);
+ ttb.hIconHandleDn = LoadIcon(IDI_BTN_DN);
ttb.dwFlags = (state ? TTBBF_PUSHED : 0) | TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_CONSOLE_SHOW_HIDE;
ttb.name = LPGEN("Show/Hide Console");
diff --git a/plugins/Console/src/commonheaders.h b/plugins/Console/src/commonheaders.h index d41768aaeb..d83748550b 100644 --- a/plugins/Console/src/commonheaders.h +++ b/plugins/Console/src/commonheaders.h @@ -49,5 +49,6 @@ extern HINSTANCE hInst; void InitConsole();
void ShutdownConsole();
+HANDLE LoadIcon(int iIconID);
#define MS_NETLIB_LOGWIN "Netlib/Log/Win"
diff --git a/plugins/Console/src/init.cpp b/plugins/Console/src/init.cpp index 0b8637c1dc..1d68a1c76e 100644 --- a/plugins/Console/src/init.cpp +++ b/plugins/Console/src/init.cpp @@ -53,10 +53,26 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda return &pluginInfoEx;
}
+static IconItem iconList[] =
+{
+ { "Show", "Console_Up", IDI_BTN_UP },
+ { "Hide", "Console_Down", IDI_BTN_DN },
+};
+
+HANDLE LoadIcon(int iIconID)
+{
+ for (int i = 0; i < SIZEOF(iconList); i++)
+ if (iconList[i].defIconID == iIconID)
+ return iconList[i].hIcolib;
+ return NULL;
+}
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
+ Icon_Register(hInst, "Console", iconList, SIZEOF(iconList));
+
InitCommonControls();
InitConsole();
return 0;
|