diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-18 20:51:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-18 20:51:18 +0300 |
commit | 9cf1444eb7888f2d942d220f938aa893396a8a1b (patch) | |
tree | ea87e4cb78e9c26a651af00b2d423324ce4a85a6 /protocols/JabberG/src | |
parent | 3936ebbc665c9653d9f62527c1e136944d52e2ca (diff) |
g_hInstance incapulated into PLUGIN<>, no need in the separate variable
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-x | protocols/JabberG/src/jabber.cpp | 36 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_adhoc.cpp | 10 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_bookmarks.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_captcha.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_filterlist.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_form.cpp | 18 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_frame.cpp | 8 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_icolib.cpp | 8 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iqid_muc.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_opt.cpp | 6 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_password.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_search.cpp | 8 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_userinfo.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_vcard.cpp | 10 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 2 | ||||
-rwxr-xr-x | protocols/JabberG/src/stdafx.h | 2 |
18 files changed, 66 insertions, 64 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 9e8c7e3204..aef6f638ac 100755 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -35,10 +35,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma comment(lib, "Dnsapi.lib")
#pragma comment(lib, "Secur32.lib")
-HINSTANCE g_hInstance;
HMODULE hMsftedit;
-CMPlugin g_plugin;
int hLangpack;
unsigned int g_nTempFileId;
CHAT_MANAGER *pci;
@@ -48,18 +46,6 @@ CountryListEntry *g_countries; wchar_t szCoreVersion[100];
-PLUGININFOEX pluginInfo = {
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- {0x144e80a2, 0xd198, 0x428b, {0xac, 0xbe, 0x9d, 0x55, 0xda, 0xcc, 0x7f, 0xde}} // {144E80A2-D198-428b-ACBE-9D55DACC7FDE}
-};
-
CLIST_INTERFACE* pcli;
HANDLE hExtraActivity = nullptr;
@@ -71,15 +57,33 @@ void JabberUserInfoUninit(void); bool bSecureIM, bMirOTR, bNewGPG, bPlatform;
-/////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+
+CMPlugin g_plugin;
extern "C" _pfnCrtInit _pRawDllMain = &CMPlugin::RawDllMain;
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ { 0x144e80a2, 0xd198, 0x428b, {0xac, 0xbe, 0x9d, 0x55, 0xda, 0xcc, 0x7f, 0xde }} // {144E80A2-D198-428b-ACBE-9D55DACC7FDE}
+};
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
///////////////////////////////////////////////////////////////////////////////
@@ -108,7 +112,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) // file associations manager plugin support
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
CreateServiceFunction("JABBER/*" JS_PARSE_XMPP_URI, g_SvcParseXmppUri);
- AssocMgr_AddNewUrlTypeW("xmpp:", TranslateT("Jabber Link Protocol"), g_hInstance, IDI_JABBER, "JABBER/*" JS_PARSE_XMPP_URI, 0);
+ AssocMgr_AddNewUrlTypeW("xmpp:", TranslateT("Jabber Link Protocol"), g_plugin.getInst(), IDI_JABBER, "JABBER/*" JS_PARSE_XMPP_URI, 0);
}
// init fontservice for info frame
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index fccbbcdbd0..e69c40b6c0 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -339,7 +339,7 @@ int CJabberProto::AdHoc_AddCommandRadio(HWND hFrame, wchar_t * labelStr, int id, ctrlWidth = min(ctrlWidth, strRect.right - strRect.left + 20);
ReleaseDC(hFrame, hdc);
- HWND hCtrl = CreateWindowEx(0, L"button", labelStr, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON, ctrlOffset, ypos, ctrlWidth, labelHeight, hFrame, (HMENU)id, g_hInstance, nullptr);
+ HWND hCtrl = CreateWindowEx(0, L"button", labelStr, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON, ctrlOffset, ypos, ctrlWidth, labelHeight, hFrame, (HMENU)id, g_plugin.getInst(), nullptr);
SendMessage(hCtrl, WM_SETFONT, (WPARAM)SendMessage(GetParent(hFrame), WM_GETFONT, 0, 0), 0);
SendMessage(hCtrl, BM_SETCHECK, value, 0);
return (ypos + labelHeight + verticalStep);
@@ -527,7 +527,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) HMENU hMenu = CreatePopupMenu();
for (int i = 0; i < item->arResources.getCount(); i++)
AppendMenu(hMenu, MF_STRING, i + 1, item->arResources[i]->m_tszResourceName);
- HWND hwndTemp = CreateWindowEx(WS_EX_TOOLWINDOW, L"button", L"PopupMenuHost", 0, 0, 0, 10, 10, nullptr, nullptr, g_hInstance, nullptr);
+ HWND hwndTemp = CreateWindowEx(WS_EX_TOOLWINDOW, L"button", L"PopupMenuHost", 0, 0, 0, 10, 10, nullptr, nullptr, g_plugin.getInst(), nullptr);
SetForegroundWindow(hwndTemp);
RECT rc;
POINT pt;
@@ -551,11 +551,11 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) if (item == nullptr || selected) {
CJabberAdhocStartupParams* pStartupParams = new CJabberAdhocStartupParams(this, jid, nullptr);
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_FORM), nullptr, JabberAdHoc_CommandDlgProc, (LPARAM)pStartupParams);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FORM), nullptr, JabberAdHoc_CommandDlgProc, (LPARAM)pStartupParams);
}
}
else if (lParam != 0)
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_FORM), nullptr, JabberAdHoc_CommandDlgProc, lParam);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FORM), nullptr, JabberAdHoc_CommandDlgProc, lParam);
}
return res;
}
@@ -563,5 +563,5 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) void CJabberProto::ContactMenuAdhocCommands(CJabberAdhocStartupParams* param)
{
if (param)
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_FORM), nullptr, JabberAdHoc_CommandDlgProc, (LPARAM)param);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FORM), nullptr, JabberAdHoc_CommandDlgProc, (LPARAM)param);
}
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 829d3dbfbe..bceb2b9689 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -197,7 +197,7 @@ private: JabberAddBookmarkDlgParam param;
param.ppro = m_proto;
param.m_item = nullptr;
- DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_BOOKMARK_ADD), m_hwnd, JabberAddBookmarkDlgProc, (LPARAM)¶m);
+ DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), m_hwnd, JabberAddBookmarkDlgProc, (LPARAM)¶m);
}
void btnEdit_OnClick(CCtrlFilterListView *)
@@ -216,7 +216,7 @@ private: JabberAddBookmarkDlgParam param;
param.ppro = m_proto;
param.m_item = item;
- DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_BOOKMARK_ADD), m_hwnd, JabberAddBookmarkDlgProc, (LPARAM)¶m);
+ DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), m_hwnd, JabberAddBookmarkDlgProc, (LPARAM)¶m);
}
void btnRemove_OnClick(CCtrlFilterListView *)
@@ -443,7 +443,7 @@ int CJabberProto::AddEditBookmark(JABBER_LIST_ITEM *item) JabberAddBookmarkDlgParam param;
param.ppro = this;
param.m_item = item;//(JABBER_LIST_ITEM*)lParam;
- DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_BOOKMARK_ADD), nullptr, JabberAddBookmarkDlgProc, (LPARAM)¶m);
+ DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_BOOKMARK_ADD), nullptr, JabberAddBookmarkDlgProc, (LPARAM)¶m);
}
return 0;
}
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index d9127e822c..f866614093 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -152,7 +152,7 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info) GetObject(param.bmp, sizeof(bmp), &bmp);
param.w = bmp.bmWidth;
param.h = bmp.bmHeight;
- int res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_CAPTCHAFORM), nullptr, JabberCaptchaFormDlgProc, (LPARAM)¶m);
+ int res = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CAPTCHAFORM), nullptr, JabberCaptchaFormDlgProc, (LPARAM)¶m);
if (mir_wstrcmp(param.Result, L"") == 0 || !res)
sendCaptchaError(info, param.from, param.to, param.challenge);
else
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 3f7c381a15..e989a1e4d3 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1036,7 +1036,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* dat->him = him;
dat->item = item;
dat->ppro = ppro;
- HWND hwndInfo = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_GROUPCHAT_INFO), nullptr, sttUserInfoDlgProc, (LPARAM)dat);
+ HWND hwndInfo = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_GROUPCHAT_INFO), nullptr, sttUserInfoDlgProc, (LPARAM)dat);
ShowWindow(hwndInfo, SW_SHOW);
}
break;
diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp index 269468958e..a48a7fddd8 100644 --- a/protocols/JabberG/src/jabber_filterlist.cpp +++ b/protocols/JabberG/src/jabber_filterlist.cpp @@ -183,7 +183,7 @@ LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lPara fdat->m_hwndEditBox = CreateWindow(L"edit", fdat->m_filterText,
WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_LEFT|ES_AUTOHSCROLL,
0, 0, 0, 0,
- ::GetParent(m_hwnd), (HMENU)-1, g_hInstance, nullptr);
+ ::GetParent(m_hwnd), (HMENU)-1, g_plugin.getInst(), nullptr);
SendMessage(fdat->m_hwndEditBox, WM_SETFONT, (WPARAM)fdat->m_hfntNormal, 0);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index e7763d10da..3e427452fb 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -282,7 +282,7 @@ void JabberFormLayoutSingleControl(TJabberFormControlInfo *item, TJabberFormLayo #define JabberFormCreateLabel() \
CreateWindow(L"static", labelStr, WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE, \
- 0, 0, 0, 0, hwndStatic, (HMENU)-1, g_hInstance, nullptr)
+ 0, 0, 0, 0, hwndStatic, (HMENU)-1, g_plugin.getInst(), nullptr)
TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayoutInfo *layout_info, TJabberFormControlType type, const wchar_t *labelStr, const wchar_t *valueStr)
{
@@ -302,7 +302,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", valueStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD,
0, 0, 0, 0,
- hwndStatic, (HMENU)layout_info->id, g_hInstance, nullptr);
+ hwndStatic, (HMENU)layout_info->id, g_plugin.getInst(), nullptr);
++layout_info->id;
break;
@@ -311,7 +311,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", valueStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN,
0, 0, 0, 0,
- hwndStatic, (HMENU)layout_info->id, g_hInstance, nullptr);
+ hwndStatic, (HMENU)layout_info->id, g_plugin.getInst(), nullptr);
mir_subclassWindow(item->hCtrl, JabberFormMultiLineWndProc);
++layout_info->id;
break;
@@ -320,7 +320,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindowEx(0, L"button", labelStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX | BS_MULTILINE,
0, 0, 0, 0,
- hwndStatic, (HMENU)layout_info->id, g_hInstance, nullptr);
+ hwndStatic, (HMENU)layout_info->id, g_plugin.getInst(), nullptr);
if (valueStr && !mir_wstrcmp(valueStr, L"1"))
SendMessage(item->hCtrl, BM_SETCHECK, 1, 0);
++layout_info->id;
@@ -331,7 +331,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindowExA(WS_EX_CLIENTEDGE, "combobox", nullptr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST,
0, 0, 0, 0,
- hwndStatic, (HMENU)layout_info->id, g_hInstance, nullptr);
+ hwndStatic, (HMENU)layout_info->id, g_plugin.getInst(), nullptr);
++layout_info->id;
break;
@@ -340,7 +340,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindowExA(WS_EX_CLIENTEDGE, "listbox",
nullptr, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_MULTIPLESEL,
0, 0, 0, 0,
- hwndStatic, (HMENU)layout_info->id, g_hInstance, nullptr);
+ hwndStatic, (HMENU)layout_info->id, g_plugin.getInst(), nullptr);
++layout_info->id;
break;
@@ -348,7 +348,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindow(L"edit", valueStr,
WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL,
0, 0, 0, 0,
- hwndStatic, (HMENU)-1, g_hInstance, nullptr);
+ hwndStatic, (HMENU)-1, g_plugin.getInst(), nullptr);
break;
case JFORM_CTYPE_HIDDEN:
@@ -359,7 +359,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", valueStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_AUTOHSCROLL,
0, 0, 0, 0,
- hwndStatic, (HMENU)layout_info->id, g_hInstance, nullptr);
+ hwndStatic, (HMENU)layout_info->id, g_plugin.getInst(), nullptr);
++layout_info->id;
break;
}
@@ -849,7 +849,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, static VOID CALLBACK JabberFormCreateDialogApcProc(void* param)
{
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_FORM), nullptr, JabberFormDlgProc, (LPARAM)param);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FORM), nullptr, JabberFormDlgProc, (LPARAM)param);
}
void CJabberProto::FormCreateDialog(HXML xNode, wchar_t* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata)
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 10a0a4218a..aff1bd2720 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -79,7 +79,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): CLISTFrame frame = { sizeof(frame) };
HWND hwndClist = pcli->hwndContactList;
- frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", nullptr, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, nullptr, g_hInstance, this);
+ frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", nullptr, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, nullptr, g_plugin.getInst(), this);
frame.align = alBottom;
frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default
frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_UNICODE;
@@ -98,7 +98,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): m_hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
- m_hwnd, nullptr, g_hInstance, nullptr);
+ m_hwnd, nullptr, g_plugin.getInst(), nullptr);
SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
CreateInfoItem("$", true);
@@ -136,7 +136,7 @@ void CJabberInfoFrame::InitClass() wcx.cbSize = sizeof(wcx);
wcx.style = CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
wcx.lpfnWndProc = GlobalWndProc;
- wcx.hInstance = g_hInstance;
+ wcx.hInstance = g_plugin.getInst();
wcx.lpszClassName = L"JabberInfoFrameClass";
wcx.hCursor = LoadCursor(nullptr, IDC_ARROW);
RegisterClassEx(&wcx);
@@ -297,7 +297,7 @@ void CJabberInfoFrame::SetToolTip(int id, RECT *rc, wchar_t *pszText) ti.uFlags = TTF_SUBCLASS;
ti.hwnd = m_hwnd;
ti.uId = id;
- ti.hinst = g_hInstance;
+ ti.hinst = g_plugin.getInst();
ti.lpszText = pszText;
ti.rect = *rc;
SendMessage(m_hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 4c105cb6ae..05bb6107f4 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -522,10 +522,10 @@ static IconItem sharedIconList4[] = void g_IconsInit()
{
- Icon_Register(g_hInstance, LPGEN("Protocols") "/" LPGEN("Jabber"), sharedIconList1, _countof(sharedIconList1), GLOBAL_SETTING_PREFIX);
- Icon_Register(g_hInstance, LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs"), sharedIconList2, _countof(sharedIconList2), GLOBAL_SETTING_PREFIX);
- Icon_Register(g_hInstance, LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, _countof(sharedIconList3), GLOBAL_SETTING_PREFIX);
- Icon_Register(g_hInstance, LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, _countof(sharedIconList4), GLOBAL_SETTING_PREFIX);
+ Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Jabber"), sharedIconList1, _countof(sharedIconList1), GLOBAL_SETTING_PREFIX);
+ Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs"), sharedIconList2, _countof(sharedIconList2), GLOBAL_SETTING_PREFIX);
+ Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, _countof(sharedIconList3), GLOBAL_SETTING_PREFIX);
+ Icon_Register(g_plugin.getInst(), LPGEN("Protocols") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, _countof(sharedIconList4), GLOBAL_SETTING_PREFIX);
}
HANDLE g_GetIconHandle(int iconId)
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 98a2dadf9f..aaed20c1d3 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -212,7 +212,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w return TRUE;
case WM_SIZE:
- Utils_ResizeDialog(hwndDlg, g_hInstance, MAKEINTRESOURCEA(IDD_JIDLIST), sttJidListResizer);
+ Utils_ResizeDialog(hwndDlg, g_plugin.getInst(), MAKEINTRESOURCEA(IDD_JIDLIST), sttJidListResizer);
RECT listrc;
LVCOLUMN lvc;
@@ -472,7 +472,7 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param) SetForegroundWindow(*pHwndJidList);
SendMessage(*pHwndJidList, WM_JABBER_REFRESH, 0, (LPARAM)jidListInfo);
}
- else *pHwndJidList = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_JIDLIST), GetForegroundWindow(), JabberMucJidListDlgProc, (LPARAM)jidListInfo);
+ else *pHwndJidList = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_JIDLIST), GetForegroundWindow(), JabberMucJidListDlgProc, (LPARAM)jidListInfo);
}
void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType)
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index ba8d77b14c..6d6946eca3 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1357,7 +1357,7 @@ static LRESULT CALLBACK _RosterNewListProc(HWND hList, UINT msg, WPARAM wParam, wchar_t buff[260];
ListView_GetSubItemRect(hList, lvhti.iItem, lvhti.iSubItem, LVIR_BOUNDS, &rc);
ListView_GetItemText(hList, lvhti.iItem, lvhti.iSubItem, buff, _countof(buff));
- HWND hEditor = CreateWindow(TEXT("EDIT"), buff, WS_CHILD | ES_AUTOHSCROLL, rc.left + 3, rc.top + 2, rc.right - rc.left - 3, rc.bottom - rc.top - 3, hList, nullptr, g_hInstance, nullptr);
+ HWND hEditor = CreateWindow(TEXT("EDIT"), buff, WS_CHILD | ES_AUTOHSCROLL, rc.left + 3, rc.top + 2, rc.right - rc.left - 3, rc.bottom - rc.top - 3, hList, nullptr, g_plugin.getInst(), nullptr);
SendMessage(hEditor, WM_SETFONT, (WPARAM)SendMessage(hList, WM_GETFONT, 0, 0), 0);
ShowWindow(hEditor, SW_SHOW);
SetWindowText(hEditor, buff);
@@ -1448,7 +1448,7 @@ static INT_PTR CALLBACK JabberRosterOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wP }
case WM_SIZE:
- Utils_ResizeDialog(hwndDlg, g_hInstance, MAKEINTRESOURCEA(IDD_OPT_JABBER3), sttRosterEditorResizer);
+ Utils_ResizeDialog(hwndDlg, g_plugin.getInst(), MAKEINTRESOURCEA(IDD_OPT_JABBER3), sttRosterEditorResizer);
break;
case WM_COMMAND:
@@ -1486,7 +1486,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRosterControl(WPARAM, LPARAM) if (rrud.hwndDlg && IsWindow(rrud.hwndDlg))
SetForegroundWindow(rrud.hwndDlg);
else
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_OPT_JABBER3), nullptr, JabberRosterOptDlgProc, (LPARAM)this);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_OPT_JABBER3), nullptr, JabberRosterOptDlgProc, (LPARAM)this);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 018446a3ab..6715ab5605 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -33,7 +33,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleChangePassword(WPARAM, LPARAM) if (IsWindow(m_hwndJabberChangePassword))
SetForegroundWindow(m_hwndJabberChangePassword);
else
- m_hwndJabberChangePassword = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_CHANGEPASSWORD), nullptr, JabberChangePasswordDlgProc, (LPARAM)this);
+ m_hwndJabberChangePassword = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHANGEPASSWORD), nullptr, JabberChangePasswordDlgProc, (LPARAM)this);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 204876b73a..85037d7630 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -105,8 +105,8 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat) int Order = (FieldDat->bHidden) ? -1 : FieldDat->Order; - HWND hwndLabel = CreateWindowEx(0, L"STATIC", (const wchar_t *)TranslateW(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, nullptr, g_hInstance, nullptr); - HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, L"EDIT", (const wchar_t *)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, nullptr, g_hInstance, nullptr); + HWND hwndLabel = CreateWindowEx(0, L"STATIC", (const wchar_t *)TranslateW(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, nullptr, g_plugin.getInst(), nullptr); + HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, L"EDIT", (const wchar_t *)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, nullptr, g_plugin.getInst(), nullptr); SendMessage(hwndLabel, WM_SETFONT, (WPARAM)hFont, 0); SendMessage(hwndVar, WM_SETFONT, (WPARAM)hFont, 0); if (!FieldDat->bHidden) { @@ -707,10 +707,10 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent) { - if (parent && g_hInstance) { + if (parent && g_plugin.getInst()) { ptrW szServer(getWStringA("LoginServer")); if (szServer == nullptr || mir_wstrcmpi(szServer, L"S.ms")) - return CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this); + return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this); } return nullptr; // Failure diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index fdf951ad47..82bd29a43e 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -116,7 +116,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa static VOID CALLBACK JabberPasswordCreateDialogApcProc(void* param)
{
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_PASSWORD), nullptr, JabberPasswordDlgProc, (LPARAM)param);
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_PASSWORD), nullptr, JabberPasswordDlgProc, (LPARAM)param);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 35da917865..73f017b910 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -822,7 +822,7 @@ int CJabberProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) char *szProto = GetContactProto(hContact); if (szProto != nullptr && !mir_strcmp(szProto, m_szModuleName)) { OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_hInstance; + odp.hInstance = g_plugin.getInst(); odp.dwInitParam = (LPARAM)this; odp.pfnDlgProc = JabberUserInfoDlgProc; diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index f82b2e8c70..51676949ab 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -842,9 +842,9 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP EditDlgParam param = { -1, ppro };
int res;
if (nm->hdr.idFrom == IDC_PHONES)
- res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_VCARD_ADDPHONE), hwndDlg, EditPhoneDlgProc, (LPARAM)¶m);
+ res = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_VCARD_ADDPHONE), hwndDlg, EditPhoneDlgProc, (LPARAM)¶m);
else
- res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_VCARD_ADDEMAIL), hwndDlg, EditEmailDlgProc, (LPARAM)¶m);
+ res = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_VCARD_ADDEMAIL), hwndDlg, EditEmailDlgProc, (LPARAM)¶m);
if (res != IDOK)
break;
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
@@ -882,9 +882,9 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP EditDlgParam param = { (int)lvi.lParam, ppro };
int res;
if (nm->hdr.idFrom == IDC_PHONES)
- res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_VCARD_ADDPHONE), hwndDlg, EditPhoneDlgProc, (LPARAM)¶m);
+ res = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_VCARD_ADDPHONE), hwndDlg, EditPhoneDlgProc, (LPARAM)¶m);
else
- res = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_VCARD_ADDEMAIL), hwndDlg, EditEmailDlgProc, (LPARAM)¶m);
+ res = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_VCARD_ADDEMAIL), hwndDlg, EditEmailDlgProc, (LPARAM)¶m);
if (res != IDOK)
break;
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
@@ -1178,7 +1178,7 @@ void CJabberProto::OnUserInfoInit_VCard(WPARAM wParam, LPARAM) m_szPhotoFileName[0] = 0;
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_hInstance;
+ odp.hInstance = g_plugin.getInst();
odp.dwInitParam = (LPARAM)this;
odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
odp.szTitle.w = m_tszUserName;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index df48a3d90c..070af7048e 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1496,7 +1496,7 @@ wchar_t* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, co void g_XstatusIconsInit()
{
wchar_t szFile[MAX_PATH];
- GetModuleFileName(g_hInstance, szFile, _countof(szFile));
+ GetModuleFileName(g_plugin.getInst(), szFile, _countof(szFile));
if (wchar_t *p = wcsrchr(szFile, '\\'))
mir_wstrcpy(p + 1, L"..\\Icons\\xstatus_jabber.dll");
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 37dacc2085..72833d8381 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -577,8 +577,6 @@ private: /*******************************************************************
* Global variables
*******************************************************************/
-extern HINSTANCE g_hInstance;
-
extern HANDLE hExtraMood;
extern HANDLE hExtraActivity;
|