diff options
author | George Hazan <ghazan@miranda.im> | 2018-07-11 21:32:58 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-07-11 21:33:11 +0300 |
commit | f719c8b921c7a46b76453476204224d40c682914 (patch) | |
tree | c6d92dc450893e7f5abe60c2046ec9c2d1e3db36 | |
parent | 16ad355c8bdc438c3107ee3ba3ad0bf0b8c395fa (diff) |
int hLangpack/m_hLang removed and replaced with HPLUGIN
432 files changed, 963 insertions, 1295 deletions
diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas index 2b41c77520..dc8c8ecced 100644 --- a/include/delphi/m_api.pas +++ b/include/delphi/m_api.pas @@ -258,7 +258,6 @@ initialization g_plugin.m_hInst := hInstance;
g_plugin.m_pInfo := @PluginInfo;
RegisterPlugin(g_plugin);
- hLangpack := g_plugin.m_hLang;
finalization
UnregisterPlugin(g_plugin);
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 7e913e2d7a..28653f3bd1 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -198,10 +198,10 @@ type tagIconItemW = tIconItemW;
procedure mir_Icon_Register(hInst:HINST; const szSection:PAnsiChar; pIcons:pIconItem;
- iCount:size_t; prefix:PAnsiChar; hLangpack:int=0); stdcall;
+ iCount:size_t; prefix:PAnsiChar; pPlugin:Pointer); stdcall;
external CoreDLL name 'Icon_Register';
procedure mir_Icon_RegisterW(hInst:HINST; const szSection:PWideChar; pIcons:pIconItemW;
- iCount:size_t; prefix:PAnsiChar; hLangpack:int=0); stdcall;
+ iCount:size_t; prefix:PAnsiChar; pPlugin:Pointer); stdcall;
external CoreDLL name 'Icon_RegisterT';
///////////////////////////////////////////////////////////////////////////////
@@ -226,13 +226,13 @@ function LoadLangPack(const szLangPack:PWideChar):int; stdcall; procedure ReloadLangpack(pszStr:PWideChar); stdcall;
external CoreDLL name 'ReloadLangpack';
-function TranslateA_LP(const str:PAnsiChar; hLang:int):PAnsiChar; stdcall;
+function TranslateA_LP(const str:PAnsiChar; pPlugin:Pointer):PAnsiChar; stdcall;
external CoreDLL name 'TranslateA_LP';
-function TranslateW_LP(const str:PWideChar; hLang:int):PWideChar; stdcall;
+function TranslateW_LP(const str:PWideChar; pPlugin:Pointer):PWideChar; stdcall;
external CoreDLL name 'TranslateW_LP';
-procedure TranslateMenu_LP(hMenu:HMENU; hLang:int); stdcall;
+procedure TranslateMenu_LP(hMenu:HMENU; pPlugin:Pointer); stdcall;
external CoreDLL name 'TranslateMenu_LP';
-procedure TranslateDialog_LP(hDlg:HWND; hLang:int); stdcall;
+procedure TranslateDialog_LP(hDlg:HWND; pPlugin:Pointer); stdcall;
external CoreDLL name 'TranslateDialog_LP';
function mir_hash(const key:pointer; len:uint):uint; stdcall;
diff --git a/include/delphi/m_fontservice.inc b/include/delphi/m_fontservice.inc index c6dacc42e1..4c6f5c09f4 100644 --- a/include/delphi/m_fontservice.inc +++ b/include/delphi/m_fontservice.inc @@ -115,7 +115,7 @@ const { fired when a user modifies font settings, so reget your fonts }
ME_FONT_RELOAD:PAnsiChar = 'Font/Reload';
-function Font_Register(pFont:pFontID; hLang:int) : int; stdcall; external AppDll;
+function Font_Register(pFont:pFontID; pPlugin:Pointer) : int; stdcall; external AppDll;
function Font_Get(pGroup,pName:pAnsiChar; pFont:pLogFontA) : longint; stdcall; external AppDll;
type
@@ -151,54 +151,7 @@ const { fired when a user modifies font settings, so reget your fonts and colours }
ME_COLOUR_RELOAD:PAnsiChar = 'Colour/Reload';
-function Colour_Register(pColour:pColourID; hLang:int) : int; stdcall; external AppDll;
+function Colour_Register(pColour:pColourID; pPlugin:Pointer) : int; stdcall; external AppDll;
function Colour_Get(pGroup,pName:pAnsiChar) : longint; stdcall; external AppDll;
-//////////////////////////////////////////////////////////////////////////
-//
-// EFFECTS
-//
-type
- FONTEFFECT_tag = record
- effectIndex :byte;
- baseColour :dword; // ARGB
- secondaryColour:dword; // ARGB
- end;
- TFONTEFFECT = FONTEFFECT_tag;
-
-type
- EffectID_tag = record
- cbSize :int;
- group :array [0..63] of AnsiChar;
- name :array [0..63] of AnsiChar;
- dbSettingsGroup:array [0..31] of AnsiChar;
- setting :array [0..31] of AnsiChar;
- flags :dword;
- defeffect :TFONTEFFECT;
- order :int;
- value :TFONTEFFECT;
- end;
- PEffectID = ^TEffectID;
- TEffectID = EffectID_tag;
-
-type
- EffectIDW_tag = record
- cbSize :int;
- group :array [0..63] of WideChar;
- name :array [0..63] of WideChar;
- dbSettingsGroup:array [0..31] of AnsiChar;
- setting :array [0..31] of AnsiChar;
- flags :dword;
- defeffect :TFONTEFFECT;
- order :int;
- value :TFONTEFFECT;
- end;
- PEffectIDW = ^TEffectIDW;
- TEffectIDW = EffectIDW_tag;
-
-const
-// fired when a user modifies font settings, so reget your fonts and colours
-// wparam = lparam = 0
- ME_EFFECT_RELOAD:PAnsiChar = 'Effect/Reload';
-
{$ENDIF}
diff --git a/include/delphi/m_genmenu.inc b/include/delphi/m_genmenu.inc index 15ee72abeb..5374a42731 100644 --- a/include/delphi/m_genmenu.inc +++ b/include/delphi/m_genmenu.inc @@ -156,7 +156,7 @@ type szName :TCHAR;
flags :integer;
hIcon :HICON; // or hIcolibItem:THANDLE;
- hLangpack :int;
+ pPlugin :Pointer;
uid :MUUID;
end;
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index bea8231de3..cedf8998d5 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -29,7 +29,7 @@ function TranslateWideString(const sz:WideString):WideString; function TranslateUnicodeString(sz: UnicodeString): UnicodeString;
procedure TranslateDialogDefault(hwndDlg: THANDLE);
procedure TranslateMenu(hMenu: HMENU);
-function Langpack_Register:int_ptr;
+function Langpack_Register:Pointer;
function CreateProtoServiceFunction(const szModule, szService: PAnsiChar; serviceProc: TMIRANDASERVICE): int_ptr;
@@ -61,16 +61,9 @@ function Options_Open(group,page,tab:PWideChar):int_ptr; procedure MIcoTab_AddItem (hwnd:HWND; lptzName:PAnsiChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
procedure MIcoTab_AddItemW(hwnd:HWND; lptzName:PWideChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
-function Crypto_RegisterEngine(pProvider:PCRYPTO_PROVIDER):THANDLE;
-procedure Crypto_EnumProviders(var numProvs:int; var pResult:array of PCRYPTO_PROVIDER);
-function Crypto_GetProvider(pszName:PAnsiChar):PCRYPTO_PROVIDER;
-
{$ELSE}
-var
- hLangpack:int = 0;
-
-function _Srmm_AddButton(bbdi:pBBButton;_hLang:int) : integer; stdcall;
+function _Srmm_AddButton(bbdi:pBBButton; pPlugin:Pointer) : integer; stdcall;
external AppDll name 'Srmm_AddButton';
function _AddMainMenuItem(mi:PMO_MenuItem) : HGENMENU; stdcall;
@@ -219,43 +212,43 @@ end; function TranslateW(sz: PWideChar): PWideChar;
begin
- result:=TranslateW_LP(sz, hLangpack);
+ result:=TranslateW_LP(sz, @g_plugin);
end;
function Translate(sz: PAnsiChar): PAnsiChar;
begin
- result:=TranslateA_LP(sz, hLangpack);
+ result:=TranslateA_LP(sz, @g_plugin);
end;
function TranslateString(const sz:AnsiString):AnsiString;
begin
- Result:=AnsiString(TranslateA_LP(PAnsiChar(sz),hLangpack));
+ Result:=AnsiString(TranslateA_LP(PAnsiChar(sz),@g_plugin));
end;
function TranslateWideString(const sz:WideString):WideString;
begin
- Result:=WideString(TranslateW_LP(PWideChar(sz),hLangpack));
+ Result:=WideString(TranslateW_LP(PWideChar(sz),@g_plugin));
end;
function TranslateUnicodeString(sz: UnicodeString): UnicodeString;
begin
- Result:=UnicodeString(TranslateW_LP(PWideChar(sz),hLangpack));
+ Result:=UnicodeString(TranslateW_LP(PWideChar(sz),@g_plugin));
end;
procedure TranslateDialogDefault(hwndDlg: THANDLE);
begin
- TranslateDialog_LP(hwndDlg,hLangpack);
+ TranslateDialog_LP(hwndDlg,@g_plugin);
end;
procedure TranslateMenu(hMenu: HMENU);
begin
- TranslateMenu_LP(hMenu,hLangpack);
+ TranslateMenu_LP(hMenu,@g_plugin);
end;
-function Langpack_Register:int_ptr;
+function Langpack_Register:Pointer;
begin
cli := Clist_GetInterface();
- result := hLangpack;
+ result := @g_plugin;
end;
@@ -276,83 +269,83 @@ end; function Menu_AddContextFrameMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=CallService(MS_CLIST_ADDCONTEXTFRAMEMENUITEM, 0,LPARAM(mi));
end;
function Menu_AddMainMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddMainMenuItem(mi);
end;
function Menu_AddContactMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddContactMenuItem(mi, nil);
end;
function Menu_AddStatusMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddStatusMenuItem(mi, nil);
end;
function Menu_AddProtoMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddProtoMenuItem(mi, nil);
end;
function Menu_AddTrayMenuItem(mi:PMO_MenuItem):HGENMENU;
begin
- mi^.hLangpack:=hLangpack;
+ mi^.pPlugin:=@g_plugin;
result:=_AddTrayMenuItem(mi);
end;
function Hotkey_Register(hk:PHOTKEYDESC):int_ptr;
begin
- result:=_Hotkey_Register(hk, hLangpack);
+ result:=_Hotkey_Register(hk, @g_plugin);
end;
function Skin_AddIcon(si:PSKINICONDESC):THANDLE;
begin
- result:=IcoLib_AddIcon(si, hLangpack);
+ result:=IcoLib_AddIcon(si, @g_plugin);
end;
procedure Icon_Register(hInst:HINST; const szSection:PAnsiChar; pIcons:pIconItem; iCount:size_t; prefix:PAnsiChar);
begin
- mir_Icon_Register(hInst, szSection, pIcons, iCount, prefix, hLangpack);
+ mir_Icon_Register(hInst, szSection, pIcons, iCount, prefix, @g_plugin);
end;
procedure Icon_RegisterW(hInst:HINST; const szSection:PWideChar; pIcons:pIconItemW; iCount:size_t; prefix:PAnsiChar);
begin
- mir_Icon_RegisterW(hInst, szSection, pIcons, iCount, prefix, hLangpack);
+ mir_Icon_RegisterW(hInst, szSection, pIcons, iCount, prefix, @g_plugin);
end;
procedure FontRegister(pFontID:pFontID);
begin
- Font_Register(pFontID, hLangpack);
+ Font_Register(pFontID, @g_plugin);
end;
procedure ColourRegister(pColorID:pColourID);
begin
- Colour_Register(pColorID, hLangpack);
+ Colour_Register(pColorID, @g_plugin);
end;
function TopToolbar_AddButton(pButton:PTTBButton):THANDLE;
begin
- result:=CallService(MS_TTB_ADDBUTTON, WPARAM(pButton), hLangpack);
+ result:=CallService(MS_TTB_ADDBUTTON, WPARAM(pButton), LPARAM(@g_plugin));
end;
function Options_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
begin
- result:=_Options_AddPage(wParam, odp, hLangpack);
+ result:=_Options_AddPage(wParam, odp, @g_plugin);
end;
function Options_Open(group,page,tab:PWideChar):int_ptr;
begin
- result:=_Options_Open(group,page,tab,hLangpack);
+ result:=_Options_Open(group,page,tab,@g_plugin);
end;
procedure MIcoTab_AddItem(hwnd:HWND; lptzName:PAnsiChar; hIcon:HICON; data:LPARAM; bSharedIcon:bool);
@@ -385,22 +378,7 @@ end; procedure Srmm_AddButton(bbdi:pBBButton);
begin
- _Srmm_AddButton(bbdi,hLangpack);
-end;
-
-function Crypto_RegisterEngine(pProvider:PCRYPTO_PROVIDER):THANDLE;
-begin
- result:=THANDLE(CallService(MS_CRYPTO_REGISTER_ENGINE, hLangpack, LPARAM(pProvider)));
-end;
-
-procedure Crypto_EnumProviders(var numProvs:int; var pResult:array of PCRYPTO_PROVIDER);
-begin
- CallService(MS_CRYPTO_ENUM_PROVIDERS, WPARAM(numProvs), LPARAM(@pResult));
-end;
-
-function Crypto_GetProvider(pszName:PAnsiChar):PCRYPTO_PROVIDER;
-begin
- result:=PCRYPTO_PROVIDER(CallService(MS_CRYPTO_GET_PROVIDER, 0, LPARAM(pszName)));
+ _Srmm_AddButton(bbdi,@g_plugin);
end;
function UuidFromStringA(StringUuid:PAnsiChar; var Uuid:TGUID) : integer; stdcall; external 'Rpcrt4.dll';
diff --git a/include/delphi/m_hotkeys.inc b/include/delphi/m_hotkeys.inc index ba3450f33c..4fb0cfc659 100644 --- a/include/delphi/m_hotkeys.inc +++ b/include/delphi/m_hotkeys.inc @@ -40,7 +40,7 @@ type end;
-function _Hotkey_Register(hk:PHOTKEYDESC; _hLang:int): int; stdcall; external AppDll name 'Hotkey_Register';
+function _Hotkey_Register(hk:PHOTKEYDESC; pPlugin:Pointer): int; stdcall; external AppDll name 'Hotkey_Register';
function Hotkey_Unregister(hk:PAnsiChar): int; stdcall; external AppDll;
{
diff --git a/include/delphi/m_icolib.inc b/include/delphi/m_icolib.inc index 89b1701b21..57e68e57ef 100644 --- a/include/delphi/m_icolib.inc +++ b/include/delphi/m_icolib.inc @@ -33,7 +33,7 @@ const returns a handle to the newly added item
}
-function IcoLib_AddIcon(pIcon:PSKINICONDESC; iLang:int):THANDLE; stdcall;
+function IcoLib_AddIcon(pIcon:PSKINICONDESC; pPlugin:Pointer):THANDLE; stdcall;
external AppDLL name 'IcoLib_AddIcon';
{
diff --git a/include/delphi/m_options.inc b/include/delphi/m_options.inc index 55d2411654..e3663cd8e9 100644 --- a/include/delphi/m_options.inc +++ b/include/delphi/m_options.inc @@ -58,8 +58,7 @@ type szTab :TChar; // [TRANSLATED-BY-CORE]
pfnDlgProc :pointer;
pszTemplate :PAnsiChar;
- hInstance :THANDLE;
- hLangpack :int;
+ pPlugin :Pointer;
flags :dword; //
dwInitParam :LPARAM; // a value to pass to lParam of WM_INITDIALOG message
end;
@@ -73,9 +72,9 @@ const const
PSM_GETBOLDFONT = WM_USER+102; //returns HFONT used for group box titles
-function _Options_AddPage(param:WPARAM; opts:POPTIONSDIALOGPAGE; lang:int) : int; stdcall; external AppDll name 'Options_AddPage';
+function _Options_AddPage(param:WPARAM; opts:POPTIONSDIALOGPAGE; lang:Pointer) : int; stdcall; external AppDll name 'Options_AddPage';
-function _Options_Open(group,page,tab:PWideChar; lang:int):int_ptr; stdcall; external AppDll name 'Options_Open';
-function _Options_OpenPage(group,page,tab:PWideChar; lang:int):HWND; stdcall; external AppDll name 'Options_OpenPage';
+function _Options_Open(group,page,tab:PWideChar; lang:Pointer):int_ptr; stdcall; external AppDll name 'Options_Open';
+function _Options_OpenPage(group,page,tab:PWideChar; lang:Pointer):HWND; stdcall; external AppDll name 'Options_OpenPage';
{$ENDIF}
diff --git a/include/m_chat.h b/include/m_chat.h index 906b7c616a..978e1e1860 100644 --- a/include/m_chat.h +++ b/include/m_chat.h @@ -534,7 +534,7 @@ typedef struct { #define ME_GC_BUILDMENU "GChat/BuildMenu"
-EXTERN_C MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, int langId);
+EXTERN_C MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, HPLUGIN pPlugin);
//////////////////////////////////////////////////////////////////////////
// Get Chat ToolTip Text for buddy
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index 033d5d36da..4e69c9f4e4 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -247,7 +247,7 @@ struct CHAT_MANAGER_INITDATA int cbModuleInfo, cbSession;
wchar_t *szFontGroup;
int iFontMode;
- int iLangId;
+ HPLUGIN pPlugin;
};
typedef BOOL (*pfnDoTrayIcon)(SESSION_INFO *si, GCEVENT *gce);
diff --git a/include/m_cluiframes.h b/include/m_cluiframes.h index cc200c4791..e1e5a3640c 100644 --- a/include/m_cluiframes.h +++ b/include/m_cluiframes.h @@ -100,7 +100,7 @@ struct CLISTFrame //////////////////////////////////////////////////////////////////////////
// adds a frame window
// wParam=(CLISTFrame*)
-// lParam=0
+// lParam=(HPLUGIN)&g_plugin
// returns an integer, the frame id.
#define MS_CLIST_FRAMES_ADDFRAME "CListFrames/AddFrame"
diff --git a/include/m_core.h b/include/m_core.h index ffd97951df..ab7b00e0a4 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -55,6 +55,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. typedef struct TMO_IntMenuItem* HGENMENU;
+class CMPluginBase;
+typedef const CMPluginBase* HPLUGIN;
+
#define MIR_APP_DLL(T) MIR_APP_EXPORT T __stdcall
#pragma warning(disable:4201 4127 4312 4706)
@@ -155,33 +158,31 @@ MIR_CORE_DLL(char*) mir_urlEncode(const char *szUrl); ///////////////////////////////////////////////////////////////////////////////
// icons support
-typedef struct tagIconItem
+struct IconItem
{
char *szDescr, *szName;
int defIconID, size;
HANDLE hIcolib;
-}
- IconItem;
+};
-typedef struct tagIconItemT
+struct IconItemT
{
wchar_t *tszDescr;
char *szName;
int defIconID, size;
HANDLE hIcolib;
-}
- IconItemT;
+};
-MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char* szSection, IconItem* pIcons, size_t iCount, const char *prefix, int langId);
-MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t* szSection, IconItemT* pIcons, size_t iCount, const char *prefix, int langId);
+MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, const char *prefix, HPLUGIN pPlugin);
+MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, const char *prefix, HPLUGIN pPlugin);
///////////////////////////////////////////////////////////////////////////////
// language packs support
-MIR_CORE_DLL(unsigned int) mir_hash(const void * key, unsigned int len);
+MIR_CORE_DLL(unsigned int) mir_hash(const void *key, unsigned int len);
#pragma optimize("gt", on)
-__forceinline unsigned int mir_hashstr(const char * key)
+__forceinline unsigned int mir_hashstr(const char *key)
{
if (key == nullptr) return 0;
else {
@@ -189,7 +190,7 @@ __forceinline unsigned int mir_hashstr(const char * key) return mir_hash(key, len);
} }
-__forceinline unsigned int mir_hashstrW(const wchar_t * key)
+__forceinline unsigned int mir_hashstrW(const wchar_t *key)
{
if (key == nullptr) return 0;
else {
diff --git a/include/m_crypto.h b/include/m_crypto.h index 31007715a4..7a6a105e79 100644 --- a/include/m_crypto.h +++ b/include/m_crypto.h @@ -69,7 +69,7 @@ struct CRYPTO_PROVIDER {
DWORD dwSize;
DWORD dwFlags; // one of CPF_* constants
- int iLangId;
+ HPLUGIN pPlugin;
char *pszName; // unique id
MAllStrings szDescr; // description
diff --git a/include/m_extraicons.h b/include/m_extraicons.h index 3bb9da0000..172358404a 100644 --- a/include/m_extraicons.h +++ b/include/m_extraicons.h @@ -101,7 +101,7 @@ struct EXTRAICON_INFO LPARAM onClickParam;
};
-EXTERN_C MIR_APP_DLL(void) KillModuleExtraIcons(int langId);
+EXTERN_C MIR_APP_DLL(void) KillModuleExtraIcons(HPLUGIN pPlugin);
#pragma warning(disable:4505)
diff --git a/include/m_fontservice.h b/include/m_fontservice.h index 7910be2ba7..ffb8cbfea2 100644 --- a/include/m_fontservice.h +++ b/include/m_fontservice.h @@ -97,8 +97,8 @@ struct FontIDW };
// register a font
-EXTERN_C MIR_APP_DLL(int) Font_Register(FontID *pFont, int langId);
-EXTERN_C MIR_APP_DLL(int) Font_RegisterW(FontIDW *pFont, int langId);
+EXTERN_C MIR_APP_DLL(int) Font_Register(FontID *pFont, HPLUGIN);
+EXTERN_C MIR_APP_DLL(int) Font_RegisterW(FontIDW *pFont, HPLUGIN);
// get a font
// will fill the logfont structure passed in with the user's choices, or the default if it was set and the user has not chosen a font yet,
@@ -161,8 +161,8 @@ struct ColourIDW // [note - a colour with name 'Background' [translated!] has special meaning and will be used as the background colour of
// the font list box in the options, for the given group]
-EXTERN_C MIR_APP_DLL(int) Colour_Register(ColourID *pFont, int langId);
-EXTERN_C MIR_APP_DLL(int) Colour_RegisterW(ColourIDW *pFont, int langId);
+EXTERN_C MIR_APP_DLL(int) Colour_Register(ColourID *pFont, HPLUGIN);
+EXTERN_C MIR_APP_DLL(int) Colour_RegisterW(ColourIDW *pFont, HPLUGIN);
// get a colour
EXTERN_C MIR_APP_DLL(COLORREF) Colour_Get(const char *szGroup, const char *szName);
@@ -221,8 +221,8 @@ struct EffectIDW // wparam = (EffectID *)&effect_id
// lparam = 0
-EXTERN_C MIR_APP_DLL(int) Effect_Register(EffectID *pEffect, int langId);
-EXTERN_C MIR_APP_DLL(int) Effect_RegisterW(EffectIDW *pEffect, int langId);
+EXTERN_C MIR_APP_DLL(int) Effect_Register(EffectID *pEffect, HPLUGIN);
+EXTERN_C MIR_APP_DLL(int) Effect_RegisterW(EffectIDW *pEffect, HPLUGIN);
// get a effect
// wparam = (EffectID *)&effect_id (only name and group matter)
@@ -236,8 +236,8 @@ EXTERN_C MIR_APP_DLL(int) Effect_GetW(const wchar_t *wszGroup, const wchar_t *sz // wparam = lparam = 0
#define ME_EFFECT_RELOAD "Effect/Reload"
-EXTERN_C MIR_APP_DLL(void) KillModuleFonts(int langId);
-EXTERN_C MIR_APP_DLL(void) KillModuleColours(int langId);
-EXTERN_C MIR_APP_DLL(void) KillModuleEffects(int langId);
+EXTERN_C MIR_APP_DLL(void) KillModuleFonts(HPLUGIN);
+EXTERN_C MIR_APP_DLL(void) KillModuleColours(HPLUGIN);
+EXTERN_C MIR_APP_DLL(void) KillModuleEffects(HPLUGIN);
#endif // _FONT_SERVICE_API_INC
diff --git a/include/m_genmenu.h b/include/m_genmenu.h index 64c599121b..db2c362e2d 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -40,7 +40,7 @@ struct TMO_MenuItem HICON hIcon;
HANDLE hIcolibItem;
};
- int langId;
+ const CMPluginBase *pPlugin;
MUUID uid;
};
@@ -50,10 +50,10 @@ struct TMO_MenuItem #ifdef __cplusplus
struct CMenuItem : public TMO_MenuItem
{
- CMenuItem(const CMPluginBase &pPlugin)
+ CMenuItem(HPLUGIN _p)
{
memset(this, 0, sizeof(CMenuItem));
- this->langId = pPlugin.m_hLang;
+ this->pPlugin = _p;
}
};
#endif
@@ -107,7 +107,7 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pItem // Adds new submenu
// Returns HGENMENU on success, or NULL on failure
-EXTERN_C MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib, int langId);
+EXTERN_C MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib, HPLUGIN pPlugin);
/////////////////////////////////////////////////////////////////////////////////////////
// process a WM_DRAWITEM message for user context menus v0.1.1.0+
@@ -254,7 +254,7 @@ EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis); /////////////////////////////////////////////////////////////////////////////////////////
// kills all menu items & submenus that belong to the language id given
-EXTERN_C MIR_APP_DLL(void) KillModuleMenus(int langId);
+EXTERN_C MIR_APP_DLL(void) KillModuleMenus(HPLUGIN pPlugin);
#endif // M_GENMENU_H__
diff --git a/include/m_hotkeys.h b/include/m_hotkeys.h index 3964415921..72e8d6b359 100644 --- a/include/m_hotkeys.h +++ b/include/m_hotkeys.h @@ -53,7 +53,7 @@ struct HOTKEYDESC // Registers new hotkey
// Returns 0 on failure or hotkey atom id on success
-EXTERN_C MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *hk, int langId);
+EXTERN_C MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *hk, HPLUGIN pPlugin);
/////////////////////////////////////////////////////////////////////////////////////////
// Unregister existing hotkey
@@ -88,6 +88,6 @@ EXTERN_C MIR_APP_DLL(void) Hotkey_Unsubclass(HWND hwndEdit); /////////////////////////////////////////////////////////////////////////////////////////
-EXTERN_C MIR_APP_DLL(void) KillModuleHotkeys(int langId);
+EXTERN_C MIR_APP_DLL(void) KillModuleHotkeys(HPLUGIN pPlugin);
#endif // M_HOTKEYS_H__
diff --git a/include/m_icolib.h b/include/m_icolib.h index 465ccf36b2..c229069cb8 100644 --- a/include/m_icolib.h +++ b/include/m_icolib.h @@ -60,7 +60,7 @@ extern "C" // Adds an icon into the icon library
// returns a handle to the newly added item
-MIR_APP_DLL(HANDLE) IcoLib_AddIcon(const SKINICONDESC *sid, int langId);
+MIR_APP_DLL(HANDLE) IcoLib_AddIcon(const SKINICONDESC *sid, HPLUGIN pPlugin);
///////////////////////////////////////////////////////////////////////////////
// Removes an icon from icon library by icon's name or handle
@@ -117,7 +117,7 @@ MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd); ///////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleIcons(int langId);
+MIR_APP_DLL(void) KillModuleIcons(HPLUGIN pPlugin);
#if defined(__cplusplus)
}
diff --git a/include/m_langpack.h b/include/m_langpack.h index b097053515..2f4dbfa404 100644 --- a/include/m_langpack.h +++ b/include/m_langpack.h @@ -45,14 +45,14 @@ EXTERN_C MIR_CORE_DLL(int) LoadLangPackModule(void); EXTERN_C MIR_CORE_DLL(int) LoadLangPack(const wchar_t *szLangPack);
EXTERN_C MIR_CORE_DLL(void) ReloadLangpack(wchar_t *pszStr);
-EXTERN_C MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int hLang = 0);
-EXTERN_C MIR_CORE_DLL(wchar_t*) TranslateW_LP(const wchar_t *str, int hLang = 0);
-EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang = 0);
+EXTERN_C MIR_CORE_DLL(char*) TranslateA_LP(const char *str, HPLUGIN = nullptr);
+EXTERN_C MIR_CORE_DLL(wchar_t*) TranslateW_LP(const wchar_t *str, HPLUGIN = nullptr);
+EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, HPLUGIN = nullptr);
-#define Translate(s) TranslateA_LP(s, g_plugin.m_hLang)
-#define TranslateW(s) TranslateW_LP(s, g_plugin.m_hLang)
-#define TranslateT(s) TranslateW_LP(_A2W(s), g_plugin.m_hLang)
-#define TranslateDialogDefault(h) TranslateDialog_LP(h, g_plugin.m_hLang)
+#define Translate(s) TranslateA_LP(s, &g_plugin)
+#define TranslateW(s) TranslateW_LP(s, &g_plugin)
+#define TranslateT(s) TranslateW_LP(_A2W(s), &g_plugin)
+#define TranslateDialogDefault(h) TranslateDialog_LP(h, &g_plugin)
// If you're storing some string for calling later-on Translate or using it
// with an API call that does translation automatically marked with
@@ -68,9 +68,9 @@ EXTERN_C MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int hLang = 0); // translates a menu into the user's local language
// returns 0 on success, nonzero on failure
-EXTERN_C MIR_CORE_DLL(void) TranslateMenu_LP(HMENU, int langId);
+EXTERN_C MIR_CORE_DLL(void) TranslateMenu_LP(HMENU, HPLUGIN = nullptr);
-#define TranslateMenu(h) TranslateMenu_LP(h, g_plugin.m_hLang)
+#define TranslateMenu(h) TranslateMenu_LP(h, &g_plugin)
/////////////////////////////////////////////////////////////////////////////////////////
// returns the codepage used in the language pack
@@ -92,12 +92,6 @@ EXTERN_C MIR_CORE_DLL(int) Langpack_GetDefaultLocale(void); EXTERN_C MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr);
/////////////////////////////////////////////////////////////////////////////////////////
-// retrieves the language id of a plugin by its HINSTANCE
-// returns id if found, or 0 if error occurred
-
-EXTERN_C MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE);
-
-/////////////////////////////////////////////////////////////////////////////////////////
// reloads langpack
// wParam = 0 (ignored)
// lParam = (LPARAM)(wchar_t*)langpack file name or NULL to reload the current one
diff --git a/include/m_message.h b/include/m_message.h index 2af205867b..36cab96453 100644 --- a/include/m_message.h +++ b/include/m_message.h @@ -163,7 +163,7 @@ struct StatusIconData #define MBCF_RIGHTBUTTON 0x01 // if this flag is specified, the click was a right button - otherwize it was a left click
// adds an icon
-EXTERN_C MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, int langId);
+EXTERN_C MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, HPLUGIN pPlugin);
// removes an icon
EXTERN_C MIR_APP_DLL(void) Srmm_RemoveIcon(const char *szProto, DWORD iconId);
@@ -244,7 +244,7 @@ struct BBButton // adds a new toolbar button
// returns button's handle on success or NULL otherwise
-EXTERN_C MIR_APP_DLL(HANDLE) Srmm_AddButton(const BBButton *bbdi, int langId);
+EXTERN_C MIR_APP_DLL(HANDLE) Srmm_AddButton(const BBButton *bbdi, HPLUGIN);
// modifies the existing toolbar button
// returns 0 on success and nonzero value otherwise
diff --git a/include/m_options.h b/include/m_options.h index b8e0404425..dcf038a64c 100644 --- a/include/m_options.h +++ b/include/m_options.h @@ -65,8 +65,7 @@ struct OPTIONSDIALOGPAGE MAllStrings szTitle, szGroup, szTab; // [TRANSLATED-BY-CORE]
DLGPROC pfnDlgProc;
char *pszTemplate;
- HINSTANCE hInstance;
- int langId;
+ HPLUGIN pPlugin;
DWORD flags;
union {
@@ -82,9 +81,9 @@ struct OPTIONSDIALOGPAGE #define PSM_GETBOLDFONT (WM_USER+102) //returns HFONT used for group box titles
-EXTERN_C MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, int langId);
+EXTERN_C MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, HPLUGIN);
-EXTERN_C MIR_APP_DLL(void) KillModuleOptions(int langId);
+EXTERN_C MIR_APP_DLL(void) KillModuleOptions(HPLUGIN);
// The behaviour if the options dialog is already open is that it will just be
// activated, the page won't be changed. This may change in the future.
@@ -95,9 +94,9 @@ EXTERN_C MIR_APP_DLL(void) KillModuleOptions(int langId); // Opens the options dialog, optionally at the specified page
// Returns 0 on success, nonzero on failure
-EXTERN_C MIR_APP_DLL(int) Options_Open(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, int langId);
+EXTERN_C MIR_APP_DLL(int) Options_Open(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, HPLUGIN);
// Opens the options dialog, with only specified page
-EXTERN_C MIR_APP_DLL(HWND) Options_OpenPage(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, int langId);
+EXTERN_C MIR_APP_DLL(HWND) Options_OpenPage(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, HPLUGIN);
#endif //M_OPTIONS_H__
diff --git a/include/m_skin.h b/include/m_skin.h index 8a62a295e6..36bf3eafe5 100644 --- a/include/m_skin.h +++ b/include/m_skin.h @@ -134,7 +134,7 @@ EXTERN_C MIR_APP_DLL(int) Skin_PlaySoundFile(const wchar_t *pwszFileName); /////////////////////////////////////////////////////////////////////////////////////////
-EXTERN_C MIR_APP_DLL(void) KillModuleSounds(int langId);
+EXTERN_C MIR_APP_DLL(void) KillModuleSounds(HPLUGIN);
/////////////////////////////////////////////////////////////////////////////////////////
// sent when the icons DLL has been changed in the options dialog, and everyone
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index 7681480c1b..78361891a7 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -44,27 +44,27 @@ struct CustomButtonData : public MZeroedObject ~CustomButtonData() {} - int m_dwPosition; // default order pos of button, counted from window edge (left or right) + int m_dwPosition; // default order pos of button, counted from window edge (left or right) - int m_dwButtonID; // id of button used while button creation and to store button info in DB - ptrA m_pszModuleName; // module name without spaces and underline symbols (e.g. "tabsrmm") + int m_dwButtonID; // id of button used while button creation and to store button info in DB + ptrA m_pszModuleName; // module name without spaces and underline symbols (e.g. "tabsrmm") - int m_dwButtonCID; // button's control id - int m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag + int m_dwButtonCID; // button's control id + int m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag - ptrW m_pwszText; // button's text - ptrW m_pwszTooltip; // button's tooltip + ptrW m_pwszText; // button's text + ptrW m_pwszTooltip; // button's tooltip - int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow - HANDLE m_hIcon; // Handle to icolib registred icon + int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow + HANDLE m_hIcon; // Handle to icolib registred icon - bool m_bIMButton, m_bChatButton; - bool m_bCanBeHidden, m_bCantBeHidden, m_bHidden, m_bAutoHidden, m_bSeparator, m_bDisabled, m_bPushButton; - bool m_bRSided; - BYTE m_opFlags; - int m_iLangId; - DWORD m_dwOrigPosition; - struct THotkeyItem *m_hotkey; + bool m_bIMButton, m_bChatButton; + bool m_bCanBeHidden, m_bCantBeHidden, m_bHidden, m_bAutoHidden, m_bSeparator, m_bDisabled, m_bPushButton; + bool m_bRSided; + BYTE m_opFlags; + HPLUGIN m_pPlugin; + DWORD m_dwOrigPosition; + struct THotkeyItem *m_hotkey; struct { bool bit1 : 1, bit2 : 1, bit3 : 1, bit4 : 1; diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 4837b5f28e..d1209ca99b 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -139,12 +139,6 @@ struct PLUGININFOEX #define ME_SYSTEM_MODULEUNLOAD "Miranda/System/UnloadModule"
/////////////////////////////////////////////////////////////////////////////////////////
-// initializes the plugin-specific translation context v0.10.0+
-// always returns 0
-
-EXTERN_C MIR_CORE_DLL(void) mir_getLP(const PLUGININFOEX *pInfo, int *_hLang);
-
-/////////////////////////////////////////////////////////////////////////////////////////
// plugin's class
// initializes an empty account
@@ -174,8 +168,6 @@ protected: void SetUniqueId(const char *pszUniqueId);
public:
- int m_hLang;
-
void debugLogA(LPCSTR szFormat, ...);
void debugLogW(LPCWSTR wszFormat, ...);
@@ -194,13 +186,13 @@ public: template <size_t _Size>
__forceinline void registerIcon(const char *szSection, IconItem(&pIcons)[_Size], const char *prefix = nullptr)
{
- Icon_Register(m_hInst, szSection, pIcons, _Size, prefix, m_hLang);
+ Icon_Register(m_hInst, szSection, pIcons, _Size, prefix, this);
}
template <size_t _Size>
__forceinline void registerIconW(const wchar_t *szSection, IconItemT(&pIcons)[_Size], const char *prefix = nullptr)
{
- Icon_RegisterT(m_hInst, szSection, pIcons, _Size, prefix, m_hLang);
+ Icon_RegisterT(m_hInst, szSection, pIcons, _Size, prefix, this);
}
int addOptions(WPARAM wParam, struct OPTIONSDIALOGPAGE *odp);
@@ -477,7 +469,6 @@ OBJLIST<P> ACCPROTOPLUGIN<P>::g_arInstances(1, PtrKeySortT); #endif
EXTERN_C MIR_APP_DLL(HINSTANCE) GetInstByAddress(void* codePtr);
-EXTERN_C MIR_APP_DLL(CMPluginBase*) GetPluginByLangId(int langId);
EXTERN_C MIR_APP_DLL(CMPluginBase&) GetPluginByInstance(HINSTANCE hInst);
#endif // M_NEWPLUGINAPI_H__
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex 262b02be2b..b7dac5c94b 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex c4aa6435b0..6ab685fc5b 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 7b5998bf13..ac7f841cf1 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -706,8 +706,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.szGroup.a = LPGEN("Contacts"); odp.szTitle.a = LPGEN("Avatars"); @@ -1098,8 +1097,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP int OnDetailsInit(WPARAM wParam, LPARAM lParam) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.a = LPGEN("Avatar"); MCONTACT hContact = lParam; diff --git a/plugins/Actman/i_opt_dlg.inc b/plugins/Actman/i_opt_dlg.inc index 8ec24e42ac..878f127427 100644 --- a/plugins/Actman/i_opt_dlg.inc +++ b/plugins/Actman/i_opt_dlg.inc @@ -26,7 +26,6 @@ begin FillChar(odp,SizeOf(odp),0);
odp.flags :=ODPF_BOLDGROUPS;
odp.Position :=900003000;
- odp.hInstance :=hInstance;
odp.szGroup.a :='Services';
odp.szTitle.a :='Actions';
odp.szTab.a :='Actions';
diff --git a/plugins/Actman/version.RES b/plugins/Actman/version.RES Binary files differnew file mode 100644 index 0000000000..aa7c19667f --- /dev/null +++ b/plugins/Actman/version.RES diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 00ab8d1e4d..0dae1e0946 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -80,7 +80,7 @@ static int OnAccListChanged(WPARAM, LPARAM) if (hMainMenuItem)
return 0;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xb19db907, 0x870e, 0x49fa, 0xa7, 0x1e, 0x43, 0x5e, 0xa8, 0xe5, 0x9b, 0xbd);
mi.position = 500020001;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 87a1f7bd7a..744892450d 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -521,7 +521,7 @@ int CreateFrame() // create menu item
CreateServiceFunction(MODULENAME "/ShowHideReminders", ShowHideMenuFunc);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Alarms"), 0);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8A3C1906-4809-4EE8-A32A-858003A2AAA7");
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index 3b9027af7a..5b57bb9c4c 100755 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -811,7 +811,7 @@ void AddMenuItem() {
if (hMainMenuItem) return;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Alarms"), mi.position);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "24F03563-01BE-4118-8297-E94375A783E7");
@@ -1210,9 +1210,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT1);
odp.szTitle.a = LPGEN("Alarms");
odp.szGroup.a = LPGEN("Events");
diff --git a/plugins/AsSingleWindow/src/Options.cpp b/plugins/AsSingleWindow/src/Options.cpp index 3e0567fb3e..8e7659e79c 100644 --- a/plugins/AsSingleWindow/src/Options.cpp +++ b/plugins/AsSingleWindow/src/Options.cpp @@ -3,17 +3,12 @@ int InitOptions(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE Opts = { 0 }; - Opts.szTitle.a = LPGEN("AsSingleWindow"); Opts.szGroup.a = LPGEN("Customize"); - Opts.pfnDlgProc = cbOptionsDialog; Opts.pszTemplate = MAKEINTRESOURCEA(IDD_ASW_OPTIONSPAGE); - Opts.hInstance = g_plugin.getInst(); Opts.flags = ODPF_BOLDGROUPS; - g_plugin.addOptions(wParam, &Opts); - return 0; } diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index f3b2a8ab05..a55e200092 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -912,8 +912,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara static int AssocListOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ASSOCLIST);
odp.position = 900000100; // network opts = 900000000
odp.szGroup.a = LPGEN("Services"); // autotranslated
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index dfec97add4..e4da8decb0 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -170,7 +170,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded);
CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xc5a784ea, 0x8b07, 0x4b95, 0xa2, 0xb2, 0x84, 0x9d, 0x87, 0x43, 0x7e, 0xda);
mi.position = -1999901005;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp index 750cbe670c..d7f8b70cac 100644 --- a/plugins/AuthState/src/options.cpp +++ b/plugins/AuthState/src/options.cpp @@ -21,7 +21,7 @@ int onOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Icons");
odp.szTitle.a = LPGEN("Auth state");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index 98accc4b3f..f1badb4082 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -102,9 +102,8 @@ static INT_PTR CALLBACK DlgProcAutorunOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA static int AutorunOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100100000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTORUN);
odp.szTitle.a = MODULENAME;
odp.szGroup.a = LPGEN("Services");
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index cf06e45ce7..e882eb49d3 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -105,8 +105,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam static int ShutdownOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SHUTDOWN);
odp.position = 900000002;
odp.szGroup.w = LPGENW("Events"); /* autotranslated */
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index f209b13bad..3e59a08882 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -433,7 +433,7 @@ static HGENMENU hMainMenuItem, hTrayMenuItem; void SetShutdownMenuItem(bool fActive)
{
/* main menu */
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x61e2a38f, 0xcd94, 0x4f72, 0x84, 0x8c, 0x72, 0x92, 0xde, 0x1d, 0x6d, 0x5);
mi.position = 2001090000;
if (fActive) {
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index d48c571f4d..01b4e143a2 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -494,7 +494,7 @@ void InitMenuItem() {
CreateServiceFunction(MS_AVATARHISTORY_SHOWDIALOG, ShowDialogSvc);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x2fb5c7eb, 0xa606, 0x4145, 0x9e, 0x86, 0x73, 0x88, 0x73, 0x1d, 0xe7, 0x5c);
mi.name.w = LPGENW("View avatar history");
mi.flags = CMIF_UNICODE;
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index 08b6af4239..3ea17f3fff 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -146,8 +146,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("History"); // group to put your item under
odp.szTitle.w = LPGENW("Avatar"); // name of the item
odp.pfnDlgProc = OptionsDlgProc;
diff --git a/plugins/BASS_interface/src/Bass.h b/plugins/BASS_interface/src/Bass.h index 4045f02a33..0fd5b255d5 100644 --- a/plugins/BASS_interface/src/Bass.h +++ b/plugins/BASS_interface/src/Bass.h @@ -47,15 +47,15 @@ extern "C" { #define NOBASSOVERLOADS #endif -typedef DWORD HMUSIC; // MOD music handle -typedef DWORD HSAMPLE; // sample handle -typedef DWORD HCHANNEL; // playing sample's channel handle -typedef DWORD HSTREAM; // sample stream handle -typedef DWORD HRECORD; // recording handle -typedef DWORD HSYNC; // synchronizer handle -typedef DWORD HDSP; // DSP handle -typedef DWORD HFX; // DX8 effect handle -typedef DWORD HPLUGIN; // Plugin handle +typedef DWORD HMUSIC; // MOD music handle +typedef DWORD HSAMPLE; // sample handle +typedef DWORD HCHANNEL; // playing sample's channel handle +typedef DWORD HSTREAM; // sample stream handle +typedef DWORD HRECORD; // recording handle +typedef DWORD HSYNC; // synchronizer handle +typedef DWORD HDSP; // DSP handle +typedef DWORD HFX; // DX8 effect handle +typedef DWORD HSUBPLUGIN; // Plugin handle // Error codes returned by BASS_ErrorGetCode #define BASS_OK 0 // all is OK @@ -361,7 +361,7 @@ typedef struct { DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags DWORD ctype; // type of channel DWORD origres; // original resolution - HPLUGIN plugin; // plugin + HSUBPLUGIN plugin; // plugin HSAMPLE sample; // sample const char *filename; // filename } BASS_CHANNELINFO; @@ -1009,9 +1009,9 @@ BOOL BASSDEF(BASS_Pause)(); BOOL BASSDEF(BASS_SetVolume)(float volume); float BASSDEF(BASS_GetVolume)(); -HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); -BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle); -const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle); +HSUBPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); +BOOL BASSDEF(BASS_PluginFree)(HSUBPLUGIN handle); +const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HSUBPLUGIN handle); BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf); BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); @@ -1104,7 +1104,7 @@ BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority); } #if defined(_WIN32) && !defined(NOBASSOVERLOADS) -static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +static inline HSUBPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) { return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); } diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index fa367f8420..9a16069332 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -308,8 +308,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int OptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = MODULENAME;
odp.pfnDlgProc = OptionsProc;
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 5bac74c444..a371fcdfa0 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -89,7 +89,7 @@ int ToolbarModuleLoaded(WPARAM, LPARAM) void InitMenuItems()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4);
mi.position = 1000090000;
@@ -116,7 +116,7 @@ void InitTaskMenuItems() {
if (Options::instance->taskOptions.size() > 0) {
if (hTaskMainMenu == nullptr) {
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xbf66499, 0x1b39, 0x47a2, 0x9b, 0x74, 0xa6, 0xae, 0x89, 0x95, 0x59, 0x59);
mi.position = 500060005;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
@@ -134,7 +134,7 @@ void InitTaskMenuItems() int pos = (int)taskMenus.size();
for (; taskIt != Options::instance->taskOptions.end(); ++taskIt) {
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.pszService = MS_HISTORY_EXECUTE_TASK;
mi.root = hTaskMainMenu;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 907d13bd35..7981210cc9 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -117,9 +117,8 @@ Options::~Options() int Options::InitOptions(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szTitle.w = LPGENW("History");
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index e42a29f07f..54aa5a2287 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -432,9 +432,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP static int MessageOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 910000000;
- odp.hInstance = g_plugin.getInst();
odp.szGroup.a = BOLTUN_GROUP;
odp.szTitle.a = BOLTUN_NAME;
odp.pfnDlgProc = MainDlgProc;
@@ -527,7 +526,7 @@ int CMPlugin::Load() CreateServiceFunction(SERV_CONTACT_NOT_TO_CHAT, ContactClickNotToChat);
CreateServiceFunction(SERV_CONTACT_START_CHATTING, ContactClickStartChatting);
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xea31f628, 0x1445, 0x4b62, 0x98, 0x19, 0xce, 0x15, 0x81, 0x49, 0xa, 0xbd);
mi.position = -50010002; //TODO: check the warning
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 01b2d15ea0..187e9f1083 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -523,7 +523,7 @@ static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show t void BossKeyMenuItemInit(void) // Add menu item
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x42428114, 0xfac7, 0x44c2, 0x9a, 0x11, 0x18, 0xbe, 0x81, 0xd4, 0xa9, 0xe3);
mi.flags = CMIF_UNICODE;
mi.position = 2000100000;
@@ -583,7 +583,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Hide Miranda NG");
bbd.bbbFlags = BBBF_ISRSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index 14c24b4eed..e3133c55c6 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -318,7 +318,6 @@ int OptsDlgInit(WPARAM wParam, LPARAM) optDi.position = 920000000;
optDi.pfnDlgProc = MainOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGMAIN);
- optDi.hInstance = g_plugin.getInst();
optDi.szTitle.a = LPGEN("BossKey");
optDi.szGroup.a = LPGEN("Events");
optDi.szTab.a = LPGEN("Main");
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 5401ff0e96..1e419f8915 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -605,7 +605,7 @@ int ModulesLoaded(WPARAM, LPARAM) if (options.enableMissYou) {
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xc48c31d4, 0x56b6, 0x48c6, 0x8e, 0xe9, 0xe6, 0x57, 0xb5, 0x80, 0xb8, 0x1e);
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[2].hIcolib;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 327f40a910..536b6100e7 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -431,8 +431,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP */
static int OptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
odp.szTitle.w = LPGENW("Buddy Expectator");
@@ -529,7 +528,6 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) {
if (lparam > 0) {
OPTIONSDIALOGPAGE uip = { sizeof(uip) };
- uip.hInstance = g_plugin.getInst();
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
uip.szTitle.a = LPGEN("Buddy Expectator");
uip.pfnDlgProc = UserinfoDlgProc;
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 6137208c63..41853700b2 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -27,7 +27,7 @@ CMPlugin::CMPlugin() : int MainInit(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x719c1596, 0xb0fd, 0x4c74, 0xb7, 0xe4, 0xeb, 0x22, 0xf4, 0x99, 0xd7, 0x68);
mi.position = 10;
mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POUNCE));
@@ -76,9 +76,8 @@ int MsgAck(WPARAM, LPARAM lParam) int BuddyPounceOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szGroup.w = LPGENW("Message sessions");
odp.szTitle.w = LPGENW("Buddy Pounce");
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index d469929aea..9ca2277552 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -68,9 +68,8 @@ static int OnDbChanged(WPARAM hContact, LPARAM lparam) static int OnInitOptions(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 955000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = CSOptionsProc; odp.szGroup.w = L"Status"; @@ -210,7 +209,7 @@ void addProtoStatusMenuItem(char *protoName) if (!ServiceExists(buf)) CreateServiceFunctionParam(buf, showList, (LPARAM)protoName); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.hIcolibItem = forms[0].hIcoLibItem; mi.name.w = MODULENAME; diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 30e14780fd..79cad93fdc 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -140,8 +140,7 @@ int ModulesLoaded(WPARAM, LPARAM) int OnOptionsInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN_OPTION_FORM);
odp.szTitle.a = MODULENAME;
odp.szGroup.a = LPGEN("Message sessions");
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 99b8dfc2c1..b6a2b82c2b 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -324,7 +324,7 @@ static int MirandaLoaded(WPARAM, LPARAM) CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups);
HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xfabb9181, 0xdb92, 0x43f4, 0x86, 0x40, 0xca, 0xb6, 0x4c, 0x93, 0x34, 0x27);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0);
mi.flags = CMIF_UNICODE;
diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index 0ec1557d1c..c806b5f56f 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -167,7 +167,6 @@ int OptionsDlgInit(WPARAM wParam, LPARAM) optDi.szTitle.a = LPGEN("ClientChangeNotify");
optDi.pfnDlgProc = PopupOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG);
- optDi.hInstance = g_plugin.getInst();
optDi.flags = ODPF_BOLDGROUPS;
g_plugin.addOptions(wParam, &optDi);
}
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index d06c5d8d93..8122c07614 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -254,8 +254,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam int ClcOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Contact list");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC);
odp.szTitle.a = LPGEN("List");
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index eb0c7fb5e6..f0eb05dd78 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -180,9 +180,8 @@ static UINT expertOnlyControls[] = { IDC_ALWAYSSTATUS }; int CListOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1000000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST);
odp.szTitle.a = LPGEN("Contact list");
odp.pfnDlgProc = DlgProcGenOpts;
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 56c397973e..1acb1998b0 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -307,8 +307,7 @@ static UINT expertOnlyControls[] = int CluiOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI);
odp.szTitle.a = LPGEN("Window");
odp.szGroup.a = LPGEN("Contact list");
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 6d85477399..c29b26e41e 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -735,7 +735,7 @@ static int CLUIFramesGetalClientFrame(void) static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, FRAMEWND &F, int frameid, bool bMain)
{
- pmi->langId = F.hLang;
+ pmi->pPlugin = F.pPlugin;
HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi);
if (pmi->pszService != nullptr)
Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, frameid);
@@ -751,7 +751,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp auto &F = g_pfwFrames[framepos];
FrameMenuHandles &fmh = (frameid == -1) ? cont : F.MenuHandles;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = root;
mi.position = popuppos++;
mi.name.a = LPGEN("&Visible");
@@ -1041,7 +1041,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) fw.TitleBar.tbname = mir_a2u((char*)lParam);
if (fw.floating && (fw.TitleBar.tbname != nullptr))
- SetWindowText(fw.ContainerWnd, TranslateW_LP(fw.TitleBar.tbname, fw.hLang));
+ SetWindowText(fw.ContainerWnd, TranslateW_LP(fw.TitleBar.tbname, fw.pPlugin));
return 0;
case FO_TBTIPNAME:
@@ -1473,7 +1473,7 @@ static int CLUIFramesLoadMainMenu() g_frameMenus.destroy();
// create frames menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = cont.MainMenuItem;
int separator = 3000200000;
for (int i = 0; i < g_nFramesCount; i++) {
@@ -1525,7 +1525,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam) F.hWnd = clfrm->hWnd;
F.height = clfrm->height;
F.TitleBar.hicon = clfrm->hIcon;
- F.hLang = (int)lParam;
+ F.pPlugin = (HPLUGIN)lParam;
F.floating = FALSE;
if (clfrm->Flags & F_NO_SUBCONTAINER || !g_CluiData.fLayered)
F.OwnerWindow = (HWND)-2;
@@ -1560,7 +1560,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam) //Frames[nFramescount].OwnerWindow = 0;
- F.TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName, TranslateW_LP(F.name, F.hLang),
+ F.TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName, TranslateW_LP(F.name, F.pPlugin),
(db_get_b(0, CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER)
| WS_CHILD | WS_CLIPCHILDREN |
(F.TitleBar.ShowTitleBar ? WS_VISIBLE : 0) |
@@ -2492,7 +2492,7 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid) textrc.top += 2;
}
- wchar_t *wszTitle = TranslateW_LP(F.TitleBar.tbname, F.hLang);
+ wchar_t *wszTitle = TranslateW_LP(F.TitleBar.tbname, F.pPlugin);
ske_TextOut(hdcMem, textrc.left, textrc.top, wszTitle, (int)mir_wstrlen(wszTitle));
if (!AlignCOLLIconToLeft)
@@ -3315,7 +3315,7 @@ int LoadCLUIFramesModule(void) InitGroupMenus();
{
// create root menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x3931AC4, 0x7A32, 0x4D9C, 0x99, 0x92, 0x94, 0xD4, 0xB5, 0x9B, 0xD6, 0xB6);
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME);
mi.position = 3000090000;
diff --git a/plugins/Clist_modern/src/cluiframes.h b/plugins/Clist_modern/src/cluiframes.h index a7a24d3a81..c17510f0a6 100644 --- a/plugins/Clist_modern/src/cluiframes.h +++ b/plugins/Clist_modern/src/cluiframes.h @@ -117,7 +117,7 @@ struct FRAMEWND POINT FloatingPos;
POINT FloatingSize;
int order;
- int hLang;
+ HPLUGIN pPlugin;
DockOpt dockOpt;
HWND OwnerWindow;
tPaintCallbackProc PaintCallbackProc;
diff --git a/plugins/Clist_modern/src/groupmenu.cpp b/plugins/Clist_modern/src/groupmenu.cpp index 431bc8ace8..193fc9e445 100644 --- a/plugins/Clist_modern/src/groupmenu.cpp +++ b/plugins/Clist_modern/src/groupmenu.cpp @@ -56,7 +56,7 @@ void InitGroupMenus(void) InitSubGroupMenus();
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe386678a, 0x5aee, 0x4bfa, 0xa8, 0x23, 0xd, 0xa0, 0x11, 0x99, 0xb1, 0x98);
mi.position = 500;
@@ -132,7 +132,7 @@ void InitSubGroupMenus(void) // add exit command to menu
GroupMenuParam gmp = { POPUP_GROUPSHOWOFFLINE, 0 };
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x7E081A28, 0x19B3, 0x407F, 0x80, 0x6B, 0x70, 0xC3, 0xC3, 0xA9, 0xD2, 0xA4);
mi.position = 1002;
mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 5927682020..8f8ac960f5 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -1518,8 +1518,7 @@ static clist_opt_items[] = int ClcOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC);
odp.szTitle.a = LPGEN("Contact list");
odp.pfnDlgProc = DlgProcClistListOpts;
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 923242e93f..95eec95d18 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -93,7 +93,7 @@ INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM) void LoadFavoriteContactMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc);
mi.name.w = FAVMENUROOTNAME;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 4481781157..da055263f7 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -929,9 +929,8 @@ static row_opt_items[] = int CListOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -200000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ITEMS);
odp.szGroup.a = LPGEN("Contact list");
odp.szTitle.a = LPGEN("Row items");
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 181d59c2e1..5abbec1ca8 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -325,7 +325,7 @@ HRESULT CLUI::RegisterAvatarMenu() {
g_plugin.registerIcon(LPGEN("Contact list"), iconItem);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x1cc99858, 0x40ca, 0x4558, 0xae, 0x10, 0xba, 0x81, 0xaf, 0x4c, 0x67, 0xb5);
CreateServiceFunction("CList/ShowContactAvatar", CLUI::Service_Menu_ShowContactAvatar);
mi.position = 2000150000;
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index bfd20fc48b..e474281160 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -48,9 +48,8 @@ int SkinOptInit(WPARAM wParam, LPARAM) { if (!g_CluiData.fDisableSkinEngine) { //Tabbed settings - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -200000000; - odp.hInstance = g_plugin.getInst(); odp.pfnDlgProc = DlgSkinOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN); odp.szGroup.w = LPGENW("Skins"); diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 2268822a7c..87bba912aa 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -513,12 +513,10 @@ static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPar int ClcOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
-
////////////////////////////////////////////////////////////////////////////
// Main options tabs
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1000000000;
odp.flags = ODPF_BOLDGROUPS;
odp.szTitle.a = LPGEN("Contact list");
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index a5fd27c1fe..3aba1439c4 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -360,7 +360,7 @@ int InitCustomMenus(void) CreateServiceFunction("CloseAction", CloseAction);
CreateServiceFunction("CList/SetContactIgnore", SetContactIgnore);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe3b08c6f, 0x8a01, 0x4c94, 0xb3, 0xf5, 0x9d, 0x38, 0x6, 0x63, 0x7a, 0xa9);
mi.position = 200000;
mi.pszService = "CList/SetContactIgnore";
diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 502d2e8a06..32609d0055 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -553,7 +553,7 @@ int CLUIFramesGetalClientFrame(void) static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, int frameid, bool bMain) { - pmi->langId = g_plugin.m_hLang; + pmi->pPlugin = &g_plugin; HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi); if (pmi->pszService != nullptr) Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, frameid); @@ -568,7 +568,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, boo int framepos = id2pos(frameid); FrameMenuHandles &fmh = (frameid == -1) ? cont : Frames[framepos].MenuHandles; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA); mi.root = root; mi.position = popuppos++; @@ -1323,7 +1323,7 @@ static int CLUIFramesLoadMainMenu() g_frameMenus.destroy(); // create frames menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = cont.MainMenuItem; mi.flags = CMIF_UNICODE | CMIF_SYSTEM; int separator = (int)3000200000; @@ -2937,7 +2937,7 @@ int LoadCLUIFramesModule(void) RegisterClass(&cntclass); // create root menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x3931AC4, 0x7A32, 0x4D9C, 0x99, 0x92, 0x94, 0xD4, 0xB5, 0x9B, 0xD6, 0xB6); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME); mi.position = 3000090000; diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index 0d9a351a49..6f5cb4aa83 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -95,7 +95,7 @@ void InitGroupMenus(void) HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe386678a, 0x5aee, 0x4bfa, 0xa8, 0x23, 0xd, 0xa0, 0x11, 0x99, 0xb1, 0x98);
mi.position = 500;
mi.pszService = MS_CLIST_SHOWHIDE;
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index bb67ff24fe..9634eba955 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -1,8 +1,22 @@ #include "..\stdafx.h" #include "dropbox_api.h" -CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) +struct CMPluginDropbox : public PLUGIN<CMPluginDropbox> +{ + CMPluginDropbox() : + PLUGIN<CMPluginDropbox>(MODULENAME "/Dropbox", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CDropboxService::Init, (pfnUninitProto)CDropboxService::UnInit); + } +} +g_pluginDropbox; + +///////////////////////////////////////////////////////////////////////////////////////// + +CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginDropbox) { m_hProtoIcon = GetIconHandle(IDI_DROPBOX); } @@ -286,17 +300,3 @@ void CDropboxService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginDropbox : public PLUGIN<CMPluginDropbox> -{ - CMPluginDropbox() : - PLUGIN<CMPluginDropbox>(MODULENAME "/Dropbox", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CDropboxService::Init, (pfnUninitProto)CDropboxService::UnInit); - } -} -g_pluginDropbox; diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp index 906e9e817d..9679c17fc0 100644 --- a/plugins/CloudFile/src/Services/google_service.cpp +++ b/plugins/CloudFile/src/Services/google_service.cpp @@ -1,8 +1,23 @@ #include "..\stdafx.h" #include "google_api.h" -CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) + +struct CMPluginGoogle : public CMPluginBase +{ + CMPluginGoogle() : + CMPluginBase(MODULENAME "/GDrive", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CGDriveService::Init, (pfnUninitProto)CGDriveService::UnInit); + } +} +g_pluginGoogle; + +///////////////////////////////////////////////////////////////////////////////////////// + +CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginGoogle) { m_hProtoIcon = GetIconHandle(IDI_GDRIVE); } @@ -280,17 +295,3 @@ void CGDriveService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginGoogle : public CMPluginBase -{ - CMPluginGoogle() : - CMPluginBase(MODULENAME "/GDrive", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CGDriveService::Init, (pfnUninitProto)CGDriveService::UnInit); - } -} -g_pluginGoogle; diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp index 5adf66649a..c435bc19b4 100644 --- a/plugins/CloudFile/src/Services/microsoft_service.cpp +++ b/plugins/CloudFile/src/Services/microsoft_service.cpp @@ -1,8 +1,22 @@ #include "..\stdafx.h" #include "microsoft_api.h" -COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) +struct CMPluginOnedrive : public CMPluginBase +{ + CMPluginOnedrive() : + CMPluginBase(MODULENAME "/OneDrive", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)COneDriveService::Init, (pfnUninitProto)COneDriveService::UnInit); + } +} +g_pluginOnedrive; + +///////////////////////////////////////////////////////////////////////////////////////// + +COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginOnedrive) { m_hProtoIcon = GetIconHandle(IDI_ONEDRIVE); } @@ -253,17 +267,3 @@ void COneDriveService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginOnedrive : public CMPluginBase -{ - CMPluginOnedrive() : - CMPluginBase(MODULENAME "/OneDrive", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)COneDriveService::Init, (pfnUninitProto)COneDriveService::UnInit); - } -} -g_pluginOnedrive; diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index c5dbb50400..ca8ba197d6 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -1,8 +1,22 @@ #include "..\stdafx.h" #include "yandex_api.h" -CYandexService::CYandexService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) +struct CMPluginYandex : public CMPluginBase +{ + CMPluginYandex() : + CMPluginBase(MODULENAME "/YandexDisk", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CYandexService::Init, (pfnUninitProto)CYandexService::UnInit); + } +} +g_pluginYandex; + +///////////////////////////////////////////////////////////////////////////////////////// + +CYandexService::CYandexService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginYandex) { m_hProtoIcon = GetIconHandle(IDI_YADISK); } @@ -274,17 +288,3 @@ void CYandexService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginYandex : public CMPluginBase -{ - CMPluginYandex() : - CMPluginBase(MODULENAME "/YandexDisk", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CYandexService::Init, (pfnUninitProto)CYandexService::UnInit); - } -} -g_pluginYandex; diff --git a/plugins/CloudFile/src/cloud_file.cpp b/plugins/CloudFile/src/cloud_file.cpp index 13ba742690..d1993b6d27 100644 --- a/plugins/CloudFile/src/cloud_file.cpp +++ b/plugins/CloudFile/src/cloud_file.cpp @@ -1,10 +1,9 @@ #include "stdafx.h" -CCloudService::CCloudService(const char *protoName, const wchar_t *userName) - : PROTO<CCloudService>(protoName, userName) +CCloudService::CCloudService(const char *protoName, const wchar_t *userName, HPLUGIN pPlugin) + : PROTO<CCloudService>(protoName, userName), + m_pPlugin(pPlugin) { - m_hLangpack = GetPluginLangId(MIID_LAST, 0); - NETLIBUSER nlu = {}; nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.szSettingsModule = (char*)protoName; @@ -22,12 +21,12 @@ CCloudService::~CCloudService() void CCloudService::OnErase() { - KillModuleMenus(m_hLangpack); + KillModuleMenus(m_pPlugin); } -int CCloudService::GetId() const +HPLUGIN CCloudService::GetId() const { - return m_hLangpack; + return m_pPlugin; } const char* CCloudService::GetAccountName() const diff --git a/plugins/CloudFile/src/cloud_file.h b/plugins/CloudFile/src/cloud_file.h index f16d5affe4..1e70671054 100644 --- a/plugins/CloudFile/src/cloud_file.h +++ b/plugins/CloudFile/src/cloud_file.h @@ -11,7 +11,7 @@ enum OnConflict class CCloudService : public PROTO<CCloudService> { protected: - int m_hLangpack; + HPLUGIN m_pPlugin; HNETLIBUSER m_hConnection; INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM); @@ -34,7 +34,7 @@ protected: public: std::map<MCONTACT, HWND> InterceptedContacts; - CCloudService(const char *protoName, const wchar_t *userName); + CCloudService(const char *protoName, const wchar_t *userName, HPLUGIN); virtual ~CCloudService(); INT_PTR GetCaps(int type, MCONTACT) override; @@ -42,7 +42,7 @@ public: int FileCancel(MCONTACT hContact, HANDLE hTransfer) override; HANDLE SendFile(MCONTACT hContact, const wchar_t *msg, wchar_t **ppszFiles) override; - int GetId() const; + HPLUGIN GetId() const; virtual const char* GetModuleName() const = 0; const char* GetAccountName() const; const wchar_t* GetUserName() const; diff --git a/plugins/CloudFile/src/menus.cpp b/plugins/CloudFile/src/menus.cpp index c6861e27a2..7a5ddb084d 100644 --- a/plugins/CloudFile/src/menus.cpp +++ b/plugins/CloudFile/src/menus.cpp @@ -11,7 +11,7 @@ static INT_PTR UploadMenuCommand(void *obj, WPARAM hContact, LPARAM) void InitializeMenus() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x93d4495b, 0x259b, 0x4fba, 0xbc, 0x14, 0xf9, 0x46, 0x2c, 0xda, 0xfc, 0x6d); mi.name.a = LPGEN("Upload to..."); @@ -32,11 +32,10 @@ void InitializeMenus() void CCloudService::OnModulesLoaded() { - CMenuItem mi(g_plugin); + CMenuItem mi(GetId()); mi.root = hContactMenu; CMStringA serviceName(FORMAT, "/%s/Upload", GetAccountName()); mi.pszService = serviceName.GetBuffer(); - mi.langId = GetId(); mi.flags = CMIF_SYSTEM | CMIF_UNICODE; mi.name.w = (wchar_t*)GetUserName(); mi.position = Services.getCount(); diff --git a/plugins/CloudFile/src/options.cpp b/plugins/CloudFile/src/options.cpp index ee3aaec11e..c17ef8d9d2 100644 --- a/plugins/CloudFile/src/options.cpp +++ b/plugins/CloudFile/src/options.cpp @@ -75,7 +75,7 @@ bool COptionsMainDlg::OnApply() int OnOptionsInitialized(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = _A2W(MODULENAME); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/CloudFile/src/srmm.cpp b/plugins/CloudFile/src/srmm.cpp index 2690a97a28..ae12de3bf1 100644 --- a/plugins/CloudFile/src/srmm.cpp +++ b/plugins/CloudFile/src/srmm.cpp @@ -11,8 +11,7 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM) bbd.hIcon = GetIconHandle(IDI_UPLOAD); bbd.dwButtonID = BBB_ID_FILE_SEND; bbd.dwDefPos = 100 + bbd.dwButtonID; - Srmm_AddButton(&bbd, g_plugin.m_hLang); - + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 602ac4d22e..49ca5c36e3 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -585,7 +585,6 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar int ConnectionNotifyOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DIALOG);
odp.szTitle.w = _A2W(PLUGINNAME);
odp.szGroup.w = LPGENW("Plugins");
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 17c1be2363..c9b09e9a14 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -1053,8 +1053,7 @@ static INT_PTR CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM static int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szGroup.a = LPGEN("Services");
odp.szTitle.a = LPGEN("Console");
@@ -1141,7 +1140,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) if (hwndConsole && IsWindow(hwndConsole)) {
HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x6d97694e, 0x2024, 0x4560, 0xbb, 0xbc, 0x20, 0x62, 0x7e, 0x5, 0xdf, 0xb3);
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = hIcons[0];
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index a3ff85c702..6a2c053891 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -132,7 +132,7 @@ static int HookModulesLoaded(WPARAM, LPARAM) modules[0] = MODULENAME;
CallService("DBEditorpp/RegisterModule", (WPARAM)modules, 1);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x94a4ed39, 0xabd0, 0x4c70, 0x89, 0xeb, 0x1b, 0x2, 0xf0, 0xac, 0x6, 0x4c);
mi.name.a = LPGEN("Contacts");
mi.position = -2000009990; //position in menu
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 4b09fb3b36..30edfe8e27 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -178,7 +178,7 @@ static int ExtraImgModulesLoaded(WPARAM, LPARAM) StatusIconData sid = {};
sid.szModule = MODULENAME; // dwID = 0
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
HookEvent(ME_MSG_WINDOWEVENT, MsgWndEvent);
return 0;
diff --git a/plugins/CountryFlags/src/options.cpp b/plugins/CountryFlags/src/options.cpp index df5ac76dc5..cde19a8664 100644 --- a/plugins/CountryFlags/src/options.cpp +++ b/plugins/CountryFlags/src/options.cpp @@ -82,8 +82,7 @@ static INT_PTR CALLBACK ExtraImgOptDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARA int OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXTRAIMG);
odp.position = 900000002;
odp.szGroup.a = LPGEN("Icons"); /* autotranslated */
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index e4972c70b9..89d6229fa6 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -199,7 +199,6 @@ int OptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = MODULENAME;
odp.szGroup.a = LPGEN("Services");
@@ -253,7 +252,7 @@ static int ModulesLoaded(WPARAM, LPARAM) FoldersPathChanged(0, 0);
}
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Version Information"), 2000089999, GetIconHandle(IDI_VI));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "9A7A9C76-7FD8-4C05-B402-6C46060C2D78");
diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp index 207135c19d..4d981e3b60 100644 --- a/plugins/CyrTranslit/src/MirandaContact.cpp +++ b/plugins/CyrTranslit/src/MirandaContact.cpp @@ -63,7 +63,7 @@ void MirandaContact::save(MCONTACT hContact, bool bValue) void MirandaContact::addMenuItem()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi,0x47bbf49f, 0x2b77, 0x412a, 0xaa, 0x80, 0xbe, 0xd5, 0x2f, 0x8, 0x29, 0x96);
mi.name.a = MENU_ITEM_TEXT;
mi.position = 65535;
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index e0929408a7..12e9731748 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -300,9 +300,8 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.flags = ODPF_BOLDGROUPS;
odp.szTitle.a = LPGEN("Database");
@@ -327,7 +326,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
// main menu item
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 97f9f267af..193ea74cc3 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -101,7 +101,7 @@ static int ModulesLoaded(WPARAM, LPARAM) IcoLibRegister();
// Register menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 1900000001);
SET_UID(mi, 0xe298849c, 0x1a8c, 0x4fc7, 0xa0, 0xf4, 0x78, 0x18, 0xf, 0xe2, 0xf7, 0xc9);
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp index f7bc725573..bcc4ea98fb 100644 --- a/plugins/DbEditorPP/src/options.cpp +++ b/plugins/DbEditorPP/src/options.cpp @@ -56,8 +56,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l INT OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szGroup.a = LPGEN("Database");
odp.szTitle.a = modFullname;
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index db34035088..5910de994a 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -64,7 +64,7 @@ static int FoldersGetBackupPath(WPARAM, LPARAM) static int ModulesLoad(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500100000);
SET_UID(mi, 0x1439b1db, 0x7d95, 0x495b, 0xbf, 0x5, 0x3d, 0x21, 0xc1, 0xeb, 0xf7, 0x58);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index a795f06e30..2545308e3d 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -348,7 +348,7 @@ public: int OptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.szTitle.a = LPGEN("Automatic backups");
odp.szGroup.a = LPGEN("Database");
diff --git a/plugins/Dbx_mdbx/src/ui.cpp b/plugins/Dbx_mdbx/src/ui.cpp index 9795cb305d..58317a9720 100644 --- a/plugins/Dbx_mdbx/src/ui.cpp +++ b/plugins/Dbx_mdbx/src/ui.cpp @@ -186,7 +186,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
// main menu item
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib);
diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp index 9739e41ae9..3ec4de1ad2 100644 --- a/plugins/Exchange/src/hooked_events.cpp +++ b/plugins/Exchange/src/hooked_events.cpp @@ -54,7 +54,7 @@ int OnModulesLoaded(WPARAM, LPARAM) {
UpdateTimers();
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xcbfbfd3d, 0x5002, 0x4c64, 0x92, 0xb, 0x9c, 0x12, 0x4b, 0x6, 0x51, 0x2a);
mi.hIcolibItem = hiMailIcon;
mi.position = 10000000;
@@ -72,9 +72,8 @@ int OnModulesLoaded(WPARAM, LPARAM) //add the exchange options dialog to miranda
int OnOptionsInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXCHANGE);
odp.szTitle.w = LPGENW("Exchange notify");
odp.szGroup.w = LPGENW("Plugins");
diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index 00f1c34c83..75e9f9c73c 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -58,7 +58,7 @@ Called when the toolbar services are available /*
toptoolbar/addbutton service
wparam = (TTBButton*)lpTTBButton
-lparam = hLangpack
+lparam = (HPLUGIN)&g_pPlugin
returns: hTTBButton - handle of added button on success, -1 on failure.
*/
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 16a76bc66e..01dd4374a7 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -80,7 +80,7 @@ void InitMenuItems() {
wchar_t stzName[256];
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xB7132F5A, 0x65FC, 0x42C5, 0xB4, 0xCB, 0x54, 0xBC, 0xAC, 0x58, 0x34, 0xE9);
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib;
@@ -95,7 +95,7 @@ void InitMenuItems() mi.name.w = stzName;
mi.flags = CMIF_UNICODE | CMIF_SYSTEM;
- CMenuItem mi2(g_plugin);
+ CMenuItem mi2(&g_plugin);
mi2.flags = CMIF_UNICODE | CMIF_SYSTEM;
mi2.pszService = MS_FTPFILE_CONTACTMENU;
@@ -178,7 +178,7 @@ void InitTabsrmmButton() btn.hIcon = iconList[ServerList::FTP_COUNT].hIcolib;
btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN;
btn.pwszTooltip = TranslateT("FTP File");
- Srmm_AddButton(&btn, g_plugin.m_hLang);
+ Srmm_AddButton(&btn, &g_plugin);
HookEvent(ME_MSG_BUTTONPRESSED, TabsrmmButtonPressed);
}
diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp index eff7b5e7bd..cb32cc66c4 100644 --- a/plugins/FTPFileYM/src/options.cpp +++ b/plugins/FTPFileYM/src/options.cpp @@ -246,9 +246,8 @@ INT_PTR CALLBACK Options::DlgProcOptsAdvanced(HWND hwndDlg, UINT msg, WPARAM wPa int Options::InitOptions(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szTitle.w = LPGENW("FTP File");
odp.szGroup.w = LPGENW("Services");
diff --git a/plugins/FavContacts/src/options.cpp b/plugins/FavContacts/src/options.cpp index 55f1c10d6c..0a5fe13acb 100644 --- a/plugins/FavContacts/src/options.cpp +++ b/plugins/FavContacts/src/options.cpp @@ -253,9 +253,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA int ProcessOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szGroup.a = LPGEN("Contacts");
odp.szTitle.a = LPGEN("Favorites");
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index a6959164c1..7d91eb4ad8 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -151,7 +151,7 @@ int ProcessModulesLoaded(WPARAM, LPARAM) sid.szTooltip = LPGEN("Favorite Contacts");
sid.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
sid.hIconDisabled = IcoLib_GetIconByHandle(iconList[1].hIcolib);
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
HookEvent(ME_MSG_ICONPRESSED, ProcessSrmmIconClick);
HookEvent(ME_MSG_WINDOWEVENT, ProcessSrmmEvent);
diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 3815e347e5..2cebbb4a99 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -151,7 +151,6 @@ INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam) int OnOptInitialise(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = SERVICE_TITLE;
odp.szGroup.a = LPGEN("Events");
@@ -172,7 +171,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) hHookSkinIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnSkinIconsChanged);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe4a98d2a, 0xa54a, 0x4db1, 0x8d, 0x29, 0xd, 0x5c, 0xf1, 0x10, 0x69, 0x35);
mi.position = 200011;
mi.hIcolibItem = iconList[ICON_MAIN].hIcolib;
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 74bc1332dd..073f43db31 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -932,7 +932,7 @@ int OnModulesLoaded(WPARAM, LPARAM) sid.szModule = MODULENAME; sid.flags = MBF_HIDDEN; sid.dwId = 1; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); } return 0; diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 67c6971ea9..b8dc5dc728 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -111,8 +111,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int OnOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Icons");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG);
odp.szTitle.w = LPGENW("Fingerprint");
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 9226ad8fb9..df26a93e29 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -707,7 +707,7 @@ static INT_PTR OnHotKey_HideWhenCListShow(WPARAM, LPARAM) static void LoadMenus()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
// Remove thumb menu item
CreateServiceFunction(MODULE "/RemoveThumb", OnContactMenu_Remove);
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index feec786728..689ab51453 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -332,8 +332,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP int OnOptionsInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FLTCONT);
odp.szTitle.a = LPGEN("Floating Contacts");
odp.szGroup.a = LPGEN("Contact list");
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index df0756e5d6..a29911c2b5 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -245,9 +245,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l static int OnOptionsInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FOLDERS);
odp.szTitle.a = LPGEN("Folders");
odp.szGroup.a = LPGEN("Customize");
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 330fcd2a09..c24d707c59 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -132,7 +132,7 @@ int CMPlugin::Load() CreateServiceFunction(MODULENAME "/MenuCommand", PluginMenuCommand);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xbe16f37, 0x17be, 0x4494, 0xaa, 0xb2, 0x3a, 0xa7, 0x38, 0xfa, 0xf9, 0xcc);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_ONLINE);
diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index 7d3729a0e5..3d037c5b59 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -270,9 +270,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.szTitle.a = LPGEN("GmailNotifier");
odp.szGroup.a = LPGEN("Network");
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 20216b816b..44c430dd8b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -1338,9 +1338,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 900000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_HTTP_SERVER);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szTitle.w = LPGENW("HTTP Server");
@@ -1473,7 +1472,7 @@ void InitGuiElements() hShareNewFileService = CreateServiceFunction(MS_SHARE_NEW_FILE, nShareNewFile);
hShowStatisticsViewService = CreateServiceFunction(MS_SHOW_STATISTICS_VIEW, nShowStatisticsView);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
SET_UID(mi, 0xb30a6ab5, 0x17a8, 0x4e2e, 0x84, 0x52, 0x5f, 0xbc, 0x83, 0x35, 0xf2, 0x6);
mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 38c8fa787e..e951994a83 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -876,7 +876,7 @@ int CMPlugin::Load() indexCreationMode = (eIndexCreationMode)db_get_b(NULL, MODULENAME, "IndexCreationMode", 2);
if (db_get_b(NULL, MODULENAME, "AddAcceptConMenuItem", 1)) {
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xf0a68784, 0xc30e, 0x4245, 0xb6, 0x2b, 0xb8, 0x71, 0x7e, 0xe6, 0xe1, 0x73);
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 634a292574..d51959d712 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -45,7 +45,6 @@ CMPlugin::CMPlugin() : static int InitOptionsDlg(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
- odp.hInstance = g_plugin.getInst();
odp.szGroup.a = LPGEN("History");
odp.szTitle.a = LPGEN("History Linklist");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_DLG);
@@ -149,7 +148,7 @@ int CMPlugin::Load() {
CreateServiceFunction("Linklist/MenuCommand", LinkList_Main);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9);
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LINKLISTICON));
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index 73dbe61c11..605f320c9c 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -401,7 +401,6 @@ var odp: TOPTIONSDIALOGPAGE;
begin
ZeroMemory(@odp,SizeOf(odp));
- odp.hInstance := hInstance;
odp.pszTemplate := MakeIntResourceA(IDD_OPT_HISTORYPP);
odp.szTitle.a := 'History';
odp.szGroup.a := nil;
diff --git a/plugins/HistoryPlusPlus/historypp.dproj.local b/plugins/HistoryPlusPlus/historypp.dproj.local new file mode 100644 index 0000000000..b3811b7ecc --- /dev/null +++ b/plugins/HistoryPlusPlus/historypp.dproj.local @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8"?> +<BorlandProject/> diff --git a/plugins/HistoryPlusPlus/historypp.identcache b/plugins/HistoryPlusPlus/historypp.identcache Binary files differnew file mode 100644 index 0000000000..450d89fe88 --- /dev/null +++ b/plugins/HistoryPlusPlus/historypp.identcache diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 3287d8ed5b..06ffb1e051 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -18,7 +18,7 @@ namespace mu HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot)
{
// TODO: support for unicode-core with unicode-aware CList
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.name.w = (wchar_t*)pszName;
mi.flags = flags | CMIF_UNICODE;
mi.position = position;
@@ -32,7 +32,7 @@ namespace mu HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService)
{
// TODO: support for unicode-core with unicode-aware CList
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.name.w = (wchar_t*)pszName;
mi.flags = flags | CMIF_UNICODE;
mi.position = position;
@@ -80,11 +80,10 @@ namespace mu {
void addPage(WPARAM addInfo, const wchar_t* pszGroup, const wchar_t* pszTitle, const wchar_t* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags /* = ODPF_BOLDGROUPS */)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = const_cast<wchar_t*>(pszTitle);
odp.pfnDlgProc = pfnDlgProc;
odp.pszTemplate = const_cast<char*>(pszTemplate);
- odp.hInstance = hInstance;
odp.szGroup.w = const_cast<wchar_t*>(pszGroup);
odp.flags = flags | ODPF_UNICODE;
odp.szTab.w = const_cast<wchar_t*>(pszTab);
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index d0218610be..3cc113a692 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -88,25 +88,25 @@ static int OnModulesLoaded(WPARAM, LPARAM) sid.szTooltip = LPGEN("Delete all events");
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
sid.hIcon = LoadIconEx("act1");
sid.szTooltip = time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)];
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 2;
sid.hIcon = LoadIconEx("act2");
sid.szTooltip = keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)];
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 3;
sid.hIcon = LoadIconEx("actDel");
sid.szTooltip = LPGEN("Delete all events");
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent);
HookEvent(ME_MSG_ICONPRESSED, OnIconPressed);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 61364a1907..b3f902dfd0 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -269,8 +269,7 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) int HSOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORYSWEEPER);
odp.szTitle.a = ModuleName;
odp.szGroup.a = LPGEN("History");
diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index f8269bbfba..a9438690e2 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -110,13 +110,11 @@ int initializeOptions(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE OptDlgPg = { sizeof(OptDlgPg) };
OptDlgPg.position = 100000000;
- OptDlgPg.hInstance = g_plugin.getInst();
OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
OptDlgPg.pszTemplate = MAKEINTRESOURCEA(dlg_options);
OptDlgPg.szGroup.w = LPGENW("Customize");
OptDlgPg.szTitle.w = LPGENW("Hardware HotKeys");
OptDlgPg.pfnDlgProc = OptDlgProc;
- OptDlgPg.langId = g_plugin.m_hLang;
g_plugin.addOptions(wParam, &OptDlgPg);
return 0;
}
diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp index 14883311d6..63652e826d 100644 --- a/plugins/IEHistory/src/IEHistory.cpp +++ b/plugins/IEHistory/src/IEHistory.cpp @@ -72,7 +72,7 @@ int CMPlugin::Load() InitServices(); /// menu items - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4); mi.name.w = LPGENW("View &history"); mi.flags = CMIF_UNICODE; diff --git a/plugins/IEHistory/src/events.cpp b/plugins/IEHistory/src/events.cpp index e092c681e3..30b80dbf23 100644 --- a/plugins/IEHistory/src/events.cpp +++ b/plugins/IEHistory/src/events.cpp @@ -37,12 +37,11 @@ int UnhookEvents() int OnOptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; odp.szTitle.w = LPGENW("History"); odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORY); - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; g_plugin.addOptions(wParam, &odp); return 0; diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 1ca8ece36c..3fb64021ee 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -435,8 +435,7 @@ static bool BrowseFile(HWND hwndDlg, char *filter, char *defExt, char *path, int int IEViewOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Message sessions");
odp.szTitle.w = LPGENW("IEView");
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
diff --git a/plugins/IgnoreState/src/options.cpp b/plugins/IgnoreState/src/options.cpp index a7b1e0ca94..78da3941d2 100644 --- a/plugins/IgnoreState/src/options.cpp +++ b/plugins/IgnoreState/src/options.cpp @@ -103,8 +103,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int onOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.szGroup.a = LPGEN("Icons");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_IGNORE_OPT);
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index ecafcc9d01..abb97ffd29 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -60,7 +60,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IMPORT static int ModulesLoaded(WPARAM, LPARAM)
{
// menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x20ffaf55, 0xafa0, 0x4da3, 0xa9, 0x46, 0x20, 0x51, 0xa0, 0x24, 0xb, 0x41);
mi.hIcolibItem = GetIconHandle(IDI_IMPORT);
mi.name.a = LPGEN("&Import...");
diff --git a/plugins/ImportTXT/version.RES b/plugins/ImportTXT/version.RES Binary files differnew file mode 100644 index 0000000000..432e6d2ae4 --- /dev/null +++ b/plugins/ImportTXT/version.RES diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 7f993f1291..a7cb0b5128 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -1383,8 +1383,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP // ** int InitializeOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = LPGEN("Keyboard Flash"); odp.szGroup.a = LPGEN("Events"); diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 79da8a41a7..d7ee6d32d6 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -94,7 +94,7 @@ void RebuildMenu() wchar_t text[512];
mir_snwprintf(text, TranslateT("Send to %s"), info->account);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 100000 + i;
mi.root = hMainMenuGroup;
mi.position = 500080000 + i;
@@ -192,7 +192,7 @@ int ModulesLoaded(WPARAM, LPARAM) }
// Add main menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe8e4e594, 0x255e, 0x434d, 0x83, 0x74, 0x79, 0x44, 0x1b, 0x4e, 0xe7, 0x16);
mi.position = 500080000;
mi.name.w = LPGENW("Listening to");
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 295d87c4d7..3f6983e05d 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -70,8 +70,7 @@ static OptPageControl playersControls[] = { int InitOptionsCallback(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.szGroup.a = LPGEN("Status");
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 702cd11aae..6c70db5ab3 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1461,8 +1461,7 @@ static INT_PTR CALLBACK DlgProcLotusNotifyMiscOpts(HWND hwndDlg, UINT msg, WPARA //options page on miranda called
int LotusNotifyOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Plugins");
odp.szTitle.w = _A2W(__PLUGIN_NAME);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
@@ -1702,7 +1701,7 @@ int CMPlugin::Load() //function that will be called on menu click
CreateServiceFunction("LotusNotify/MenuCommand", PluginMenuCommand);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x4519458, 0xb55a, 0x4e22, 0xac, 0x95, 0x5e, 0xa4, 0x4d, 0x92, 0x65, 0x65);
mi.position = -0x7FFFFFFF; //on top menu position
mi.flags = CMIF_UNICODE;
diff --git a/plugins/MagneticWindows/src/Options.cpp b/plugins/MagneticWindows/src/Options.cpp index 1f90473801..5af8e262f5 100644 --- a/plugins/MagneticWindows/src/Options.cpp +++ b/plugins/MagneticWindows/src/Options.cpp @@ -80,7 +80,6 @@ int InitOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE Opt = { sizeof(Opt) }; Opt.pfnDlgProc = OptionsDlgProc; Opt.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAGNETICWINDOWS); - Opt.hInstance = g_plugin.getInst(); Opt.szGroup.a = LPGEN("Customize"); Opt.szTitle.a = LPGEN("Magnetic Windows"); Opt.flags = ODPF_BOLDGROUPS; diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 0ed62c9026..31dc559030 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -737,7 +737,7 @@ static INT_PTR onIgnore(WPARAM wparam, LPARAM lparam) static HGENMENU AddSubmenuItem(HGENMENU hRoot, wchar_t* name, HICON icon, DWORD flag, char* service, int pos, INT_PTR param)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = hRoot;
mi.position = pos;
mi.name.w = name;
@@ -905,7 +905,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Browse Received Files");
bbd.bbbFlags = BBBF_CANBEHIDDEN;
bbd.hIcon = IcoLib_GetIconHandle("miex_recfiles");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
@@ -943,7 +943,7 @@ static int PluginInit(WPARAM, LPARAM) ModuleLoad(0, 0);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
SET_UID(mi, 0x2616aa3f, 0x535a, 0x464c, 0xbd, 0x26, 0x1b, 0x15, 0xbe, 0xfa, 0x1f, 0xf);
diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index eeee4998c6..313ee51702 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -96,9 +96,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) int OptionsInit(WPARAM wparam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 955000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = MODULENAME;
odp.pfnDlgProc = OptionsProc;
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 34ee40af80..805ad0884e 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -105,7 +105,7 @@ int OnModulesLoaded(WPARAM, LPARAM) sid.szModule = MODULENAME;
sid.flags = MBF_HIDDEN;
sid.dwId = 1;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
InitClistExtraIcon();
diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index 4fef2aa8c7..34991bb4b3 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -669,9 +669,8 @@ INT_PTR CALLBACK DlgProcOpts_Tab3(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM */
int OptInit(WPARAM wParam, LPARAM) {
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.a = LPGEN(PLUGIN_OPTIONS_NAME);
odp.szGroup.a = LPGEN("Services");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/MirLua/src/Modules/m_clist.cpp b/plugins/MirLua/src/Modules/m_clist.cpp index c43ee1782e..0b6d390004 100644 --- a/plugins/MirLua/src/Modules/m_clist.cpp +++ b/plugins/MirLua/src/Modules/m_clist.cpp @@ -2,7 +2,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) { - mi.langId = CMLuaEnvironment::GetEnvironmentId(L); + mi.pPlugin = CMLuaEnvironment::GetEnvironmentId(L); lua_getfield(L, -1, "Flags"); mi.flags = lua_tointeger(L, -1); @@ -57,7 +57,7 @@ static int clist_AddMainMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); MakeMenuItem(L, mi); HGENMENU res = Menu_AddMainMenuItem(&mi); @@ -88,7 +88,7 @@ static int clist_AddContactMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); MakeMenuItem(L, mi); ptrA szProto(mir_utf8decodeA(lua_tostring(L, 2))); @@ -105,7 +105,7 @@ static int clist_AddTrayMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); MakeMenuItem(L, mi); HGENMENU res = Menu_AddTrayMenuItem(&mi); diff --git a/plugins/MirLua/src/Modules/m_core.cpp b/plugins/MirLua/src/Modules/m_core.cpp index 281aa288fe..36cbcb3dc4 100644 --- a/plugins/MirLua/src/Modules/m_core.cpp +++ b/plugins/MirLua/src/Modules/m_core.cpp @@ -222,7 +222,7 @@ static int core_Translate(lua_State *L) char *what = (char*)luaL_checkstring(L, 1); ptrW value(mir_utf8decodeW(what)); - lua_pushstring(L, T2Utf(TranslateW_LP(value, g_plugin.m_hLang))); + lua_pushstring(L, T2Utf(TranslateW_LP(value, &g_plugin))); return 1; } diff --git a/plugins/MirLua/src/Modules/m_hotkeys.cpp b/plugins/MirLua/src/Modules/m_hotkeys.cpp index 1245d2348f..a6c35fdefb 100644 --- a/plugins/MirLua/src/Modules/m_hotkeys.cpp +++ b/plugins/MirLua/src/Modules/m_hotkeys.cpp @@ -41,9 +41,7 @@ static int hotkeys_Register(lua_State *L) HOTKEYDESC hk; MakeHotkey(L, hk); - int hScriptLangpack = CMLuaEnvironment::GetEnvironmentId(L); - - INT_PTR res = Hotkey_Register(&hk, hScriptLangpack); + INT_PTR res = Hotkey_Register(&hk, CMLuaEnvironment::GetEnvironmentId(L)); lua_pushboolean(L, res); return 1; diff --git a/plugins/MirLua/src/Modules/m_icolib.cpp b/plugins/MirLua/src/Modules/m_icolib.cpp index 86b5163290..3f94e26894 100644 --- a/plugins/MirLua/src/Modules/m_icolib.cpp +++ b/plugins/MirLua/src/Modules/m_icolib.cpp @@ -69,8 +69,7 @@ static int lua_AddIcon(lua_State *L) else
luaL_argerror(L, 1, luaL_typename(L, 1));
- int hScriptLangpack = CMLuaEnvironment::GetEnvironmentId(L);
- HANDLE res = IcoLib_AddIcon(&sid, hScriptLangpack);
+ HANDLE res = IcoLib_AddIcon(&sid, CMLuaEnvironment::GetEnvironmentId(L));
lua_pushlightuserdata(L, res);
mir_free((void*)sid.pszName);
diff --git a/plugins/MirLua/src/Modules/m_options.cpp b/plugins/MirLua/src/Modules/m_options.cpp index 29383e89ad..bcb9c799d0 100644 --- a/plugins/MirLua/src/Modules/m_options.cpp +++ b/plugins/MirLua/src/Modules/m_options.cpp @@ -45,8 +45,7 @@ public: void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp) { - odp.hInstance = g_plugin.getInst(); - odp.langId = CMLuaEnvironment::GetEnvironmentId(L); + odp.pPlugin = CMLuaEnvironment::GetEnvironmentId(L); lua_getfield(L, -1, "Flags"); odp.flags = luaL_optinteger(L, -1, ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE); @@ -91,7 +90,7 @@ int opt_AddPage(lua_State *L) luaL_checktype(L, 1, LUA_TLIGHTUSERDATA); WPARAM wParam = (WPARAM)lua_touserdata(L, 1); - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; MakeOptionDialogPage(L, odp); INT_PTR res = g_plugin.addOptions(wParam, &odp); diff --git a/plugins/MirLua/src/Modules/m_srmm.cpp b/plugins/MirLua/src/Modules/m_srmm.cpp index bbaf3edc3f..316a81171f 100644 --- a/plugins/MirLua/src/Modules/m_srmm.cpp +++ b/plugins/MirLua/src/Modules/m_srmm.cpp @@ -47,8 +47,7 @@ static int lua_AddButton(lua_State *L) BBButton bbb = {}; MakeBBButton(L, bbb); - int hScriptLangpack = CMLuaEnvironment::GetEnvironmentId(L); - HANDLE res = Srmm_AddButton(&bbb, hScriptLangpack); + HANDLE res = Srmm_AddButton(&bbb, CMLuaEnvironment::GetEnvironmentId(L)); CleanBBButton(bbb); if (!res) { diff --git a/plugins/MirLua/src/environment.cpp b/plugins/MirLua/src/environment.cpp index 76a34cbc55..88e7bff62b 100644 --- a/plugins/MirLua/src/environment.cpp +++ b/plugins/MirLua/src/environment.cpp @@ -8,16 +8,14 @@ CMLuaEnvironment::CMLuaEnvironment(lua_State *_l) : CMPluginBase(nullptr, pluginInfoEx), L(_l) { - MUUID muidLast = MIID_LAST; - m_hLang = GetPluginLangId(muidLast, 0); } CMLuaEnvironment::~CMLuaEnvironment() { - KillModuleIcons(m_hLang); - KillModuleSounds(m_hLang); - KillModuleMenus(m_hLang); - KillModuleHotkeys(m_hLang); + KillModuleIcons(this); + KillModuleSounds(this); + KillModuleMenus(this); + KillModuleHotkeys(this); KillObjectEventHooks(this); KillObjectServices(this); @@ -41,12 +39,10 @@ CMLuaEnvironment* CMLuaEnvironment::GetEnvironment(lua_State *L) return env; } -int CMLuaEnvironment::GetEnvironmentId(lua_State *L) +HPLUGIN CMLuaEnvironment::GetEnvironmentId(lua_State *L) { CMLuaEnvironment *env = GetEnvironment(L); - return env != nullptr - ? env->m_hLang - : g_hMLuaLangpack; + return env != nullptr ? HPLUGIN(env) : &g_plugin; } static int HookEventEnvParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param) diff --git a/plugins/MirLua/src/environment.h b/plugins/MirLua/src/environment.h index 1f05f1f986..7c2300b6d9 100644 --- a/plugins/MirLua/src/environment.h +++ b/plugins/MirLua/src/environment.h @@ -15,7 +15,7 @@ public: virtual ~CMLuaEnvironment(); static CMLuaEnvironment* GetEnvironment(lua_State *L); - static int GetEnvironmentId(lua_State *L); + static HPLUGIN GetEnvironmentId(lua_State *L); HANDLE HookEvent(const char *name, int ref); int UnhookEvent(HANDLE hHook); diff --git a/plugins/MirLua/src/lua.cpp b/plugins/MirLua/src/lua.cpp index dd2fd64606..7f96a2300f 100644 --- a/plugins/MirLua/src/lua.cpp +++ b/plugins/MirLua/src/lua.cpp @@ -2,19 +2,12 @@ CMLua::CMLua() : L(nullptr) { - //MUUID muidLast = MIID_LAST; - //g_hMLuaLangpack = GetPluginLangId(muidLast, 0); } CMLua::~CMLua() { Log("Unloading lua engine"); - KillModuleIcons(g_hMLuaLangpack); - KillModuleSounds(g_hMLuaLangpack); - KillModuleMenus(g_hMLuaLangpack); - KillModuleHotkeys(g_hMLuaLangpack); - KillObjectEventHooks(L); KillObjectServices(L); diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp index f6b0f4cd51..fe3ac6abba 100644 --- a/plugins/MirLua/src/options.cpp +++ b/plugins/MirLua/src/options.cpp @@ -25,6 +25,8 @@ static int ScriptStatusToIcon(ScriptStatus status) case ScriptStatus::Failed:
return 1;
}
+
+ return 0;
}
void CMLuaOptions::LoadScripts()
@@ -163,7 +165,6 @@ void CMLuaOptions::OnReload(CCtrlBase*) int OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.szGroup.w = LPGENW("Services");
odp.szTitle.w = L"Lua";
diff --git a/plugins/MirLua/src/plugin.cpp b/plugins/MirLua/src/plugin.cpp index 02a849b2dd..d8f1864c94 100644 --- a/plugins/MirLua/src/plugin.cpp +++ b/plugins/MirLua/src/plugin.cpp @@ -50,10 +50,10 @@ void CMPlugin::UnloadLua() { Scripts.destroy(); - KillModuleIcons(g_hMLuaLangpack); - KillModuleSounds(g_hMLuaLangpack); - KillModuleMenus(g_hMLuaLangpack); - KillModuleHotkeys(g_hMLuaLangpack); + KillModuleIcons(this); + KillModuleSounds(this); + KillModuleMenus(this); + KillModuleHotkeys(this); KillObjectEventHooks(lua->L); KillObjectServices(lua->L); diff --git a/plugins/MirLua/src/stdafx.h b/plugins/MirLua/src/stdafx.h index 434dcb8e50..2aabb9c8a5 100644 --- a/plugins/MirLua/src/stdafx.h +++ b/plugins/MirLua/src/stdafx.h @@ -50,7 +50,6 @@ class CMLuaScript; #define MODULENAME "MirLua"
-extern int g_hMLuaLangpack;
extern PLUGININFOEX g_pluginInfoEx;
extern HANDLE g_hCLibsFolder;
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index cc47a815f9..d5dc58db0d 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -166,7 +166,7 @@ void InitMirOTRMenu(void) Menu_ConfigureObject(hMirOTRMenuObject, MCO_OPT_ONADD_SERVICE, "MIROTRMENUS/OnAddMenuItemMirOTRMenu"); // menu items - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_DISABLED | CMIF_UNICODE; mi.name.w = LPGENW("OTR Status"); mi.position = 0; diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index b0cd74e3ba..415fbc58d4 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -826,9 +826,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w static int OpenOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100; - odp.hInstance = g_plugin.getInst(); odp.szGroup.w = LPGENW("Services"); odp.szTitle.w = L"OTR"; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index d375500602..0dc6a16897 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -158,7 +158,7 @@ void InitMenu() CreateServiceFunction(MS_OTR_MENUVERIFY, SVC_VerifyOTR); CreateServiceFunction(MS_OTR_MENUTOGGLEHTML, SVC_ToggleHTMLOTR); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE; mi.position = -400000; diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index db37ca4f6e..6b4c70d1e5 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -86,7 +86,7 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) int SVC_ButtonsBarLoaded(WPARAM, LPARAM) { - Srmm_AddButton(&OTRButton, g_plugin.m_hLang); + Srmm_AddButton(&OTRButton, &g_plugin); return 0; } @@ -121,12 +121,12 @@ void InitSRMM() sid.hIconDisabled = hIconNotSecure; sid.flags = MBF_DISABLED | MBF_HIDDEN; sid.szTooltip = LANG_OTR_TOOLTIP; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 1; sid.hIcon = hIconPrivate; sid.hIconDisabled = hIconUnverified; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // hook the window events so that we can can change the status of the icon HookEvent(ME_MSG_ICONPRESSED, SVC_IconPressed); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 26c8f2b0dd..e2302eac84 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -241,9 +241,8 @@ void CConfig::OnConnectionChanged() int CConfig::InitOptionsDialog(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 847000000;
- odp.hInstance = g_plugin.getInst();
odp.szGroup.a = LPGEN("MirandaG15");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 11bb810d63..ee0cd78a91 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -190,8 +190,7 @@ int HookedInit(WPARAM, LPARAM) int HookedOptions(WPARAM wParam, LPARAM)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.w = LPGENW("MessagePopup");
odp.szGroup.w = LPGENW("Popups");
diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 4464680323..89817922df 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -111,7 +111,7 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
if (!bReplaceHistory) {
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x701c543, 0xd078, 0x41dd, 0x95, 0xe3, 0x96, 0x49, 0x8a, 0x72, 0xc7, 0x50);
mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_EXPORT_MESSAGE));
mi.position = 1000090100;
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 4b3bab4c98..99d6912123 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1226,9 +1226,8 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) {
bUnaplyedChanges = FALSE;
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szTitle.w = LPGENW("Message export");
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 9b1e207684..46f69fb83e 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -325,7 +325,7 @@ int CreateFrame() // Create menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("My details"), 500010000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8C1C981C-4F28-4C4C-9121-544156210CE9");
diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 36de82c6e5..bd4c42fd95 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -75,7 +75,7 @@ static int MainInit(WPARAM, LPARAM) InitProtocolData();
// Add options to menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x73ff525d, 0x7b8, 0x49cc, 0xa2, 0xdf, 0xc5, 0xad, 0x13, 0xf3, 0x8e, 0x2d);
mi.position = 500050000;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp index 6ee25f1604..e1cd488025 100644 --- a/plugins/MyDetails/src/options.cpp +++ b/plugins/MyDetails/src/options.cpp @@ -161,9 +161,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int InitOptionsCallback(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -200000000;
- odp.hInstance = g_plugin.getInst();
odp.pfnDlgProc = DlgProcOpts;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
odp.szGroup.w = LPGENW("Contact list");
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index 53a2ee4ecd..43eb9434dc 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -1020,7 +1020,6 @@ int OptsDlgInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE optDi = { sizeof(optDi) };
optDi.position = 920000000;
- optDi.hInstance = g_plugin.getInst();
optDi.flags = ODPF_BOLDGROUPS;
optDi.szTitle.a = OPT_MAINGROUP;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 7f0f2f3cf6..402fe90431 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -619,7 +619,7 @@ int MirandaLoaded(WPARAM, LPARAM) int SendOnEvent = CContactSettings(g_ProtoStates[(char*)NULL].m_status).Autoreply;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xa379c361, 0x9e3f, 0x468d, 0xb2, 0xac, 0xc4, 0x89, 0xbb, 0xfc, 0x81, 0x15);
mi.position = 1000020000;
mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE;
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp index a2d03a96b5..b31d755faf 100644 --- a/plugins/NewEventNotify/src/menuitem.cpp +++ b/plugins/NewEventNotify/src/menuitem.cpp @@ -52,7 +52,7 @@ int MenuitemInit(BOOL bStatus) HGENMENU hRoot = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x7aed93f7, 0x835, 0x4ff6, 0xb1, 0x34, 0xae, 0x0, 0x21, 0x2a, 0xd7, 0x81);
mi.root = hRoot;
mi.position = 1;
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp index 933fc75dbc..946cab50f3 100644 --- a/plugins/NewEventNotify/src/options.cpp +++ b/plugins/NewEventNotify/src/options.cpp @@ -289,8 +289,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, L int OptionsAdd(HINSTANCE hInst, WPARAM addInfo)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = hInst;
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.szTitle.a = LPGEN("Event Notify");
odp.szGroup.a = LPGEN("Popups");
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index dcd7f8abdd..db3911f2a2 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -595,9 +595,8 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) int UserInfoInitialise(WPARAM wParam, LPARAM lParam)
{
if (lParam) {
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SOUNDS);
odp.szTitle.a = LPGEN("Status Notify");
odp.pfnDlgProc = DlgProcSoundUIPage;
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index c15933478b..23d3587ab9 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1081,7 +1081,7 @@ INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM) void InitMainMenuItem()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x22b7b4db, 0xa9a1, 0x4d43, 0x88, 0x80, 0x4c, 0x23, 0x20, 0x31, 0xc6, 0xa0);
mi.flags = CMIF_UNICODE;
if (ServiceExists(MS_POPUP_ADDPOPUPT))
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 8c3e5954b8..c109c5fafd 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -1172,9 +1172,8 @@ INT_PTR CALLBACK DlgProcLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int OptionsInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS;
odp.szTitle.a = LPGEN("Status Notify");
odp.szGroup.a = LPGEN("Status");
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 907c4cffb1..d2e50a0ffb 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -109,12 +109,12 @@ static int OnModulesLoaded(WPARAM, LPARAM) sid.dwId = 0x00000001; sid.hIcon = IcoLib_GetIcon("secured"); sid.szTooltip = LPGEN("GPG Turn off encryption"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 0x00000002; sid.hIcon = IcoLib_GetIcon("unsecured"); sid.szTooltip = LPGEN("GPG Turn on encryption"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); if(globals.bJabberAPI) GetJabberInterface(0,0); @@ -151,7 +151,7 @@ int CMPlugin::Load() CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys); CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xbd22e3f8, 0xc19c, 0x45a8, 0xb7, 0x37, 0x6b, 0x3b, 0x27, 0xf0, 0x8c, 0xbb); mi.position = -0x7FFFFFFF; diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index fddc9e357a..b4da20d147 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -217,7 +217,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) { MCONTACT hContact = db_mc_tryMeta(w); { - CMenuItem mi2(g_plugin); + CMenuItem mi2(&g_plugin); LPSTR proto = GetContactProto(hContact); PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string setting; diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index e64b3f0764..8623ec52c4 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -23,7 +23,7 @@ HGENMENU hService2[7]; void InitMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE;
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("News Aggregator"), 500099000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D9733E4F-1946-4390-8EB3-591E8687222E");
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 2413a64191..4723f798e7 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -1075,8 +1075,7 @@ void COptionsMain::OnFeedListDoubleClick(CCtrlBase*) int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szGroup.w = LPGENW("Network");
odp.szTitle.w = LPGENW("News Aggregator");
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 117144be63..8fd739e37e 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -222,12 +222,12 @@ void SrmmMenu_Load() sid.dwId = 0;
sid.szTooltip = LPGEN("History Enabled");
sid.hIcon = sid.hIconDisabled = hIconKeep;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
sid.szTooltip = LPGEN("History Disabled");
sid.hIcon = sid.hIconDisabled = hIconRemove;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
// hook the window events so that we can can change the status of the icon
HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
@@ -239,7 +239,7 @@ void SrmmMenu_Load() static int ModulesLoaded(WPARAM, LPARAM)
{
// create contact menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
SET_UID(mi, 0xede12697, 0x3e9d, 0x47ca, 0x83, 0xe0, 0xc1, 0x40, 0x69, 0xbf, 0x2d, 0xab);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index c0eba96e71..65f7728bab 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -218,10 +218,9 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS|ODPF_UNICODE;
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.szTitle.w = LPGENW("No History");
odp.szGroup.w = LPGENW("History");
diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index c04f0dcd25..62bac3b7c5 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -47,8 +47,7 @@ int LCStatus = ID_STATUS_OFFLINE; //
int NimcOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szGroup.a = LPGEN("Plugins");
odp.szTitle.a = LPGEN("Non-IM Contacts");
@@ -133,7 +132,7 @@ int CMPlugin::Load() CreateServiceFunction("TestStringReplaceLine", testStringReplacer);
CreateServiceFunction("NIM_Contact/DoubleClick", doubleClick);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("&Non-IM Contact"), 600090000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D7CE61C5-1178-41BA-B2ED-5A711BB21AE9");
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index b1207d055d..9255fcd318 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -120,9 +120,8 @@ void InitIcons(void) static int OnOptInitialise(WPARAM w, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 900002000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_STNOTEOPTIONS);
odp.szTitle.a = SECTIONNAME;
odp.szGroup.a = LPGEN("Plugins");
@@ -198,7 +197,7 @@ int OnModulesLoaded(WPARAM, LPARAM) g_AddContListMI = (BOOL)db_get_dw(0, MODULENAME, "AddContactMenuItems", 1);
// register menus
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Notes && Reminders"), 1600000000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "A5E140BC-D697-4689-B75B-8ECFB6FE5931");
mi.flags = CMIF_UNICODE;
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index d26cb7131c..cbebfd6b59 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -171,13 +171,12 @@ void load_settings() int OptionsInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(NA_OPTIONS);
odp.pfnDlgProc = DlgProcOpts;
odp.szTitle.a = LPGEN("Notify Anything");
odp.szGroup.a = LPGEN("Plugins");
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS;
g_plugin.addOptions(wParam, &odp);
return 0;
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index e9c5640131..06e3590aa0 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -411,7 +411,7 @@ static int TabsrmmButtonInit(WPARAM, LPARAM) bbd.hIcon = iconList[0].hIcolib;
bbd.dwButtonID = 6000;
bbd.pszHotkey = hkd.pszName;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
@@ -488,7 +488,7 @@ int CMPlugin::Load() CreateServiceFunction(MS_NUDGE_SHOWMENU, NudgeShowMenu);
// Add contact menu entry
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xd617db26, 0x22ba, 0x4205, 0x9c, 0x3e, 0x53, 0x10, 0xbc, 0xcf, 0xce, 0x19);
mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE;
mi.position = -500050004;
diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index 157cc48682..3952cc040b 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -372,9 +372,8 @@ static INT_PTR CALLBACK DlgProcNudgeOpt(HWND hwnd, UINT msg, WPARAM wParam, LPAR int NudgeOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NUDGE);
odp.szTitle.a = LPGEN("Nudge");
odp.szGroup.a = LPGEN("Events");
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index cd4b741ea8..096b0dc485 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -99,7 +99,7 @@ int CMPlugin::Load() hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT );
g_plugin.addHotkey(&hotkey);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xbba6ad01, 0x755a, 0x4d01, 0x94, 0xee, 0x57, 0x84, 0x18, 0x70, 0x77, 0x4f);
mi.position = 0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 5758e734b6..0e5b293e3a 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -380,9 +380,8 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
odp.szGroup.w = LPGENW("Services");
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index cdae7910ce..a9c4c801e6 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -64,7 +64,7 @@ int CMPlugin::Load() // Add cheking update menu item
CreateServiceFunction(MODULENAME"/CheckUpdates", MenuCommand);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x326495e8, 0xab0a, 0x47d2, 0xb2, 0x22, 0x2a, 0x8e, 0xa8, 0xae, 0x53, 0x1a);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 1077714690..fe6a819888 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -677,9 +677,8 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) int Options::InitOptions(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szTitle.w = LPGENW("Paste It");
odp.szGroup.w = LPGENW("Services");
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 4e48b1aabf..0b538f5cae 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -251,7 +251,7 @@ static INT_PTR ContactMenuService(WPARAM hContact, LPARAM lParam) static void InitMenuItems()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x33ecc112, 0x6, 0x487d, 0xbb, 0x8b, 0x76, 0xb4, 0x17, 0x9b, 0xdb, 0xc5);
mi.flags = CMIF_UNICODE;
@@ -277,7 +277,7 @@ static void InitMenuItems() HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi);
Menu_ConfigureItem(hDefWebMenu, MCI_OPT_EXECPARAM, DEF_PAGES_START - 1);
- CMenuItem mi2(g_plugin);
+ CMenuItem mi2(&g_plugin);
mi2.pszService = MS_PASTEIT_CONTACTMENU;
mi2.root = hDefWebMenu;
for (int i = 0; i < PasteToWeb::pages; ++i) {
@@ -309,7 +309,7 @@ static void InitTabsrmmButton() btn.hIcon = iconList[0].hIcolib;
btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN | BBBF_ISCHATBUTTON;
btn.pwszTooltip = TranslateT("Paste It");
- Srmm_AddButton(&btn, g_plugin.m_hLang);
+ Srmm_AddButton(&btn, &g_plugin);
if (hTabsrmmButtonPressed != nullptr)
UnhookEvent(hTabsrmmButtonPressed);
diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp index fd49c789df..99a2cc1fd2 100644 --- a/plugins/Ping/src/menu.cpp +++ b/plugins/Ping/src/menu.cpp @@ -6,7 +6,7 @@ HANDLE hEventMenuBuild; void InitMenus()
{
// main menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Ping"), 500099900);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "FF273885-6AEC-4C8A-B8BC-9247D920F223");
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index b1753d5143..c6bac11d8d 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -496,8 +496,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int PingOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szGroup.w = LPGENW("Network");
odp.szTitle.w = LPGENW("Ping");
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index fa4b172eb2..8823b181be 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -880,7 +880,7 @@ void InitList() CreateServiceFunction(MODULENAME "/ShowWindow", PingPlugShowWindow);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Ping"), 1000200001);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "7CFBF239-86B5-48B2-8D5B-39E09A7DB514");
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index d77d0c9be1..89e6b9cf60 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -503,9 +503,8 @@ static INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM static int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY);
odp.szGroup.w = LPGENW("Services");
diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 7bac5a686f..424d99cf80 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -62,7 +62,7 @@ int CMPlugin::Load() // Add cheking update menu item
InitCheck();
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xfa2cbe01, 0x3b37, 0x4a4c, 0xa6, 0x97, 0xe4, 0x6f, 0x31, 0xa9, 0xfc, 0x33);
mi.name.a = LPGEN("Check for updates");
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 7517084fce..e82c40c5fa 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -61,9 +61,8 @@ HANDLE hTTButton; static int OptionsInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS;
odp.szTitle.a = MODULNAME_PLU;
@@ -173,7 +172,7 @@ INT_PTR svcShowHistory(WPARAM, LPARAM) void InitMenuItems(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
HANDLE hIcon = GetIconHandle(PopupOptions.ModuleIsEnabled ? IDI_POPUP : IDI_NOPOPUP);
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp index aef8080306..2ff5091fba 100644 --- a/plugins/Popup/src/srmm_menu.cpp +++ b/plugins/Popup/src/srmm_menu.cpp @@ -110,22 +110,22 @@ void SrmmMenu_Load() sid.dwId = 0;
sid.szTooltip = LPGEN("Popup Mode: Auto");
sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_POPUP);
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
sid.szTooltip = LPGEN("Popup Mode: Favorite");
sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FAVORITE);
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 2;
sid.szTooltip = LPGEN("Popup Mode: Ignore fullscreen");
sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FULLSCREEN);
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 3;
sid.szTooltip = LPGEN("Popup Mode: Block contact");
sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_NOPOPUP);
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
HookEvent(ME_MSG_ICONPRESSED, SrmmMenu_ProcessIconClick);
HookEvent(ME_MSG_WINDOWEVENT, SrmmMenu_ProcessEvent);
diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 1944dcb8ee..cf313004dd 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -89,7 +89,7 @@ int CMPlugin::Load() CreateServiceFunction(SRV_CHANGE_PM, ChangePM);
CreateServiceFunction(SRV_RESTART_ME, RestartMe);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), -500200000);
for (int i = 0; i < _countof(iconList); i++) {
diff --git a/plugins/ProxySwitch/src/main.cpp b/plugins/ProxySwitch/src/main.cpp index 06cea7f732..2b28f39993 100644 --- a/plugins/ProxySwitch/src/main.cpp +++ b/plugins/ProxySwitch/src/main.cpp @@ -126,7 +126,7 @@ static INT_PTR CopyIP2Clipboard(WPARAM, LPARAM, LPARAM idx) void UpdateInterfacesMenu(void) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mir_cslock lck(csNIF_List); for (auto &it : g_arNIF) { @@ -163,7 +163,7 @@ void UpdateInterfacesMenu(void) void UpdatePopupMenu(BOOL State) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); if (!hEnableDisablePopupMenu) return; @@ -254,7 +254,7 @@ int Init(WPARAM, LPARAM) mir_forkthread(IP_WatchDog, 0); // menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x53b0835b, 0x7162, 0x4272, 0x83, 0x3b, 0x3f, 0x60, 0x9e, 0xe, 0x76, 0x4a); mi.position = 0xC0000000; mi.flags = CMIF_UNICODE; diff --git a/plugins/ProxySwitch/src/opt.cpp b/plugins/ProxySwitch/src/opt.cpp index 416ff92fc8..2a071da495 100644 --- a/plugins/ProxySwitch/src/opt.cpp +++ b/plugins/ProxySwitch/src/opt.cpp @@ -128,9 +128,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 95600; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = OptionsProc; odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index a7969c3059..e0b59efd5f 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -49,8 +49,7 @@ void LoadOptions() int InitOptionsCallback(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Contacts");
odp.szTitle.w = LPGENW("Quick Contacts");
odp.pfnDlgProc = OptionsDlgProc;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index e387eae8be..99e8b69857 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -122,7 +122,7 @@ static int ModulesLoaded(WPARAM, LPARAM) }
// Add menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x3a3f768a, 0xcf47, 0x43d5, 0x92, 0x16, 0xe4, 0xeb, 0x93, 0xf6, 0x72, 0xfa);
mi.position = 500100001;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 618f8ba92f..bf6bb2ff66 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -254,7 +254,7 @@ DWORD BalanceButtons(int buttonsWas, int buttonsNow) bb.dwButtonID = buttonsWas++; bb.dwDefPos = 300 + buttonsWas; bb.hIcon = AddIcon(iconname); - Srmm_AddButton(&bb, g_plugin.m_hLang); + Srmm_AddButton(&bb, &g_plugin); } return buttonsNow; @@ -376,7 +376,7 @@ int RegisterCustomButton(WPARAM, LPARAM) bbd.hIcon = AddIcon(iconname); bbd.pszModuleName = MODULENAME; bbd.pwszTooltip = ld->ptszButtonName; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); } return 0; } diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 5dee646403..7d72dd7a14 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -1083,9 +1083,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) int OptionsInit(WPARAM wparam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 940000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = LPGEN("Quick Messages");
odp.pfnDlgProc = OptionsProc;
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index f925b6a2fd..9f40d42038 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -46,7 +46,7 @@ int OnModulesLoaded(WPARAM, LPARAM) bbd.hIcon = iconList[0].hIcolib;
bbd.dwButtonID = iNumber;
bbd.dwDefPos = 220;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index ee5ee16568..170bfba27e 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -164,12 +164,11 @@ int OnOptInitialized(WPARAM wParam, LPARAM) char tabName[32];
mir_snprintf(tabName, "%s %x", Translate("Button"), iNumber + 1);
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Message sessions");
odp.szTitle.a = LPGEN("Quick Replies");
odp.szTab.a = tabName;
odp.position = iNumber;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_PAGE);
odp.pfnDlgProc = DlgProcOptionsPage;
g_plugin.addOptions(wParam, &odp);
diff --git a/plugins/QuickSearch/quicksearch.dpr b/plugins/QuickSearch/quicksearch.dpr index d60426aa74..59f0c1ddcc 100644 --- a/plugins/QuickSearch/quicksearch.dpr +++ b/plugins/QuickSearch/quicksearch.dpr @@ -116,7 +116,6 @@ var begin
ZeroMemory(@odp,sizeof(odp));
odp.Position :=900003000;
- odp.hInstance :=hInstance;
odp.pszTemplate:=PAnsiChar(IDD_DIALOG1);
odp.szTitle.a :=qs_name;
odp.szGroup.a :='Contacts';
diff --git a/plugins/QuickSearch/sr_frame.pas b/plugins/QuickSearch/sr_frame.pas index ed83536d43..76696e462c 100644 --- a/plugins/QuickSearch/sr_frame.pas +++ b/plugins/QuickSearch/sr_frame.pas @@ -171,7 +171,7 @@ begin TBName.w:='Quick search';
end;
- FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),0);
+ FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),lparam(@g_Plugin));
if FrameId>=0 then
begin
CallService(MS_CLIST_FRAMES_UPDATEFRAME,FrameId, FU_FMPOS);
diff --git a/plugins/QuickSearch/version.RES b/plugins/QuickSearch/version.RES Binary files differnew file mode 100644 index 0000000000..ac94f5ecf9 --- /dev/null +++ b/plugins/QuickSearch/version.RES diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 8e501c3e80..2ee56b9554 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -61,7 +61,7 @@ INT_PTR QuotesMenu_EnableDisable(WPARAM, LPARAM) void InitMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN));
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "B474F556-22B6-42A1-A91E-22FE4F671388");
@@ -260,9 +260,8 @@ int QuotesEventFunc_OptInitialise(WPARAM wp, LPARAM/* lp*/) const CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr();
const CQuotesProviders::TQuotesProviders& rapProviders = pProviders->GetProviders();
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 910000000;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.w = _T(QUOTES_PROTOCOL_NAME);
odp.szGroup.w = LPGENW("Network");
odp.flags = ODPF_USERINFOTAB | ODPF_UNICODE;
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index c95504e08d..4e454fd7f9 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -107,8 +107,7 @@ int QuotesEventFunc_OnUserInfoInit(WPARAM wp, LPARAM lp) g_hContact = hContact;
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pfnDlgProc = QuoteInfoDlgProc;
odp.position = -2000000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_QUOTE_INFO);
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 8b2fb34115..2951ff1ce0 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -437,7 +437,7 @@ int Create_TopToolbarShowList(WPARAM, LPARAM) int Create_MenuitemShowList(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe22ce213, 0x362a, 0x444a, 0xa5, 0x82, 0xc, 0xcf, 0xf5, 0x4b, 0xd1, 0x8e);
mi.hIcolibItem = iconList[0].hIcolib;
mi.name.a = LPGEN("Recent Contacts");
diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index 313d89a130..57795570bb 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -57,8 +57,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int onOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_LASTUC_OPT);
odp.szTitle.a = LPGEN("Recent Contacts");
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 0900f3ee71..5bba760a16 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -589,7 +589,7 @@ static INT_PTR RemoveAllService(WPARAM, LPARAM) int CMPlugin::Load()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x2f9f21df, 0xf33c, 0x4640, 0xb9, 0x63, 0xd3, 0x26, 0x8a, 0xb8, 0xb1, 0xf0);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp index 037cc634be..91e5fa4a0b 100644 --- a/plugins/Restart/src/restart.cpp +++ b/plugins/Restart/src/restart.cpp @@ -49,7 +49,7 @@ int CMPlugin::Load() hRestartMe = CreateServiceFunction("System/RestartMe", RestartMe);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x9181059, 0x5316, 0x4be3, 0x96, 0xb7, 0x80, 0x51, 0xa9, 0x3a, 0xd8, 0x49);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = iconList[0].hIcolib;
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 17f692252e..803ef766af 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -27,7 +27,7 @@ int LoadModules(void) char szServiceFunction[MAX_PATH];
mir_snprintf(szServiceFunction, "%s%s", MODULENAME, SMS_SEND);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x3ce387db, 0xbaac, 0x490f, 0xac, 0xab, 0x8c, 0xf7, 0xe9, 0xcd, 0x86, 0xa1);
mi.position = 300050000;
diff --git a/plugins/SMS/src/options.cpp b/plugins/SMS/src/options.cpp index 3a9bfd6014..0ddd928ea3 100644 --- a/plugins/SMS/src/options.cpp +++ b/plugins/SMS/src/options.cpp @@ -88,9 +88,8 @@ INT_PTR CALLBACK DlgProcEditorOptions(HWND hWndDlg, UINT msg, WPARAM wParam, LPA int OptInitialise(WPARAM wParam,LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 910000000;
- odp.hInstance = ssSMSSettings.hInstance;
odp.szGroup.a = LPGEN("Events");
odp.flags = ODPF_BOLDGROUPS;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SMSPLUGIN);
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index 2a8e500710..191bd75ffd 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -127,7 +127,7 @@ static void OnLoadSettings() int Chat_Load()
{
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP, g_plugin.m_hLang };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP, &g_plugin };
Chat_CustomizeApi(&data);
g_chatApi.OnCreateModule = OnCreateModule;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 84088c24f9..0379451f63 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -897,9 +897,8 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam int OptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 910000000;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.a = LPGEN("Message sessions");
odp.flags = ODPF_BOLDGROUPS;
@@ -943,7 +942,6 @@ int OptInitialise(WPARAM wParam, LPARAM) if (g_dat.popupInstalled) {
odp.position = 910000002;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPOPUP);
odp.szGroup.a = LPGEN("Popups");
odp.szTitle.a = LPGEN("Messaging");
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index cc1b078373..9a417afbd7 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -403,7 +403,7 @@ static void RegisterStatusIcons() sid.hIcon = GetCachedIcon("scriver_TYPING");
sid.hIconDisabled = GetCachedIcon("scriver_TYPINGOFF");
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
}
void ChangeStatusIcons()
@@ -442,7 +442,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_SEND");
bbd.pwszText = LPGENW("&OK");
bbd.pwszTooltip = LPGENW("Send message");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_QUOTE;
@@ -450,7 +450,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_QUOTE");
bbd.pwszText = LPGENW("&Quote");
bbd.pwszTooltip = LPGENW("Quote");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.bbbFlags |= BBBF_ISRSIDEBUTTON;
bbd.dwButtonID = IDC_ADD;
@@ -458,21 +458,21 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_ADD");
bbd.pwszText = LPGENW("&Add");
bbd.pwszTooltip = LPGENW("Add contact permanently to list");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_USERMENU;
bbd.dwDefPos = 30;
bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_DOWNARROW);
bbd.pwszText = LPGENW("&User menu");
bbd.pwszTooltip = LPGENW("User menu");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_DETAILS;
bbd.dwDefPos = 40;
bbd.hIcon = IcoLib_GetIconHandle("scriver_USERDETAILS");
bbd.pwszText = LPGENW("User &details");
bbd.pwszTooltip = LPGENW("View user's details");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.bbbFlags |= BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
bbd.dwButtonID = IDC_SRMM_HISTORY;
@@ -480,7 +480,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_HISTORY");
bbd.pwszText = LPGENW("&History");
bbd.pwszTooltip = LPGENW("View user's history (CTRL+H)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
// chat buttons
bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID;
@@ -489,35 +489,35 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("chat_bold");
bbd.pwszText = LPGENW("&Bold");
bbd.pwszTooltip = LPGENW("Make the text bold (CTRL+B)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_ITALICS;
bbd.dwDefPos = 15;
bbd.hIcon = IcoLib_GetIconHandle("chat_italics");
bbd.pwszText = LPGENW("&Italic");
bbd.pwszTooltip = LPGENW("Make the text italicized (CTRL+I)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_UNDERLINE;
bbd.dwDefPos = 20;
bbd.hIcon = IcoLib_GetIconHandle("chat_underline");
bbd.pwszText = LPGENW("&Underline");
bbd.pwszTooltip = LPGENW("Make the text underlined (CTRL+U)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_COLOR;
bbd.dwDefPos = 25;
bbd.hIcon = IcoLib_GetIconHandle("chat_fgcol");
bbd.pwszText = LPGENW("&Color");
bbd.pwszTooltip = LPGENW("Select a foreground color for the text (CTRL+K)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_BKGCOLOR;
bbd.dwDefPos = 30;
bbd.hIcon = IcoLib_GetIconHandle("chat_bkgcol");
bbd.pwszText = LPGENW("&Background color");
bbd.pwszTooltip = LPGENW("Select a background color for the text (CTRL+L)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_SRMM_CHANMGR;
@@ -525,21 +525,21 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("chat_settings");
bbd.pwszText = LPGENW("&Room settings");
bbd.pwszTooltip = LPGENW("Control this room (CTRL+O)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST;
bbd.dwDefPos = 20;
bbd.hIcon = IcoLib_GetIconHandle("chat_nicklist");
bbd.pwszText = LPGENW("&Show/hide nick list");
bbd.pwszTooltip = LPGENW("Show/hide the nick list (CTRL+N)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_FILTER;
bbd.dwDefPos = 10;
bbd.hIcon = IcoLib_GetIconHandle("chat_filter");
bbd.pwszText = LPGENW("&Filter");
bbd.pwszTooltip = LPGENW("Enable/disable the event filter (CTRL+F)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
@@ -570,7 +570,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) LoadMsgLogIcons();
ModuleLoad(0, 0);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x58d8dc1, 0x1c25, 0x49c0, 0xb8, 0x7c, 0xa3, 0x22, 0x2b, 0x3d, 0xf1, 0xd8);
mi.position = -2000090000;
mi.flags = CMIF_DEFAULT;
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 6dd6706a23..35bd01a72d 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -26,7 +26,7 @@ CMPlugin::CMPlugin() : static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, LPCSTR service, int flags = 0, WPARAM wParam = 0)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = flags | CMIF_HIDDEN | CMIF_UNICODE;
mi.position = pos;
mi.hIcolibItem = hicon;
@@ -39,7 +39,7 @@ static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, static HGENMENU MyAddSubItem(HGENMENU hRoot, LPCSTR name, int pos, int poppos, LPCSTR service, WPARAM wParam = 0)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_HIDDEN | CMIF_SYSTEM;
mi.position = pos;
mi.name.a = (char*)name;
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 789a7bf667..89fce2390d 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1686,8 +1686,7 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) int onRegisterOptions(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSTAB);
odp.szTitle.a = (char*)MODULENAME;
odp.szGroup.a = LPGEN("Services");
diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp index 8f799ea352..6082ed09cc 100644 --- a/plugins/SecureIM/src/popupOptions.cpp +++ b/plugins/SecureIM/src/popupOptions.cpp @@ -162,8 +162,7 @@ void RefreshPopupOptionsDlg(HWND hec, HWND hdc, HWND hss, HWND hsr, HWND hks, HW int onRegisterPopOptions(WPARAM wParam, LPARAM)
{
if (bPopupExists) {
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUP);
odp.szTitle.a = (char*)MODULENAME;
odp.szGroup.a = LPGEN("Popups");
diff --git a/plugins/SecureIM/src/svcs_srmm.cpp b/plugins/SecureIM/src/svcs_srmm.cpp index 4fe6189727..1d9f0f065f 100644 --- a/plugins/SecureIM/src/svcs_srmm.cpp +++ b/plugins/SecureIM/src/svcs_srmm.cpp @@ -40,28 +40,28 @@ void InitSRMMIcons() sid.hIcon = mode2icon(MODE_NATIVE | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_NATIVE, 3);
sid.szTooltip = LPGEN("SecureIM [Native]");
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
// PGP
sid.dwId = MODE_PGP;
sid.hIcon = mode2icon(MODE_PGP | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_PGP, 3);
sid.szTooltip = LPGEN("SecureIM [PGP]");
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
// GPG
sid.dwId = MODE_GPG;
sid.hIcon = mode2icon(MODE_GPG | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_GPG, 3);
sid.szTooltip = LPGEN("SecureIM [GPG]");
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
// RSAAES
sid.dwId = MODE_RSAAES;
sid.hIcon = mode2icon(MODE_RSAAES | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_RSAAES, 3);
sid.szTooltip = LPGEN("SecureIM [RSA/AES]");
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
// hook the window events so that we can can change the status of the icon
HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent);
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index aa5bcccfa2..7127318474 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -69,7 +69,7 @@ void InitMenuitem() {
CreateServiceFunction("LastSeenUserDetails", MenuitemClicked);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x7d9b9518, 0x85fa, 0x40f1, 0xb5, 0x3e, 0x3e, 0x3c, 0x68, 0xae, 0xda, 0x90);
mi.position = -0x7FFFFFFF;
mi.name.a = LPGEN("Last seen");
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index db4914a3e6..8c9d456781 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -486,9 +486,8 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM int OptionsInit(WPARAM wparam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS);
odp.szGroup.w = LPGENW("Contacts");
diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 6be9c40bba..b4d5dc07a8 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -70,7 +70,6 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) if (IsWatchedProtocol(szProto) && !db_get_b(hContact, szProto, "ChatRoom", false)) {
OPTIONSDIALOGPAGE uip = { sizeof(uip) };
- uip.hInstance = g_plugin.getInst();
uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
uip.szTitle.a = LPGEN("Last seen");
uip.pfnDlgProc = UserinfoDlgProc;
diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index d0576407f0..437eaaeb1b 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -283,7 +283,7 @@ int CMPlugin::Load() srv_reg(Send2ImageShack); // menu items - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.hIcolibItem = GetIconHandle(ICO_MAINXS); diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 6d44ad45c2..cf0b3bebcf 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -772,7 +772,7 @@ static int PluginInit(WPARAM, LPARAM) g_plugin.addHotkey(&hkd);
// Main menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 1000000000;
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Sessions Manager"), 1000000000);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D77B9AB4-AF7E-43DB-A487-BD581704D635");
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 51409e4785..6aab0f3f35 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -489,9 +489,8 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l int OptionsInit(WPARAM wparam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 955000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = MODULENAME;
odp.pfnDlgProc = OptionsProc;
diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index e8f56e1614..e6b24c66f8 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -115,7 +115,6 @@ int OnOptionsInit(WPARAM wParam, LPARAM) opt.szTitle.a = LPGEN("Shell context menus");
opt.position = -1066;
opt.pszTemplate = MAKEINTRESOURCEA(IDD_SHLOPTS);
- opt.hInstance = g_plugin.getInst();
opt.pfnDlgProc = OptDialogProc;
g_plugin.addOptions(wParam, &opt);
return 0;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 734cee99ef..a4883dfeeb 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -246,7 +246,7 @@ int CMPlugin::Load() CreateServiceFunction(MODULENAME"/ToggleEnable", ToggleEnable);
CreateServiceFunction(MODULENAME"/ToggleAutoanswer", Toggle);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xac1c64a, 0x82ca, 0x4845, 0x86, 0x89, 0x59, 0x76, 0x12, 0x74, 0x72, 0x7b);
mi.position = 500090000;
diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 33ec72f31d..4fb0a78f34 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -135,9 +135,8 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara INT OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTION);
odp.szTitle.a = LPGEN("Simple Auto Replier");
odp.szGroup.a = LPGEN("Message sessions");
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 72555d6130..c338b2b668 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -382,7 +382,7 @@ int LoadAwayMsgModule(void) hWindowList = WindowList_Create();
hWindowList2 = WindowList_Create();
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 13a65ce4ce..eddf7ad04f 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1269,7 +1269,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM) if (!iStatusMsgFlags || !iStatusMenuItemCount)
return 0;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
if (!db_get_b(NULL, MODULENAME, "ShowStatusMenuItem", 1))
mi.flags |= CMIF_HIDDEN;
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index be24533c97..1652e32181 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -1525,8 +1525,7 @@ int InitOptions(WPARAM wParam, LPARAM) if (accounts->statusCount == 0)
return 0;
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index dadabb5995..ee990c5762 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -299,9 +299,8 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hdlg,UINT msg,WPARAM wp,LPARAM lp) int SSC_OptInitialise(WPARAM wp, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 910000000;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.a = LPGEN("Change Skype status");
odp.szGroup.a = LPGEN("Plugins");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_SETTINGS);
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index f8adf3d796..1a786ddae2 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -120,7 +120,7 @@ int SmileyButtonCreate(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("SmileyAdd_ButtonSmiley");
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON;
bbd.pszHotkey = desc.pszName;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 409e5bb81a..7745910a4f 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -54,7 +54,7 @@ static IconItem iconList[] = static int ModulesLoaded(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x5ba238de, 0xe16b, 0x4928, 0xa0, 0x70, 0xff, 0x43, 0xf6, 0x1f, 0x16, 0xd4);
mi.position = 2000070050;
mi.hIcolibItem = iconList[0].hIcolib;
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 7c1e1ebe69..e2c18a576f 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -629,9 +629,8 @@ static INT_PTR CALLBACK DlgProcSmileysOptions(HWND hwndDlg, UINT msg, WPARAM wPa int SmileysOptionsInitialize(WPARAM addInfo, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 910000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SMILEYS);
odp.szTitle.a = LPGEN("Smileys");
odp.szGroup.a = LPGEN("Customize");
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index ae9db94aed..21ca56813b 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -287,7 +287,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) CMStringW cat;
opt.ReadContactCategory(wParam, cat);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = hContactMenuItem;
mi.flags = CMIF_UNICODE | CMIF_SYSTEM;
mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 2183656a5e..bb2a2d15db 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -551,8 +551,7 @@ extern INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wPara int OnOptInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Message sessions");
odp.szTitle.a = MODULENAME;
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index b1580a3701..7302be7246 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -55,8 +55,7 @@ static OptPageControl autoReplaceControls[] = { int InitOptionsCallback(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Message sessions");
odp.szTitle.a = LPGEN("Spell Checker");
odp.pfnDlgProc = OptionsDlgProc;
@@ -65,7 +64,6 @@ int InitOptionsCallback(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp);
memset(&odp, 0, sizeof(odp));
- odp.hInstance = g_plugin.getInst();
odp.szGroup.a = LPGEN("Message sessions");
odp.szTitle.a = LPGEN("Auto-replacements");
odp.pfnDlgProc = AutoreplaceDlgProc;
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 2226ae058a..f5ce69d0a7 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -198,7 +198,7 @@ static int ModulesLoaded(WPARAM, LPARAM) mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); } HOTKEYDESC hkd = {}; diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index db5b2f2bcd..ae68e43f83 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -335,8 +335,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int OptInit(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Skins");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPLASH_OPT);
odp.szTitle.a = LPGEN("Splash Screen");
diff --git a/plugins/StartPosition/src/startposition.cpp b/plugins/StartPosition/src/startposition.cpp index 85c29bea02..75f0634117 100644 --- a/plugins/StartPosition/src/startposition.cpp +++ b/plugins/StartPosition/src/startposition.cpp @@ -48,7 +48,6 @@ void CMPlugin::positionClist() int CMPlugin::OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Contact list"); odp.szTitle.a = LPGEN("Start position"); odp.pDialog = new COptionsDlg(); diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 60f72d9e28..03b9b5e43c 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -240,7 +240,7 @@ static INT_PTR SilenceConnection(WPARAM wParam, LPARAM) static INT_PTR InitMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x9100c881, 0x6f76, 0x4cb5, 0x97, 0x66, 0xeb, 0xf5, 0xc5, 0x22, 0x46, 0x1f);
mi.position = 100000000;
mi.hIcolibItem = GetIconHandle(MENU_NAME);
@@ -412,8 +412,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int InitializeOptions(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SSOPT);
odp.szGroup.a = LPGEN("Events");//FIXME: move to...Group?
odp.szTitle.a = MENU_NAME;
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 21be66c31f..580d8bb631 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -318,8 +318,7 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w int StatusChangeOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.w = LPGENW("Status Change");
odp.szGroup.w = LPGENW("Status");
diff --git a/plugins/StatusManager/src/aaa_options.cpp b/plugins/StatusManager/src/aaa_options.cpp index 153b1656f7..934e550227 100644 --- a/plugins/StatusManager/src/aaa_options.cpp +++ b/plugins/StatusManager/src/aaa_options.cpp @@ -600,9 +600,8 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA int AutoAwayOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 1000000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; odp.szGroup.a = LPGEN("Status"); odp.szTitle.a = LPGEN("Auto away"); @@ -610,16 +609,16 @@ int AutoAwayOptInitialise(WPARAM wParam, LPARAM) odp.szTab.a = LPGEN("General"); odp.pfnDlgProc = DlgProcAutoAwayGeneralOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GENAUTOAWAY); - Options_AddPage(wParam, &odp, AAALangPack); + Options_AddPage(wParam, &odp, &AAAPlugin); odp.szTab.a = LPGEN("Rules"); odp.pfnDlgProc = DlgProcAutoAwayRulesOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTOAWAY); - Options_AddPage(wParam, &odp, AAALangPack); + Options_AddPage(wParam, &odp, &AAAPlugin); odp.szTab.a = LPGEN("Status messages"); odp.pfnDlgProc = DlgProcAutoAwayMsgOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTOAWAYMSG); - Options_AddPage(wParam, &odp, AAALangPack); + Options_AddPage(wParam, &odp, &AAAPlugin); return 0; } diff --git a/plugins/StatusManager/src/advancedautoaway.cpp b/plugins/StatusManager/src/advancedautoaway.cpp index 8f37e7d596..b3a9d10c75 100644 --- a/plugins/StatusManager/src/advancedautoaway.cpp +++ b/plugins/StatusManager/src/advancedautoaway.cpp @@ -30,7 +30,7 @@ ///////////////////////////////////////////////////////////////////////////////////////// -int AAALangPack; +CFakePlugin AAAPlugin(AAAMODULENAME); static HANDLE hEvents[3]; @@ -517,9 +517,7 @@ static int AAAModuleLoaded(WPARAM, LPARAM) void AdvancedAutoAwayLoad() { - AAALangPack = GetPluginLangId(MIID_LAST, 0); - - g_bAAASettingSame = db_get_b(0, AAAMODULENAME, SETTING_SAMESETTINGS, 0); + g_bAAASettingSame = AAAPlugin.getByte(SETTING_SAMESETTINGS); if (g_bMirandaLoaded) AAAModuleLoaded(0, 0); @@ -532,7 +530,7 @@ void AdvancedAutoAwayUnload() if (g_bMirandaLoaded) AutoAwayShutdown(0, 0); - KillModuleOptions(AAALangPack); + KillModuleOptions(&AAAPlugin); for (auto &it : hEvents) { UnhookEvent(it); diff --git a/plugins/StatusManager/src/keepstatus.cpp b/plugins/StatusManager/src/keepstatus.cpp index cbb52e8777..2fd5caf039 100644 --- a/plugins/StatusManager/src/keepstatus.cpp +++ b/plugins/StatusManager/src/keepstatus.cpp @@ -19,7 +19,7 @@ #include "stdafx.h" -int KSLangPack; +CFakePlugin KSPlugin(KSMODULENAME); static HANDLE hConnectionEvent = nullptr; static HANDLE hServices[4], hEvents[2]; @@ -93,18 +93,18 @@ int KSLoadOptions() { KSUnloadOptions(); - if (db_get_b(0, KSMODULENAME, SETTING_CHECKCONNECTION, FALSE)) { - if (db_get_b(0, KSMODULENAME, SETTING_CONTCHECK, FALSE)) { - if (db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE)) { + if (KSPlugin.getByte(SETTING_CHECKCONNECTION, FALSE)) { + if (KSPlugin.getByte(SETTING_CONTCHECK, FALSE)) { + if (KSPlugin.getByte(SETTING_BYPING, FALSE)) { WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); } StartTimer(IDT_CHECKCONTIN, 0, FALSE); } - increaseExponential = db_get_b(0, KSMODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE); - currentDelay = initDelay = 1000 * db_get_dw(0, KSMODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY); - maxDelay = 1000 * db_get_dw(0, KSMODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY); - maxRetries = db_get_b(0, KSMODULENAME, SETTING_MAXRETRIES, 0); + increaseExponential = KSPlugin.getByte(SETTING_INCREASEEXPONENTIAL, FALSE); + currentDelay = initDelay = 1000 * KSPlugin.getDword(SETTING_INITDELAY, DEFAULT_INITDELAY); + maxDelay = 1000 * KSPlugin.getDword(SETTING_MAXDELAY, DEFAULT_MAXDELAY); + maxRetries = KSPlugin.getByte(SETTING_MAXRETRIES, 0); if (maxRetries == 0) maxRetries = -1; hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); @@ -112,7 +112,7 @@ int KSLoadOptions() if (ServiceExists(ME_CS_STATUSCHANGE)) hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGE, CSStatusChange); hCSStatusChangeExHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); - if (db_get_b(0, KSMODULENAME, SETTING_CHECKAPMRESUME, 0)) { + if (KSPlugin.getByte(SETTING_CHECKAPMRESUME, 0)) { if (!IsWindow(hMessageWindow)) { hMessageWindow = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr); SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); @@ -132,7 +132,7 @@ int SMProto::AssignStatus(int iStatus, int iLastStatus, wchar_t *pwszMsg) return -1; if (iStatus != ID_STATUS_OFFLINE && m_status == ID_STATUS_DISABLED) return -2; - if (!db_get_b(0, KSMODULENAME, SETTING_NOLOCKED, 0) && Proto_GetAccount(m_szName)->IsLocked()) + if (!KSPlugin.getByte(SETTING_NOLOCKED, 0) && Proto_GetAccount(m_szName)->IsLocked()) return -3; mir_cslock lck(GenStatusCS); @@ -140,7 +140,7 @@ int SMProto::AssignStatus(int iStatus, int iLastStatus, wchar_t *pwszMsg) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", m_szName); m_lastStatus = (iLastStatus == 0) ? m_status : iLastStatus; - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) + if (!KSPlugin.getByte(dbSetting, 1)) m_status = ID_STATUS_DISABLED; else if (iStatus == ID_STATUS_LAST) m_status = m_lastStatus; @@ -192,7 +192,7 @@ static int SetCurrentStatus() log_infoA("KeepStatus: status for %s differs: stored = %d, real = %d", p->m_szName, curStatus, realStatus); // force offline before reconnecting? - if (realStatus != ID_STATUS_OFFLINE && db_get_b(0, KSMODULENAME, SETTING_FIRSTOFFLINE, FALSE)) { + if (realStatus != ID_STATUS_OFFLINE && KSPlugin.getByte(SETTING_FIRSTOFFLINE, FALSE)) { log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", p->m_szName); CallProtoService(p->m_szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); } @@ -333,7 +333,7 @@ static INT_PTR CALLBACK StartTimerApcProc(void *param) KillTimer(nullptr, checkContinTimerId); if (ti->timeout == 0) - ti->timeout = 1000 * db_get_dw(0, KSMODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY); + ti->timeout = 1000 * KSPlugin.getDword(SETTING_CNTDELAY, CHECKCONTIN_DELAY); checkContinTimerId = SetTimer(nullptr, 0, ti->timeout, CheckContinueslyTimer); } } @@ -434,7 +434,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", ack->szModule); - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) + if (!KSPlugin.getByte(dbSetting, 1)) return 0; if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) { @@ -451,7 +451,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) for (auto &it : protoList) { if (!mir_strcmp(ack->szModule, it->m_szName)) { it->AssignStatus(ID_STATUS_OFFLINE); - if (db_get_b(0, KSMODULENAME, SETTING_CNCOTHERLOC, 0)) { + if (KSPlugin.getByte(SETTING_CNCOTHERLOC, 0)) { StopTimer(IDT_PROCESSACK); for (auto &jt : protoList) jt->AssignStatus(ID_STATUS_OFFLINE); @@ -466,7 +466,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) // login failed NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); - switch (db_get_b(0, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)) { + switch (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING)) { case LOGINERR_CANCEL: log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule); for (auto &it : protoList) @@ -479,7 +479,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) case LOGINERR_SETDELAY: { - int newDelay = 1000 * db_get_dw(0, KSMODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); + int newDelay = 1000 * KSPlugin.getDword(SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); log_infoA("KeepStatus: set delay to %d ms on login error (%s)", newDelay, ack->szModule); StartTimer(IDT_CHECKCONN, newDelay, TRUE); } @@ -504,7 +504,7 @@ static VOID CALLBACK CheckConnectingTimer(HWND, UINT, UINT_PTR, DWORD) for (auto &it : protoList) { int curStatus = it->GetStatus(); if (IsStatusConnecting(curStatus)) { // connecting - int maxConnectingTime = db_get_dw(0, KSMODULENAME, SETTING_MAXCONNECTINGTIME, 0); + int maxConnectingTime = KSPlugin.getDword(SETTING_MAXCONNECTINGTIME, 0); if (maxConnectingTime > 0) { if ((unsigned int)maxConnectingTime <= ((GetTickCount() - it->lastStatusAckTime) / 1000)) { // set offline @@ -529,7 +529,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) continue; if (IsStatusConnecting(newStatus)) { // connecting - int maxConnectingTime = db_get_dw(0, KSMODULENAME, SETTING_MAXCONNECTINGTIME, 0); + int maxConnectingTime = KSPlugin.getDword(SETTING_MAXCONNECTINGTIME, 0); if (maxConnectingTime > 0) StartTimer(IDT_CHECKCONNECTING, (maxConnectingTime * 1000 - (GetTickCount() - it->lastStatusAckTime)), FALSE); } @@ -575,7 +575,7 @@ static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) if (increaseExponential) currentDelay = min(2 * currentDelay, maxDelay); - if (((db_get_b(0, KSMODULENAME, SETTING_CHKINET, 0)) && (!InternetGetConnectedState(nullptr, 0))) || ((db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE)) && (!bLastPingResult))) { + if (((KSPlugin.getByte(SETTING_CHKINET, 0)) && (!InternetGetConnectedState(nullptr, 0))) || ((KSPlugin.getByte(SETTING_BYPING, FALSE)) && (!bLastPingResult))) { // no network NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRYNOCONN, (LPARAM)retryCount + 1); ProcessPopup(KS_CONN_STATE_RETRYNOCONN, 0); @@ -670,7 +670,7 @@ static void CheckContinuouslyFunction(void *) return; } - BOOL ping = db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE); + BOOL ping = KSPlugin.getByte(SETTING_BYPING, FALSE); if (ping) { DBVARIANT dbv; if (db_get(0, KSMODULENAME, SETTING_PINGHOST, &dbv)) @@ -748,7 +748,7 @@ static void CheckContinuouslyFunction(void *) log_infoA("KeepStatus: connection lost! (continuesly check)"); NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, 0); ProcessPopup(KS_CONN_STATE_LOST, 0); - maxRetries = db_get_b(0, KSMODULENAME, SETTING_MAXRETRIES, 0); + maxRetries = KSPlugin.getByte(SETTING_MAXRETRIES, 0); if (maxRetries == 0) maxRetries = -1; StartTimer(IDT_CHECKCONN, initDelay, FALSE); @@ -757,7 +757,7 @@ static void CheckContinuouslyFunction(void *) static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) { - if (db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE)) + if (KSPlugin.getByte(SETTING_BYPING, FALSE)) mir_forkthread(CheckContinuouslyFunction); else CheckContinuouslyFunction(nullptr); @@ -772,19 +772,19 @@ static INT_PTR ShowPopup(const wchar_t *msg, HICON hIcon) ppd.lchIcon = hIcon; wcsncpy(ppd.lptzContactName, TranslateT("Keep status"), MAX_CONTACTNAME); wcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); - if (db_get_b(0, KSMODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) { + if (KSPlugin.getByte(SETTING_POPUP_USEWINCOLORS, 0)) { ppd.colorBack = GetSysColor(COLOR_BTNFACE); ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); } - else if (!db_get_b(0, KSMODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) { - ppd.colorBack = db_get_dw(0, KSMODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA); - ppd.colorText = db_get_dw(0, KSMODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC); + else if (!KSPlugin.getByte(SETTING_POPUP_USEDEFCOLORS, 0)) { + ppd.colorBack = KSPlugin.getDword(SETTING_POPUP_BACKCOLOR, 0xAAAAAA); + ppd.colorText = KSPlugin.getDword(SETTING_POPUP_TEXTCOLOR, 0x0000CC); } ppd.PluginWindowProc = KSPopupDlgProc; - switch (db_get_b(0, KSMODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { + switch (KSPlugin.getByte(SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { case POPUP_DELAYCUSTOM: - ppd.iSeconds = (int)db_get_dw(0, KSMODULENAME, SETTING_POPUP_TIMEOUT, 0); + ppd.iSeconds = (int)KSPlugin.getDword(SETTING_POPUP_TIMEOUT, 0); if (ppd.iSeconds == 0) ppd.iSeconds = currentDelay / 1000 - 1; break; @@ -809,7 +809,7 @@ static wchar_t* GetHumanName(LPARAM lParam) static int ProcessPopup(int reason, LPARAM lParam) { - if (!db_get_b(0, KSMODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) + if (!KSPlugin.getByte(SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) return -1; HICON hIcon = nullptr; @@ -817,7 +817,7 @@ static int ProcessPopup(int reason, LPARAM lParam) switch (reason) { case KS_CONN_STATE_OTHERLOCATION: // lParam = 1 proto - if (!db_get_b(0, KSMODULENAME, SETTING_PUOTHER, TRUE)) + if (!KSPlugin.getByte(SETTING_PUOTHER, TRUE)) return -1; hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); @@ -825,20 +825,20 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto - if (!db_get_b(0, KSMODULENAME, SETTING_PUOTHER, TRUE)) + if (!KSPlugin.getByte(SETTING_PUOTHER, TRUE)) return -1; hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - if (db_get_b(0, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) + if (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) wszText.Format(TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); - else if (db_get_b(0, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - wszText.Format(TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(0, KSMODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + else if (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) + wszText.Format(TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, KSPlugin.getDword(SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); else return -1; break; case KS_CONN_STATE_LOST: // lParam = 1 proto, or nullptr - if (!db_get_b(0, KSMODULENAME, SETTING_PUCONNLOST, TRUE)) + if (!KSPlugin.getByte(SETTING_PUCONNLOST, TRUE)) return -1; if (lParam) { // указатель на имя модуля. @@ -849,7 +849,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** - if (!db_get_b(0, KSMODULENAME, SETTING_PUCONNRETRY, TRUE)) + if (!KSPlugin.getByte(SETTING_PUCONNRETRY, TRUE)) return -1; if (lParam) { @@ -866,7 +866,7 @@ static int ProcessPopup(int reason, LPARAM lParam) continue; if (mir_wstrlen(p->m_tszAccName) > 0) - if (db_get_b(0, KSMODULENAME, SETTING_PUSHOWEXTRA, TRUE)) + if (KSPlugin.getByte(SETTING_PUSHOWEXTRA, TRUE)) wszText.AppendFormat(TranslateT("%s\t(will be set to %s)\r\n"), p->m_tszAccName, Clist_GetStatusModeDescription(p->m_status, 0)); } @@ -876,7 +876,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_RETRYNOCONN: // lParam = nullptr - if (!db_get_b(0, KSMODULENAME, SETTING_PUOTHER, TRUE)) + if (!KSPlugin.getByte(SETTING_PUOTHER, TRUE)) return -1; if (retryCount == maxRetries - 1) @@ -886,7 +886,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes - if (!db_get_b(0, KSMODULENAME, SETTING_PURESULT, TRUE)) + if (!KSPlugin.getByte(SETTING_PURESULT, TRUE)) return -1; if (lParam) { @@ -946,7 +946,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", szProto); - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) // 'hard' disabled + if (!KSPlugin.getByte(dbSetting, 1)) // 'hard' disabled return -1; int ret = -2; @@ -970,7 +970,7 @@ INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", szProto); - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) + if (!KSPlugin.getByte(dbSetting, 1)) return FALSE; for (auto &it : protoList) @@ -1066,8 +1066,6 @@ int KSModuleLoaded(WPARAM, LPARAM) void KeepStatusLoad() { - KSLangPack = GetPluginLangId(MIID_LAST, 0); - if (g_bMirandaLoaded) KSModuleLoaded(0, 0); else @@ -1086,7 +1084,7 @@ void KeepStatusUnload() if (g_bMirandaLoaded) onShutdown(0, 0); - KillModuleOptions(KSLangPack); + KillModuleOptions(&KSPlugin); for (auto &it : hServices) { DestroyServiceFunction(it); diff --git a/plugins/StatusManager/src/ks_options.cpp b/plugins/StatusManager/src/ks_options.cpp index 11428347db..00fb0ac893 100644 --- a/plugins/StatusManager/src/ks_options.cpp +++ b/plugins/StatusManager/src/ks_options.cpp @@ -457,7 +457,6 @@ static INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L int KeepStatusOptionsInit(WPARAM wparam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Status"); odp.szTitle.a = LPGEN("Keep status"); odp.flags = ODPF_BOLDGROUPS; @@ -465,23 +464,22 @@ int KeepStatusOptionsInit(WPARAM wparam, LPARAM) odp.szTab.a = LPGEN("Basic"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_KS_BASIC); odp.pfnDlgProc = DlgProcKSBasicOpts; - Options_AddPage(wparam, &odp, KSLangPack); + KSPlugin.addOptions(wparam, &odp); odp.szTab.a = LPGEN("Advanced"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_KS_ADV); odp.pfnDlgProc = DlgProcKSAdvOpts; - Options_AddPage(wparam, &odp, KSLangPack); + KSPlugin.addOptions(wparam, &odp); if (ServiceExists(MS_POPUP_ADDPOPUPT)) { memset(&odp, 0, sizeof(odp)); odp.position = 150000000; odp.szGroup.a = LPGEN("Popups"); - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS); odp.szTitle.a = LPGEN("Keep status"); odp.pfnDlgProc = PopupOptDlgProc; odp.flags = ODPF_BOLDGROUPS; - Options_AddPage(wparam, &odp, KSLangPack); + KSPlugin.addOptions(wparam, &odp); } return 0; } diff --git a/plugins/StatusManager/src/main.cpp b/plugins/StatusManager/src/main.cpp index 14116c9033..597d155589 100644 --- a/plugins/StatusManager/src/main.cpp +++ b/plugins/StatusManager/src/main.cpp @@ -41,6 +41,12 @@ CMPlugin::CMPlugin() : PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx) {} +CFakePlugin::CFakePlugin(const char *szModuleName) : + CMPluginBase(szModuleName, pluginInfoEx) +{ + m_hInst = g_plugin.getInst(); +} + ///////////////////////////////////////////////////////////////////////////////////////// // interfaces diff --git a/plugins/StatusManager/src/options.cpp b/plugins/StatusManager/src/options.cpp index b2b28b0d81..ee375493df 100644 --- a/plugins/StatusManager/src/options.cpp +++ b/plugins/StatusManager/src/options.cpp @@ -55,8 +55,7 @@ public: int OnCommonOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szGroup.w = LPGENW("Status"); odp.szTitle.w = LPGENW("Status manager"); diff --git a/plugins/StatusManager/src/ss_options.cpp b/plugins/StatusManager/src/ss_options.cpp index 833c6dd5f4..5c3a3b0d3f 100644 --- a/plugins/StatusManager/src/ss_options.cpp +++ b/plugins/StatusManager/src/ss_options.cpp @@ -895,17 +895,16 @@ public: int StartupStatusOptionsInit(WPARAM wparam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Status"); odp.szTitle.a = LPGEN("Startup status"); odp.flags = ODPF_BOLDGROUPS; odp.szTab.a = LPGEN("General"); odp.pDialog = new CSSMainOptDlg(); - Options_AddPage(wparam, &odp, SSLangPack); + SSPlugin.addOptions(wparam, &odp); odp.szTab.a = LPGEN("Status profiles"); odp.pDialog = new CSSAdvancedOptDlg(); - Options_AddPage(wparam, &odp, SSLangPack); + SSPlugin.addOptions(wparam, &odp); return 0; } diff --git a/plugins/StatusManager/src/ss_profiles.cpp b/plugins/StatusManager/src/ss_profiles.cpp index 2898136d83..c6082e3479 100644 --- a/plugins/StatusManager/src/ss_profiles.cpp +++ b/plugins/StatusManager/src/ss_profiles.cpp @@ -57,7 +57,7 @@ static INT_PTR profileService(WPARAM, LPARAM, LPARAM param) static int CreateMainMenuItems(WPARAM, LPARAM) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.position = 2000100000; mi.flags = CMIF_UNICODE; mcount = 0; diff --git a/plugins/StatusManager/src/startupstatus.cpp b/plugins/StatusManager/src/startupstatus.cpp index 6adac7c061..f6c539f902 100644 --- a/plugins/StatusManager/src/startupstatus.cpp +++ b/plugins/StatusManager/src/startupstatus.cpp @@ -19,7 +19,7 @@ #include "stdafx.h" -int SSLangPack; +CFakePlugin SSPlugin(SSMODULENAME); static HANDLE hServices[3], hEvents[3]; static UINT_PTR setStatusTimerId = 0; @@ -413,8 +413,6 @@ static INT_PTR SrvGetProfile(WPARAM wParam, LPARAM lParam) void StartupStatusLoad() { - SSLangPack = GetPluginLangId(MIID_LAST, 0); - if (g_bMirandaLoaded) SSModuleLoaded(0, 0); else @@ -445,7 +443,7 @@ void StartupStatusUnload() if (g_bMirandaLoaded) OnShutdown(0, 0); - KillModuleOptions(SSLangPack); + KillModuleOptions(&SSPlugin); for (auto &it : hServices) { DestroyServiceFunction(it); diff --git a/plugins/StatusManager/src/stdafx.h b/plugins/StatusManager/src/stdafx.h index 253429458d..6162650dad 100644 --- a/plugins/StatusManager/src/stdafx.h +++ b/plugins/StatusManager/src/stdafx.h @@ -46,13 +46,19 @@ struct CMPlugin : public PLUGIN<CMPlugin> int Unload() override; }; +struct CFakePlugin : public CMPluginBase +{ + CFakePlugin(const char *szModuleName); +}; + + #include "commonstatus.h" #include "keepstatus.h" #include "startupstatus.h" #include "advancedautoaway.h" extern bool g_bMirandaLoaded; -extern int AAALangPack, KSLangPack, SSLangPack; +extern CFakePlugin AAAPlugin, KSPlugin, SSPlugin; extern CMOption<bool> g_AAAEnabled, g_KSEnabled, g_SSEnabled; int OnCommonOptionsInit(WPARAM wParam, LPARAM); diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 27a58fb800..4cf7cc8cad 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -137,7 +137,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnDbContactSettingChanged);
HookEvent(ME_OPT_INITIALISE, OnOptInit);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x60ce7660, 0x5a5, 0x4234, 0x99, 0xb6, 0x55, 0x21, 0xed, 0xa0, 0xb8, 0x32);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index ad9ca4f3d7..9bfcf9a0d2 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -284,7 +284,7 @@ int OnOptInit(WPARAM w, LPARAM l) {
UNREFERENCED_PARAMETER(l);
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Message sessions");
odp.szTitle.w = LPGENW("StopSpam");
odp.position = -1;
diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 568479c6dc..757369bb55 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -161,7 +161,7 @@ public: int OnOptInit(WPARAM w, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Message sessions");
odp.szTitle.a = MODULENAME;
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index 411b734f2d..8c609cf5e6 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -35,7 +35,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnDbContactSettingchanged);
// Add deleting temporary contacts
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xf2164e17, 0xa4c1, 0x4b07, 0xae, 0x81, 0x9e, 0xae, 0x7f, 0xa2, 0x55, 0x13);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index fa4ce611f2..d779f15afe 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -12,80 +12,80 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_CONNECTING); bbd.pszModuleName = "Tabsrmm"; bbd.pwszTooltip = LPGENW("Protocol button"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_NAME; bbd.dwDefPos = 20; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20]; bbd.pwszTooltip = LPGENW("Info button"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_BOLD; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; bbd.pwszTooltip = LPGENW("Bold text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_ITALICS; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; bbd.pwszTooltip = LPGENW("Italic text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_UNDERLINE; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; bbd.pwszTooltip = LPGENW("Underlined text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTSTRIKEOUT; bbd.dwDefPos = 70; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15]; bbd.pwszTooltip = LPGENW("Strike-through text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDOK; bbd.dwDefPos = 10; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; bbd.pwszTooltip = LPGENW("Send message\nClick dropdown arrow for sending options"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_CLOSE; bbd.dwDefPos = 20; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; bbd.pwszTooltip = LPGENW("Close session"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_QUOTE; bbd.dwDefPos = 30; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; bbd.pwszTooltip = LPGENW("Quote last message OR selected text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_TIME; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; bbd.pwszTooltip = LPGENW("Message log options"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_HISTORY; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; bbd.pwszTooltip = LPGENW("View user's history"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_PIC; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; bbd.pwszTooltip = LPGENW("Edit user notes"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); // chat buttons bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISSEPARATOR; @@ -94,15 +94,15 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.dwDefPos = 35; bbd.hIcon = nullptr; bbd.pwszTooltip = nullptr; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = 2; bbd.dwDefPos = 22; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = 3; bbd.dwDefPos = 71; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_COLOR; @@ -110,32 +110,32 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.dwDefPos = 80; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14]; bbd.pwszTooltip = LPGENW("Select font color"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_BKGCOLOR; bbd.dwDefPos = 81; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; bbd.pwszTooltip = LPGENW("Change background color"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST; bbd.dwDefPos = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; bbd.pwszTooltip = LPGENW("Toggle nick list"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_FILTER; bbd.dwDefPos = 24; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; bbd.pwszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_CHANMGR; bbd.dwDefPos = 33; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; bbd.pwszTooltip = LPGENW("Channel manager"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp index af44648190..1dc5e20f7e 100644 --- a/plugins/TabSRMM/src/chat_main.cpp +++ b/plugins/TabSRMM/src/chat_main.cpp @@ -215,7 +215,7 @@ int Chat_Load() CheckUpdate();
Utils::RTF_CTableInit();
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER, g_plugin.m_hLang };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER, &g_plugin };
Chat_CustomizeApi(&data);
g_chatApi.OnCreateModule = OnCreateModule;
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 67390c9a5e..8802145baf 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -262,8 +262,8 @@ static IconItem _logicons[] = // add icons to the skinning module
void Chat_AddIcons(void)
{
- Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat windows"), _icons, _countof(_icons), 0, g_plugin.m_hLang);
- Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat log"), _logicons, _countof(_logicons), 0, g_plugin.m_hLang);
+ Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat windows"), _icons, _countof(_icons), 0, &g_plugin);
+ Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat log"), _logicons, _countof(_logicons), 0, &g_plugin);
g_chatApi.MM_IconsChanged();
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index fb456ab4f4..3eb99ed124 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1466,13 +1466,13 @@ int SI_InitStatusIcons() StatusIconData sid = {}; sid.szModule = MSG_ICON_MODULE; sid.dwId = MSG_ICON_SOUND; // Sounds - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = MSG_ICON_UTN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = MSG_ICON_SESSION; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_MSG_ICONSCHANGED, OnSrmmIconChanged); return 0; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 271d689adb..6edea54ef5 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -115,7 +115,7 @@ void CGlobals::reloadSystemModulesChanged() g_bPopupAvail = ServiceExists(MS_POPUP_ADDPOPUPT) != 0;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x58d8dc1, 0x1c25, 0x49c0, 0xb8, 0x7c, 0xa3, 0x22, 0x2b, 0x3d, 0xf1, 0xd8);
mi.position = -2000090000;
mi.flags = CMIF_DEFAULT;
@@ -294,7 +294,7 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM) if (nen_options.bTraySupport)
::CreateSystrayIcon(TRUE);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x9f68b822, 0xff97, 0x477d, 0xb7, 0x6d, 0xa5, 0x59, 0x33, 0x1c, 0x54, 0x40);
mi.position = -500050005;
mi.hIcolibItem = PluginConfig.g_iconContainer;
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index d2a1c1640b..6052e090d6 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -56,7 +56,7 @@ static int RegisterCustomButton(WPARAM, LPARAM) bbd.hIcon = PluginConfig.g_buttonBarIconHandles[3];
bbd.pszModuleName = "Tabmodplus";
bbd.pwszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 1d9615ebd8..e8cb510573 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -1329,7 +1329,6 @@ static int OptInitialise(WPARAM wParam, LPARAM lParam) g_plugin.addOptions(wParam, &odpnew);
OPTIONSDIALOGPAGE odp = {};
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS;
odp.position = 910000000;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 766c4121fa..6d4cb8bc9f 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -490,9 +490,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int TN_OptionsInitialize(WPARAM wParam, LPARAM)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TYPINGNOTIFYPOPUP);
odp.szTitle.a = LPGEN("Typing notify");
odp.szGroup.a = LPGEN("Popups");
@@ -531,7 +530,7 @@ int TN_ModuleInit() if (PluginConfig.g_bPopupAvail && ShowMenu) {
CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe18fd2cf, 0xcf90, 0x459e, 0xb6, 0xe6, 0x70, 0xec, 0xad, 0xc6, 0x73, 0xef);
if (!Disabled) {
mi.name.a = LPGEN("Disable &typing notification");
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 673b94426f..b2060654d7 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -2080,10 +2080,9 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_APPEARANCE);
odp.szTab.a = LPGEN("Appearance");
diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index 326d6ef369..e5e497fc03 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -46,7 +46,7 @@ void COptions::Enabled_OnChange(CCtrlCheck* chk) int OnOptionsInitialized(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = L"Popups"; //_T(MODULENAME);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.position = -790000000;
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 5e12e64a5b..ae03ca7685 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -255,9 +255,8 @@ int CTooltipNotify::ContactSettingChanged(WPARAM hContact, LPARAM lParam) int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szTitle.a = LPGEN("Tooltip Notify");
odp.szGroup.a = LPGEN("Popups");
diff --git a/plugins/TopToolBar/src/stdafx.h b/plugins/TopToolBar/src/stdafx.h index 44d4193d40..1b2cd4f566 100644 --- a/plugins/TopToolBar/src/stdafx.h +++ b/plugins/TopToolBar/src/stdafx.h @@ -84,7 +84,7 @@ struct TopButtonInt : public MZeroedObject LPARAM lParamDown;
WPARAM wParamDown;
- int hLangpack;
+ HPLUGIN pPlugin;
wchar_t *ptszTooltipUp, *ptszTooltipDn;
};
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index ae798838c2..da81db4300 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -309,7 +309,7 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) return -1;
TopButtonInt *b = CreateButton(but);
- b->hLangpack = (int)lParam;
+ b->pPlugin = (HPLUGIN)lParam;
b->LoadSettings();
b->CreateWnd();
if (b->hwnd == nullptr) {
@@ -553,13 +553,13 @@ int OnPluginLoad(WPARAM, LPARAM lParam) int OnPluginUnload(WPARAM, LPARAM lParam)
{
- int lang = GetPluginLangByInstance((HINSTANCE)lParam);
- if (lang) {
+ HPLUGIN pPlugin = &GetPluginByInstance((HINSTANCE)lParam);
+ if (pPlugin) {
bool bNeedUpdate = false;
mir_cslock lck(csButtonsHook);
for (auto &it : Buttons.rev_iter())
- if (it->hLangpack == lang) {
+ if (it->pPlugin == pPlugin) {
TTBRemoveButton(it->id, 0);
bNeedUpdate = true;
}
diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp index f9bf74a0fc..7a4c357ac7 100644 --- a/plugins/TopToolBar/src/topbutton.cpp +++ b/plugins/TopToolBar/src/topbutton.cpp @@ -171,6 +171,6 @@ void TopButtonInt::SetBitmap() pTooltip = ptszTooltipUp;
}
if (pTooltip)
- SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateW_LP(pTooltip, hLangpack), BATF_UNICODE);
+ SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateW_LP(pTooltip, pPlugin), BATF_UNICODE);
}
}
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index 226dc8d57a..45642f84dc 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -540,8 +540,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int TTBOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Contact list");
odp.position = -1000000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_BUTORDER);
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index cc01aa9724..37e6ac7a85 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -859,7 +859,7 @@ INT_PTR MenuCommand_TrafficShowHide(WPARAM, LPARAM) void Traffic_AddMainMenuItem(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x7fe75b30, 0x3cf6, 0x4280, 0xb9, 0xd2, 0x88, 0x6b, 0xbb, 0x69, 0xa3, 0x7e);
mi.position = -0x7FFFFFFF;
mi.hIcolibItem = nullptr;
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 00a17afbfe..1c7ce7688a 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -342,9 +342,8 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, int TrafficCounterOptInitialise(WPARAM wParam, LPARAM)
{
// Main options page
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 900000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TRAFFIC);
odp.szGroup.a = LPGEN("Services");
odp.szTab.a = LPGEN("Options");
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index 67dc807af9..eee021c5bd 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -91,21 +91,21 @@ int OnModulesLoaded(WPARAM, LPARAM) bbd.hIcon = iconList[0].hIcolib;
bbd.dwButtonID = 1;
bbd.dwDefPos = 30;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.pszModuleName = "Translit and Send";
bbd.pwszTooltip = TranslateT("Translit and Send");
bbd.hIcon = iconList[1].hIcolib;
bbd.dwButtonID = 1;
bbd.dwDefPos = 40;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.pszModuleName = "Invert Case and Send";
bbd.pwszTooltip = TranslateT("Invert Case and Send");
bbd.hIcon = iconList[2].hIcolib;
bbd.dwButtonID = 1;
bbd.dwDefPos = 50;
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 156ee338eb..1be4b8763f 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -67,7 +67,7 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) int CMPlugin::Load()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x6787c12d, 0xdc85, 0x409d, 0xaa, 0x6c, 0x1f, 0xfe, 0x5f, 0xe8, 0xc1, 0x18);
mi.position = 500000;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 972e4d5214..9d8f999db2 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -238,7 +238,7 @@ void SvcFlagsOnModulesLoaded() sid.szModule = MODNAMEFLAGS;
if (!g_bShowStatusIconFlag)
sid.flags = MBF_HIDDEN;
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index d1567bba69..fb895460cc 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -127,8 +127,7 @@ int CPsTree::AddDummyItem(LPCSTR pszGroup) psh._pPages = _pItems; psh._numPages = _numItems; - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_UNICODE; odp.szTitle.w = mir_utf8decodeW(pszGroup); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 2645b3f8d7..ff72aa2933 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -322,7 +322,7 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn // the item to insert brings along an icon?
if (odp->flags & ODPF_ICON) {
// is it uinfoex item?
- if (odp->hInstance == g_plugin.getInst()) {
+ if (odp->pPlugin == &g_plugin) {
// the pszGroup holds the iconfile for items added by uinfoex
sid.defaultFile.w = odp->szGroup.w;
@@ -383,9 +383,9 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) wchar_t szTitle[ MAXSETTING ];
// check parameter
- if (pPsh && pPsh->_dwSize == sizeof(CPsHdr) && odp && PtrIsValid(odp->hInstance)) {
+ if (pPsh && pPsh->_dwSize == sizeof(CPsHdr) && odp && PtrIsValid(odp->pPlugin)) {
// instance value
- _hInst = odp->hInstance;
+ _hInst = odp->pPlugin->getInst();
_dwFlags = odp->flags;
_initParam = odp->dwInitParam;
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index d0c212c04b..55a471a088 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -505,8 +505,7 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) if (!(pPsh->_dwFlags & PSF_PROTOPAGESONLY)) {
BYTE bChangeDetailsEnabled = myGlobals.CanChangeDetails && db_get_b(NULL, MODULENAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
if (lParam || bChangeDetailsEnabled) {
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_ICON | ODPF_UNICODE;
odp.szGroup.w = IcoLib_GetDefaultIconFileName();
diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 75532fdfd8..157d7fcc1a 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -83,7 +83,7 @@ void RebuildContact() RemoveMenuItems(hMenuItem, _countof(hMenuItem));
// support new genmenu style
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
switch (flag) {
@@ -176,7 +176,7 @@ void RebuildMain() RemoveMenuItems(hMenuItem, _countof(hMenuItem));
// support new genmenu style
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
switch (flag) {
case 3:
@@ -313,7 +313,7 @@ void RebuildGroup() char text[200];
mir_strcpy(text, "UserInfo");
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = text;
switch (flag) {
@@ -404,7 +404,7 @@ void RebuildSubGroup() char text[200];
mir_strcpy(text, "UserInfo");
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = text;
char* tDest = text + mir_strlen(text);
@@ -520,7 +520,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) char text[200];
mir_strcpy(text, it->szProto);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = text;
char* tDest = text + mir_strlen(text);
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index e37239af27..e8e6e9fd9c 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -1028,9 +1028,8 @@ static int OnInitOptions(WPARAM wParam, LPARAM) {
DlgContactInfoInitTreeIcons();
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 95400;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.a = MODULELONGNAME;
odp.szGroup.a = LPGEN("Contacts");
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 2d3960017b..8d7d7c4952 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -183,7 +183,7 @@ void SvcEMailRebuildMenu() if (!ghMenuItem) {
// insert contact menuitem
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x61d8e25a, 0x92e, 0x4470, 0x84, 0x57, 0x5e, 0x52, 0x17, 0x7f, 0xfa, 0x3);
mi.position = -2000010000;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EMAIL);
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 12e3e33b4a..dbf32d5f67 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -153,7 +153,7 @@ void SvcHomepageRebuildMenu() if (!ghMenuItem) {
// insert contact menuitem
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xdb78c16e, 0x50db, 0x4a40, 0x80, 0x0, 0xd1, 0xa4, 0x1c, 0x1b, 0xa3, 0x2d);
mi.position = -2000010000;
mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_GOTO);
diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index 0b22ba13ca..8a528b39b8 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -129,12 +129,11 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA int OptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.position = 150000000;
odp.szGroup.a = LPGEN("Services");
odp.szTitle.a = LPGEN("Variables");
- odp.hInstance = g_plugin.getInst();
odp.pfnDlgProc = SetOptsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS_DIALOG);
g_plugin.addOptions(wParam, &odp);
diff --git a/plugins/Watrack/i_opt_dlg.inc b/plugins/Watrack/i_opt_dlg.inc index ad1f576fe4..53f4c578ce 100644 --- a/plugins/Watrack/i_opt_dlg.inc +++ b/plugins/Watrack/i_opt_dlg.inc @@ -21,7 +21,6 @@ begin FillChar(odp,SizeOf(odp),0);
odp.Position :=900003000;
- odp.hInstance :=hInstance;
odp.szTitle.a :=PluginName;
odp.szGroup.a :='Plugins';
diff --git a/plugins/Watrack/kolframe/kolframe.pas b/plugins/Watrack/kolframe/kolframe.pas index c8e33ce408..e3255c8f8c 100644 --- a/plugins/Watrack/kolframe/kolframe.pas +++ b/plugins/Watrack/kolframe/kolframe.pas @@ -223,7 +223,7 @@ begin end;
FrameHeight:=CLFrame.height;
- PWATFrameData(FrameCtrl.CustomData).FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,twparam(@CLFrame),0);
+ PWATFrameData(FrameCtrl.CustomData).FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,twparam(@CLFrame),lparam(@g_Plugin));
if PWATFrameData(FrameCtrl.CustomData).FrameId>=0 then
begin
plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus);
diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas index f7b4b98da5..604436c835 100644 --- a/plugins/Watrack/popup/popups.pas +++ b/plugins/Watrack/popup/popups.pas @@ -350,7 +350,6 @@ begin FillChar(odp,SizeOf(odp),0);
odp.flags :=ODPF_BOLDGROUPS;
odp.Position :=900003000;
- odp.hInstance :=hInstance;
odp.szTitle.a :=PluginName;
odp.szGroup.a :='Popups';
diff --git a/plugins/Watrack/version.RES b/plugins/Watrack/version.RES Binary files differnew file mode 100644 index 0000000000..3c8432b9e9 --- /dev/null +++ b/plugins/Watrack/version.RES diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 652e2766a7..93bcefa620 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -54,7 +54,7 @@ private: int WaMpdOptInit(WPARAM wParam,LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = LPGENW("Winamp Track"); odp.szGroup.w = LPGENW("Plugins"); odp.szTab.w = LPGENW("Watrack MPD"); diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index ae739f5012..4a4beb67d1 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -570,10 +570,8 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l // register the weather option pages
int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
-
// plugin options
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 95600;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pfnDlgProc = OptionsProc;
diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 6b7cd2c6fe..6a3351c463 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -262,7 +262,7 @@ INT_PTR MenuitemNotifyCmd(WPARAM, LPARAM) // copied and modified form "modified MSN Protocol"
void AddMenuItems(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
// contact menu
SET_UID(mi, 0x266ef52b, 0x869a, 0x4cac, 0xa9, 0xf8, 0xea, 0x5b, 0xb8, 0xab, 0xe0, 0x24);
diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index 442be8a388..b535e6cfa8 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -313,8 +313,7 @@ static INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // lParam = current contact
int UserInfoInit(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
odp.szTitle.a = WEATHERPROTONAME;
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 2c7d70ec58..4bbbe80c61 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -126,7 +126,7 @@ int CMPlugin::Load() //value is 1 if menu is disabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
if ( db_get_b(NULL, MODULENAME, MENU_OFF, 0)) {
//value is 0 if menu is enabled
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index f384f48132..7ec393d3fc 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -290,8 +290,7 @@ void CALLBACK Countdownfunc(HWND, UINT, UINT_PTR, DWORD) static int OptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT);
odp.szGroup.a = LPGEN("Network");
odp.szTitle.a = MODULENAME;
diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index e97f7fcab9..fe56baa9f4 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -68,7 +68,7 @@ int CMPlugin::Load() hAddBirthdayWndsList = WindowList_Create();
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 10000000;
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Birthdays (When Was It)"), mi.position);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "95D842AE-FCCE-43C9-87E3-C28546B7E00E");
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 3d3065c969..7320a42530 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -42,9 +42,8 @@ static int OnTopToolBarModuleLoaded(WPARAM, LPARAM) static int OnOptionsInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WWI);
odp.szTitle.w = LPGENW("Birthdays");
odp.szGroup.w = LPGENW("Contacts");
diff --git a/plugins/WhoUsesMyFiles/src/options.cpp b/plugins/WhoUsesMyFiles/src/options.cpp index 59b37d4d6b..a552d7cb6e 100644 --- a/plugins/WhoUsesMyFiles/src/options.cpp +++ b/plugins/WhoUsesMyFiles/src/options.cpp @@ -268,9 +268,8 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 945000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = LPGEN("Who uses my files"); odp.pfnDlgProc = OptionsDlgProc; diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index fce2633623..2ebbb5f7ef 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -223,7 +223,7 @@ int CMPlugin::Load() CreateServiceFunction(MS_WUMF_SWITCHPOPUP, WumfMenuCommand);
CreateServiceFunction(MS_WUMF_CONNECTIONSSHOW, WumfShowConnections);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xcfce6487, 0x907b, 0x4822, 0xb0, 0x49, 0x18, 0x4e, 0x47, 0x17, 0x0, 0x69);
mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 1999990000);
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index c9643147f5..86f79301ab 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -69,8 +69,7 @@ int protocolAck(WPARAM, LPARAM lParam) int dialogOptionsInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Speak");
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index e1d5148edc..32e14c5569 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -342,9 +342,8 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l INT OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.szGroup.w = LPGENW("Sounds");
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index d8713148ce..bb7e1ecb2f 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -201,7 +201,7 @@ static int OnPlaySound(WPARAM, LPARAM) static int OnLoadInit(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x5d72ca1f, 0xc52, 0x436d, 0x81, 0x47, 0x29, 0xf6, 0xc3, 0x28, 0xb5, 0xd1);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 739ba30a83..f40bc54a1e 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -122,7 +122,7 @@ void CheckMenuItems() int SystemModulesLoaded(WPARAM, LPARAM) { //Insert "Check mail (YAMN)" item to Miranda's menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xa01ff3d9, 0x53cb, 0x4406, 0x85, 0xd9, 0xf1, 0x90, 0x3a, 0x94, 0xed, 0xf4); mi.position = 0xb0000000; diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 3842602582..8516144847 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -153,8 +153,7 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) int YAMNOptInitSvc(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Network");
odp.szTitle.a = LPGEN("YAMN");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/YAPP/src/notify_imp.cpp b/plugins/YAPP/src/notify_imp.cpp index ed7d92bdc2..f714fd9f67 100644 --- a/plugins/YAPP/src/notify_imp.cpp +++ b/plugins/YAPP/src/notify_imp.cpp @@ -94,8 +94,7 @@ INT_PTR CALLBACK DlgProcPopups(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) int NotifyOptionsInitialize(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFY);
odp.szTitle.a = LPGEN("YAPP Popups");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index a3538a7969..ac6877707c 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -472,10 +472,9 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.a = LPGEN("Popups");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT1);
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 28b10abc35..041ef7d85a 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -165,7 +165,7 @@ static void InitMenuItems(void) hMenuRoot = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 500010000, IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0));
Menu_ConfigureItem(hMenuRoot, MCI_OPT_UID, "043A641A-2767-4C57-AA57-9233D6F9DC54");
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = hMenuRoot;
diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 4855369189..5082c2f6bd 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -191,8 +191,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, int OptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1;
odp.szGroup.a = LPGEN("Message sessions");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS);
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 78c3aa0f05..eacb760c32 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -85,7 +85,7 @@ static INT_PTR NoSoundMenuCommand(WPARAM, LPARAM) int CMPlugin::Load()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x6bd635eb, 0xc4bb, 0x413b, 0xb9, 0x3, 0x81, 0x6d, 0x8f, 0xf1, 0x9b, 0xb0);
mi.position = -0x7FFFFFFF;
mi.flags = CMIF_UNICODE;
diff --git a/plugins/ZeroNotification/src/options.cpp b/plugins/ZeroNotification/src/options.cpp index efb190cb4f..ba4970f54b 100644 --- a/plugins/ZeroNotification/src/options.cpp +++ b/plugins/ZeroNotification/src/options.cpp @@ -127,9 +127,8 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA int OptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_UNICODE; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOSOUND); odp.szTitle.w = LPGENW("Zero Notifications"); diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index a48d987989..5146b57adc 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -622,7 +622,6 @@ begin FillChar(odp,SizeOf(odp),0);
odp.flags :=ODPF_BOLDGROUPS;
odp.Position :=900003000;
- odp.hInstance :=hInstance;
odp.szGroup.a :='Network';
odp.szTitle.a :=PluginName;
diff --git a/plugins/mRadio/rframeapi.pas b/plugins/mRadio/rframeapi.pas index c0cc1702bc..94d5438ea5 100644 --- a/plugins/mRadio/rframeapi.pas +++ b/plugins/mRadio/rframeapi.pas @@ -227,7 +227,7 @@ begin TBName.w:=TranslateW(cPluginName + ' volume control');
end;
- FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),0);
+ FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),lparam(@g_Plugin));
if FrameId>=0 then
begin
CallService(MS_CLIST_FRAMES_UPDATEFRAME,FrameId, FU_FMPOS);
diff --git a/plugins/mRadio/version.RES b/plugins/mRadio/version.RES Binary files differnew file mode 100644 index 0000000000..b130578b35 --- /dev/null +++ b/plugins/mRadio/version.RES diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index fa35231f73..4e2cb3f448 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -409,9 +409,8 @@ xxx: int OptionsInit(WPARAM wparam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 150000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1);
odp.szGroup.w = LPGENW("Plugins");
odp.szTitle.w = LPGENW("OSD");
diff --git a/protocols/Discord/src/groupchat.cpp b/protocols/Discord/src/groupchat.cpp index 2c4b177313..942100d58a 100644 --- a/protocols/Discord/src/groupchat.cpp +++ b/protocols/Discord/src/groupchat.cpp @@ -61,7 +61,7 @@ int CDiscordProto::GroupchatMenuHook(WPARAM, LPARAM lParam) return 0; if (gcmi->Type == MENU_ON_LOG) - Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, g_plugin.m_hLang); + Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, &g_plugin); return 0; } diff --git a/protocols/Discord/src/menus.cpp b/protocols/Discord/src/menus.cpp index 6fb53b5aa4..2cd87eef15 100644 --- a/protocols/Discord/src/menus.cpp +++ b/protocols/Discord/src/menus.cpp @@ -89,7 +89,7 @@ int CDiscordProto::OnMenuPrebuild(WPARAM hContact, LPARAM) void CDiscordProto::InitMenus() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = Menu_GetProtocolRoot(this); mi.flags = CMIF_UNMOVABLE; @@ -109,7 +109,7 @@ void CDiscordProto::InitMenus() Menu_AddProtoMenuItem(&mi, m_szModuleName); // Contact menu items - CMenuItem mi2(g_plugin); + CMenuItem mi2(&g_plugin); mi2.pszService = "/LeaveGuild"; CreateProtoService(mi2.pszService, &CDiscordProto::OnMenuLeaveGuild); mi2.name.a = LPGEN("Leave guild"); diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp index 04947f76e2..165535591c 100644 --- a/protocols/Discord/src/options.cpp +++ b/protocols/Discord/src/options.cpp @@ -70,7 +70,7 @@ INT_PTR CDiscordProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent) int CDiscordProto::OnOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = m_tszUserName; odp.flags = ODPF_UNICODE; odp.szGroup.w = LPGENW("Network"); diff --git a/protocols/EmLanProto/src/amdproto.cpp b/protocols/EmLanProto/src/amdproto.cpp index 61e215590c..b642120741 100644 --- a/protocols/EmLanProto/src/amdproto.cpp +++ b/protocols/EmLanProto/src/amdproto.cpp @@ -273,9 +273,8 @@ INT_PTR CALLBACK EMPDlgProcMainOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR int __cdecl EMPCreateOptionsDlg(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_EMP_FORM_OPT);
odp.szTitle.a = LPGEN("E-mage LAN protocol");
odp.szGroup.a = LPGEN("Network");
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 077a6b4113..54d6309dfe 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -339,9 +339,9 @@ int FacebookProto::OnGCMenuHook(WPARAM, LPARAM lParam) return 0; if (gcmi->Type == MENU_ON_LOG) - Chat_AddMenuItems(gcmi->hMenu, _countof(LogMenuItems), LogMenuItems, g_plugin.m_hLang); + Chat_AddMenuItems(gcmi->hMenu, _countof(LogMenuItems), LogMenuItems, &g_plugin); else if (gcmi->Type == MENU_ON_NICKLIST) - Chat_AddMenuItems(gcmi->hMenu, _countof(NickMenuItems), NickMenuItems, g_plugin.m_hLang); + Chat_AddMenuItems(gcmi->hMenu, _countof(NickMenuItems), NickMenuItems, &g_plugin); return 0; } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 87e5980b7d..0f975b148a 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -414,8 +414,7 @@ void FacebookProto::OnShutdown() int FacebookProto::OnOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = m_tszUserName; odp.dwInitParam = LPARAM(this); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index ec95b927b0..20f70136b9 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -95,7 +95,7 @@ void InitContactMenus() {
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x4f006492, 0x9fe5, 0x4d10, 0x88, 0xce, 0x47, 0x53, 0xba, 0x27, 0xe9, 0xc9);
mi.position = -2000006000;
@@ -193,7 +193,7 @@ int FacebookProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) void FacebookProto::OnBuildProtoMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 201001;
mi.root = Menu_GetProtocolRoot(this);
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 2f214dc9ce..64cbbea445 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -693,10 +693,9 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, // int GaduProto::options_init(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_UNICODE; odp.position = 1003000; - odp.hInstance = g_plugin.getInst(); odp.szGroup.w = LPGENW("Network"); odp.szTitle.w = m_tszUserName; odp.dwInitParam = (LPARAM)this; @@ -745,9 +744,8 @@ int GaduProto::details_init(WPARAM wParam, LPARAM lParam) pszTemplate = MAKEINTRESOURCEA(IDD_INFO_GG); } - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_DONTTRANSLATE | ODPF_UNICODE; - odp.hInstance = g_plugin.getInst(); odp.pfnDlgProc = gg_detailsdlgproc; odp.position = -1900000000; odp.pszTemplate = pszTemplate; diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 848f5ba2f0..1910f7b305 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -247,7 +247,7 @@ INT_PTR GaduProto::blockuser(WPARAM hContact, LPARAM) //
void GaduProto::block_init()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
mi.position = -500050000;
mi.hIcolibItem = iconList[8].hIcolib;
@@ -273,7 +273,7 @@ void GaduProto::OnBuildProtoMenu() {
HGENMENU hRoot = Menu_GetProtocolRoot(this);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = hRoot;
mi.flags = CMIF_UNICODE;
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index b3124c832c..44e061dc72 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -54,7 +54,7 @@ int GaduProto::gc_init() void GaduProto::gc_menus_init(HGENMENU hRoot)
{
if (gc_enabled) {
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = hRoot;
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index ad8e4ed499..af471b45f3 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -69,7 +69,7 @@ int gg_img_remove(GGIMAGEDLGDATA *dat); int GaduProto::img_init()
{
// Send image contact menu item
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xab238938, 0xed85, 0x4cfe, 0x93, 0xb5, 0xb8, 0x83, 0xf4, 0x32, 0xa0, 0xec);
mi.position = -2000010000;
mi.hIcolibItem = iconList[11].hIcolib;
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 86cb6d6678..e461b82906 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -535,7 +535,7 @@ INT_PTR GaduProto::export_server(WPARAM, LPARAM) //
void GaduProto::import_init(HGENMENU hRoot)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = hRoot;
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp index c8fb37df03..7c84a58e56 100644 --- a/protocols/Gadu-Gadu/src/links.cpp +++ b/protocols/Gadu-Gadu/src/links.cpp @@ -97,7 +97,7 @@ void gg_links_instancemenu_init() CreateServiceFunction(GGS_MENUCHOOSE, gg_menuchoose);
hInstanceMenu = Menu_AddObject("GGAccountChooser", LPGEN("Gadu-Gadu account chooser"), nullptr, GGS_MENUCHOOSE);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.name.a = "Cancel";
mi.position = 9999999;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
@@ -115,7 +115,7 @@ void gg_links_init() void GaduProto::links_instance_init()
{
if (ServiceExists(MS_ASSOCMGR_ADDNEWURLTYPE)) {
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.position = CMPlugin::g_arInstances.getCount();
mi.name.w = m_tszUserName;
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index 88718c94a1..6d7ae4893e 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -418,7 +418,7 @@ BOOL GaduProto::sessions_closedlg() void GaduProto::sessions_menus_init(HGENMENU hRoot)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = hRoot;
diff --git a/protocols/ICQCorp/src/options.cpp b/protocols/ICQCorp/src/options.cpp index 976ceb6567..380daf9b49 100644 --- a/protocols/ICQCorp/src/options.cpp +++ b/protocols/ICQCorp/src/options.cpp @@ -72,7 +72,6 @@ int icqOptionsInitialise(WPARAM wParam, LPARAM) odp.szTitle.a = protoName;
odp.pfnDlgProc = icqOptionsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQCORP);
- odp.hInstance = g_plugin.getInst();
odp.szGroup.a = LPGEN("Network");
odp.flags = ODPF_BOLDGROUPS;
g_plugin.addOptions(wParam, &odp);
diff --git a/protocols/ICQCorp/src/user.cpp b/protocols/ICQCorp/src/user.cpp index 48ad3b84b1..1b83e518cf 100644 --- a/protocols/ICQCorp/src/user.cpp +++ b/protocols/ICQCorp/src/user.cpp @@ -150,12 +150,11 @@ int icqUserInfoInitialise(WPARAM wParam, LPARAM lParam) if ((proto == nullptr || mir_strcmp(proto, protoName)) && lParam)
return 0;
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1900000000;
odp.szTitle.a = protoName;
odp.pfnDlgProc = icqUserInfoDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQCORP);
- odp.hInstance = g_plugin.getInst();
g_plugin.addUserInfo(wParam, &odp);
return 0;
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index e84d0d00e2..a1ae6248a0 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -1639,7 +1639,7 @@ void CIgnorePrefsDlg::UpdateList() int CIrcProto::OnInitOptionsPages(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = m_tszUserName;
odp.szGroup.w = LPGENW("Network");
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index d3d2caedbf..01824a8e25 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void CIrcProto::OnBuildProtoMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolRoot(this);
mi.name.a = LPGEN("&Quick connect");
@@ -104,7 +104,7 @@ void InitContactMenus(void) char temp[MAXMODULELABELLENGTH];
char *d = temp + mir_snprintf(temp, "IRC");
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = temp;
SET_UID(mi, 0x5f01196f, 0xfbcd, 0x4034, 0xbd, 0x90, 0x12, 0xa0, 0x20, 0x68, 0x15, 0xc0);
@@ -796,7 +796,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) if (!mir_strcmpi(gcmi->pszModule, m_szModuleName)) {
if (gcmi->Type == MENU_ON_LOG) {
if (mir_wstrcmpi(gcmi->pszID, SERVERWINDOW))
- Chat_AddMenuItems(gcmi->hMenu, _countof(logItems), logItems, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(logItems), logItems, &g_plugin);
}
if (gcmi->Type == MENU_ON_NICKLIST) {
@@ -829,7 +829,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) nickItems[7].bDisabled = nickItems[8].bDisabled = nickItems[9].bDisabled = nickItems[10].bDisabled = !(bForceEnable || bOwner);
nickItems[11].bDisabled = nickItems[12].bDisabled = nickItems[13].bDisabled = nickItems[14].bDisabled = !(bForceEnable || bOp || bAdmin || bOwner);
- Chat_AddMenuItems(gcmi->hMenu, _countof(nickItems), nickItems, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(nickItems), nickItems, &g_plugin);
}
}
}
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp index 2e36ef5f22..fc50e5ae56 100644 --- a/protocols/IRCG/src/userinfo.cpp +++ b/protocols/IRCG/src/userinfo.cpp @@ -208,11 +208,10 @@ int __cdecl CIrcProto::OnInitUserInfo(WPARAM wParam, LPARAM lParam) db_free(&dbv);
}
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_DONTTRANSLATE;
odp.szTitle.a = m_szModuleName;
odp.dwInitParam = (LPARAM)this;
- odp.hInstance = g_plugin.getInst();
odp.position = -1900000000;
odp.pfnDlgProc = UserDetailsDlgProc;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO);
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index 1a017715ca..b523706b61 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -70,7 +70,7 @@ void g_MenuInit(void) char str[MAXMODULELABELLENGTH], *pszDest = str + 3;
mir_strcpy(str, "ICQ");
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = str;
// "Add to server list"
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp index 19505a40ad..8296a7e415 100644 --- a/protocols/IcqOscarJ/src/icq_opts.cpp +++ b/protocols/IcqOscarJ/src/icq_opts.cpp @@ -505,9 +505,8 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -800000000;
- odp.hInstance = g_plugin.getInst();
odp.szGroup.w = LPGENW("Network");
odp.dwInitParam = LPARAM(this);
odp.szTitle.w = m_tszUserName;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index bfbcc971d2..365d39b586 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -854,14 +854,14 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) wchar_t szItem[MAX_PATH + 64];
mir_snwprintf(szItem, TranslateT("%s Custom Status"), m_tszUserName);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolMenu(m_szModuleName);
mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 2000040000;
mi.root = hRoot;
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp index 61622da7a0..ccdca580fe 100644 --- a/protocols/IcqOscarJ/src/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -268,9 +268,8 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if ((!IsICQContact(lParam)) && lParam)
return 0;
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_UNICODE | ODPF_DONTTRANSLATE;
- odp.hInstance = g_plugin.getInst();
odp.dwInitParam = LPARAM(this);
odp.pfnDlgProc = IcqDlgProc;
odp.position = -1900000000;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 7220bab19c..d587c3a03b 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -540,7 +540,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) if (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE)
sttSetupGcMenuItem(_countof(sttLogListItems), sttLogListItems, IDM_BOOKMARKS, FALSE);
}
- Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, &g_plugin);
}
else if (gcmi->Type == MENU_ON_NICKLIST) {
static DWORD sttRJidItems[] = { IDM_RJID_VCARD, IDM_RJID_ADD, IDM_RJID_COPY, 0 };
@@ -615,7 +615,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) sttListItems[2].uType = 0;
sttShowGcMenuItems(_countof(sttListItems), sttListItems, sttRJidItems, 0);
}
- Chat_AddMenuItems(gcmi->hMenu, _countof(sttListItems), sttListItems, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(sttListItems), sttListItems, &g_plugin);
}
return 0;
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index b4b07af1d3..e012929c0e 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -126,7 +126,7 @@ void CIconPool::RegisterIcon(const char *name, wchar_t *filename, int iconid, wc sid.description.w = szDescription;
sid.flags = SIDF_ALL_UNICODE;
sid.iDefaultIndex = iconid;
- item->m_hIcolibItem = IcoLib_AddIcon(&sid, g_plugin.m_hLang);
+ item->m_hIcolibItem = IcoLib_AddIcon(&sid, &g_plugin);
m_items.insert(item);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 7f5360de00..c75b40b146 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -152,7 +152,7 @@ void g_MenuInit(void) hChooserMenu = Menu_AddObject("JabberAccountChooser", LPGEN("Jabber account chooser"), nullptr, "Jabber/MenuChoose");
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.name.a = "Cancel";
mi.position = 9999999;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
@@ -162,7 +162,7 @@ void g_MenuInit(void) //////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNMOVABLE;
// "Convert Chat/Contact"
@@ -370,7 +370,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) }
char text[256];
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_SYSTEM;
mi.pszService = text;
@@ -530,7 +530,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) void CJabberProto::OnBuildProtoMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = m_hMenuRoot = Menu_GetProtocolRoot(this);
mi.flags = CMIF_UNMOVABLE;
@@ -659,7 +659,7 @@ void CJabberProto::BuildPriorityMenu() if (m_hMenuPriorityRoot)
Menu_RemoveItem(m_hMenuPriorityRoot);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = nullptr;
mi.position = 200006;
mi.root = m_hMenuRoot;
@@ -729,7 +729,7 @@ void CJabberProto::GlobalMenuInit() //////////////////////////////////////////////////////////////////////////////////////
// Account chooser menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = iChooserMenuPos++;
mi.name.w = m_tszUserName;
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 47f6f7f8f8..9709694180 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1498,7 +1498,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRosterControl(WPARAM, LPARAM) int CJabberProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.w = LPGENW("Network");
odp.szTitle.w = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index c7a7325a95..9a174b65fd 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2092,7 +2092,7 @@ INT_PTR __cdecl CJabberProto::menuSetPrivacyList(WPARAM, LPARAM, LPARAM iList) void CJabberProto::BuildPrivacyMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 200005;
mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
mi.flags = CMIF_UNMOVABLE | CMIF_HIDDEN;
@@ -2122,7 +2122,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) char srvFce[MAX_PATH + 64];
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 2000040000;
mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
mi.root = m_hPrivacyMenuRoot;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 3f56ab5e9e..424800517d 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -287,7 +287,7 @@ void CJabberProto::OnModulesLoaded() sid.hIcon = LoadIconEx("main");
sid.flags = MBF_HIDDEN;
sid.szTooltip = LPGEN("Jabber Resource");
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
HookProtoEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick);
HookProtoEvent(ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 7aa1c6adba..354ef9d9c4 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -821,8 +821,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_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.dwInitParam = (LPARAM)this; odp.pfnDlgProc = JabberUserInfoDlgProc; diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 09fb8bcd3d..b1c2244b2c 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -1178,8 +1178,7 @@ void CJabberProto::OnUserInfoInit_VCard(WPARAM wParam, LPARAM) m_bPhotoChanged = FALSE;
m_szPhotoFileName[0] = 0;
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
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 5ff0f13e07..8530452f9a 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -470,7 +470,7 @@ void CPepGuiService::RebuildMenu() char szService[128];
mir_snprintf(szService, "/AdvStatusSet/%s", m_name);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = hJabberRoot;
mi.pszService = szService;
mi.position = 200010;
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index b54fa0cc79..e6d20a55a0 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -127,10 +127,9 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR int CMraProto::OnPopupOptInit(WPARAM wParam, LPARAM)
{
if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.dwInitParam = (LPARAM)this;
odp.position = 100000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS);
odp.szTitle.w = m_tszUserName;
odp.szGroup.w = LPGENW("Popups");
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index f06dab8f5d..4b72f0f850 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -283,14 +283,14 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) wchar_t szItem[MAX_PATH + 64];
mir_snwprintf(szItem, L"%s Custom Status", m_tszUserName);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolMenu(m_szModuleName);
mi.name.w = szItem;
mi.position = 10001;
hRoot = Menu_AddStatusMenuItem(&mi, m_szModuleName);
}
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.position = 2000060000;
mi.root = hRoot;
mi.flags = CMIF_UNICODE;
@@ -331,7 +331,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI char szServiceFunction[MAX_PATH];
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
HGENMENU hRootMenu, (__stdcall *fnAddFunc)(TMO_MenuItem*, const char*);
if (bIsMain) {
diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index 2010c0846a..d1d36a3fef 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -213,9 +213,8 @@ INT_PTR CALLBACK DlgProcOptsConnections(HWND hWndDlg, UINT msg, WPARAM wParam, L int CMraProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.dwInitParam = (LPARAM)this;
- odp.hInstance = g_plugin.getInst();
odp.szTitle.w = m_tszUserName;
odp.szGroup.w = LPGENW("Network");
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 02979b22a0..4278ebc8c0 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -558,7 +558,7 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam) { LPGENW("&Invite user..."), 10, MENU_ITEM, FALSE },
{ LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE }
};
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
}
else if (gcmi->Type == MENU_ON_NICKLIST) {
char *email = mir_u2a(gcmi->pszUID);
@@ -570,7 +570,7 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam) { L"", 100, MENU_SEPARATOR, FALSE },
{ LPGENW("&Leave chat session"), 110, MENU_ITEM, FALSE }
};
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
}
else {
static struct gc_item Items[] =
@@ -590,7 +590,7 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam) if (pszRole && !mir_wstrcmpi(pszRole, L"admin"))
Items[3].pszDesc = LPGENW("&Deop user");
}
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
}
mir_free(email);
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index bcafc431b8..39fdb52c77 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -141,7 +141,7 @@ int CMsnProto::OnContactDoubleClicked(WPARAM hContact, LPARAM) // Menus initialization
void CMsnProto::OnBuildProtoMenu(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolRoot(this);
mi.pszService = MSN_INVITE;
@@ -225,7 +225,7 @@ void MSN_InitContactMenu(void) mir_strcpy(servicefunction, "MSN");
char* tDest = servicefunction + mir_strlen(servicefunction);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.pszService = servicefunction;
SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 0a45df570a..5f2f881d1c 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -591,9 +591,8 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int CMsnProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSN);
odp.szTitle.w = m_tszUserName;
odp.szGroup.w = LPGENW("Network");
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 1b003d37c1..5ae53dab59 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -157,8 +157,7 @@ void OmegleProto::OnShutdown() int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 9a5b6050a0..dee5e9e5a7 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -443,7 +443,7 @@ void CSametimeProto::InitConferenceMenu() CreateProtoService(MS_SAMETIME_MENULEAVECHAT, &CSametimeProto::onMenuLeaveChat);
CreateProtoService(MS_SAMETIME_MENUCREATECHAT, &CSametimeProto::onMenuCreateChat);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE;
SET_UID(mi, 0x98cf8a8c, 0x75ba, 0x46f2, 0xa3, 0x35, 0x65, 0x46, 0x4a, 0x38, 0x20, 0x7d);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index 95642e983a..aec8816c18 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -341,9 +341,8 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA int CSametimeProto::OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTNET);
odp.szTitle.w = m_tszUserName;
odp.szGroup.w = LPGENW("Network");
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 7e8913563f..686f5e889d 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -571,7 +571,7 @@ void CSametimeProto::InitSessionMenu() CreateProtoService(MS_SAMETIME_MENUANNOUNCESESSION, &CSametimeProto::SessionAnnounce);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.position = 2000060000;
mi.name.w = LPGENW("Send announcement...");
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index b19d812c29..83b851aa5f 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -577,7 +577,7 @@ int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam) { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE },
{ LPGENW("&Change topic..."), 30, MENU_ITEM, FALSE }
};
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
}
else if (gcmi->Type == MENU_ON_NICKLIST) {
static const struct gc_item Items[] =
@@ -589,7 +589,7 @@ int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam) { LPGENW("&User"), 40, MENU_POPUPITEM },
{ LPGENW("Change nick..."), 50, MENU_ITEM },
};
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
}
return 0;
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp index 7b16743df0..58c036f47f 100644 --- a/protocols/SkypeWeb/src/skype_menus.cpp +++ b/protocols/SkypeWeb/src/skype_menus.cpp @@ -58,7 +58,7 @@ void CSkypeProto::InitMenus() //hChooserMenu = Menu_AddObject("SkypeAccountChooser", LPGEN("Skype menu chooser"), 0, "Skype/MenuChoose");
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.pszService = MODULE"/GetHistory";
@@ -88,7 +88,7 @@ void CSkypeProto::InitMenus() void CSkypeProto::OnBuildProtoMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolRoot(this);
mi.pszService = "/CreateNewChat";
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp index 7e689c427f..61872dd5ca 100644 --- a/protocols/SkypeWeb/src/skype_options.cpp +++ b/protocols/SkypeWeb/src/skype_options.cpp @@ -72,7 +72,6 @@ bool CSkypeOptionsMain::OnApply() int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.hInstance = g_plugin.getInst();
odp.szTitle.w = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.szGroup.w = LPGENW("Network");
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index 6689ef0acc..91feead56a 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -116,7 +116,7 @@ int CSteamProto::PrebuildContactMenu(WPARAM hContact, LPARAM lParam) void CSteamProto::OnInitStatusMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
@@ -134,7 +134,7 @@ void CSteamProto::InitMenus() //////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
// "Block"
diff --git a/protocols/Steam/src/steam_options.cpp b/protocols/Steam/src/steam_options.cpp index 74c51a82c5..9f2e996286 100644 --- a/protocols/Steam/src/steam_options.cpp +++ b/protocols/Steam/src/steam_options.cpp @@ -78,8 +78,7 @@ void CSteamOptionsBlockList::OnBlock(CCtrlButton*) int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.szGroup.w = LPGENW("Network");
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 4fd148e394..298f9256a7 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -351,7 +351,6 @@ int CToxProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (szProto != nullptr && !mir_strcmp(szProto, m_szModuleName)) {
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.flags = ODPF_UNICODE | ODPF_DONTTRANSLATE;
- odp.hInstance = g_plugin.getInst();
odp.dwInitParam = (LPARAM)this;
odp.szTitle.w = m_tszUserName;
diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp index baebefe14a..7e6313aadf 100644 --- a/protocols/Tox/src/tox_menus.cpp +++ b/protocols/Tox/src/tox_menus.cpp @@ -46,7 +46,7 @@ int CToxProto::UpdateStatusMenu(WPARAM, LPARAM) void CToxProto::OnBuildProtoMenu()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.root = Menu_GetProtocolRoot(this);
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index ef923e6fef..1d74a5fadc 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -554,7 +554,7 @@ bool CToxOptionsNodeList::OnApply() int CToxProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = m_tszUserName;
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.szGroup.w = LPGENW("Network");
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 92bf8cd33a..b09db7ed71 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -219,7 +219,7 @@ INT_PTR TwitterProto::VisitHomepage(WPARAM wParam, LPARAM) int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolRoot(this);
mi.flags = CMIF_UNICODE;
mi.position = 1001;
@@ -238,9 +238,8 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM) int TwitterProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 271828;
- odp.hInstance = g_plugin.getInst();
odp.szGroup.w = LPGENW("Network");
odp.szTitle.w = m_tszUserName;
odp.dwInitParam = LPARAM(this);
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index a9df14c7b3..1eca8dc523 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -75,7 +75,7 @@ void InitContactMenus() {
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE;
SET_UID(mi, 0xfc4e1245, 0xc8e0, 0x4de2, 0x92, 0x15, 0xfc, 0xcf, 0x48, 0xf9, 0x41, 0x56);
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 91349b1d5d..bb6f1ce870 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -782,9 +782,9 @@ int CVkProto::OnGcMenuHook(WPARAM, LPARAM lParam) return 0;
if (gcmi->Type == MENU_ON_LOG)
- Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems, &g_plugin);
else if (gcmi->Type == MENU_ON_NICKLIST)
- Chat_AddMenuItems(gcmi->hMenu, _countof(sttListItems), sttListItems, g_plugin.m_hLang);
+ Chat_AddMenuItems(gcmi->hMenu, _countof(sttListItems), sttListItems, &g_plugin);
return 0;
}
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index 36e4d7f73a..6bab6d4eab 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -74,7 +74,7 @@ bool CVkAccMgrForm::OnApply() int CVkProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.szTitle.w = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 1c0c9be6e5..acbc236066 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -147,7 +147,7 @@ void CVkProto::InitMenus() for (int i = 0; i < PMI_COUNT; i++)
m_hProtoMenuItems[i] = nullptr;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = Menu_GetProtocolRoot(this);
// Proto menu
diff --git a/src/core/stdautoaway/src/options.cpp b/src/core/stdautoaway/src/options.cpp index 79f6795174..aeaa9c66fb 100644 --- a/src/core/stdautoaway/src/options.cpp +++ b/src/core/stdautoaway/src/options.cpp @@ -124,7 +124,7 @@ public: int IdleOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_IDLE); odp.szGroup.a = LPGEN("Status"); diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index d7e8ae2b48..ef9c3a2799 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -166,7 +166,7 @@ int LoadAwayMsgModule(void) hWindowList = WindowList_Create();
CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetMessageCommand);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84);
mi.position = -2000005000;
mi.flags = CMIF_NOTOFFLINE;
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index cc416c4ef6..377f9e5200 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -515,9 +515,8 @@ static int AwayMsgOptInitialise(WPARAM wParam, LPARAM) if (protoModeMsgFlags == 0)
return 0;
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 870000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AWAYMSG);
odp.szTitle.a = LPGEN("Status messages");
odp.szGroup.a = LPGEN("Status");
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 311e3a959d..e88a137266 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -423,8 +423,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, int ClcOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.szGroup.a = LPGEN("Contact list");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC);
odp.szTitle.a = LPGEN("List");
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index 10892215ac..31c98f78ca 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -192,9 +192,8 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP int CListOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1000000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST);
odp.szTitle.a = LPGEN("Contact list");
odp.pfnDlgProc = DlgProcGenOpts;
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index 2584384cad..82ed81a612 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -310,8 +310,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int CluiOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI);
odp.szTitle.a = LPGEN("Window");
odp.szGroup.a = LPGEN("Contact list");
diff --git a/src/core/stdcrypt/src/encrypt.cpp b/src/core/stdcrypt/src/encrypt.cpp index 1fe6cd083b..5341a9927d 100644 --- a/src/core/stdcrypt/src/encrypt.cpp +++ b/src/core/stdcrypt/src/encrypt.cpp @@ -211,7 +211,7 @@ int LoadEncryptionModule(void) cp.pszName = "AES (Rjindale)";
cp.szDescr.a = LPGEN("Standard crypto provider");
cp.pFactory = builder;
- cp.iLangId = g_plugin.m_hLang;
+ cp.pPlugin = &g_plugin;
CallService(MS_CRYPTO_REGISTER_ENGINE, 0, LPARAM(&cp));
return 0;
}
diff --git a/src/core/stdemail/src/email.cpp b/src/core/stdemail/src/email.cpp index ab7cde149d..1ad9e70c2b 100644 --- a/src/core/stdemail/src/email.cpp +++ b/src/core/stdemail/src/email.cpp @@ -66,7 +66,7 @@ static int EMailPreBuildMenu(WPARAM hContact, LPARAM) int LoadSendRecvEMailModule(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x61d8e25a, 0x92e, 0x4470, 0x84, 0x57, 0x5e, 0x52, 0x17, 0x7f, 0xfa, 0x3);
mi.position = -2000010000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SENDEMAIL);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 977536464d..c9f15ef1d5 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -315,7 +315,7 @@ static int SRFileProtoAck(WPARAM, LPARAM lParam) static int SRFileModulesLoaded(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x7f8dcf77, 0xe448, 0x4505, 0xb0, 0x56, 0xb, 0xb1, 0xab, 0xac, 0x64, 0x9d);
mi.position = -2000020000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_FILE);
@@ -414,7 +414,7 @@ int LoadSendRecvFileModule(void) {
CreateServiceFunction("FtMgr/Show", FtMgrShowCommand);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x75794ab5, 0x2573, 0x48f4, 0xb4, 0xa0, 0x93, 0xd6, 0xf5, 0xe0, 0xf3, 0x32);
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_EVENT_FILE);
mi.position = 1900000000;
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 88a320883d..6e98fb682c 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -224,9 +224,8 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L int FileOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 900000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FILETRANSFER);
odp.szTitle.a = LPGEN("File transfers");
odp.szGroup.a = LPGEN("Events");
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index ed1badbeb4..84afc895b4 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -228,7 +228,7 @@ void Load_ChatModule() AddIcons(); RegisterFonts(); - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Chat module"), FONTMODE_USE, g_plugin.m_hLang }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Chat module"), FONTMODE_USE, &g_plugin }; Chat_CustomizeApi(&data); g_chatApi.OnCreateModule = OnCreateModule; diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index ea33f6e3d7..1c0da02179 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -358,21 +358,21 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_ADDCONTACT);
bbd.pwszText = LPGENW("&Add");
bbd.pwszTooltip = LPGENW("Add contact permanently to list");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_USERMENU;
bbd.dwDefPos = 20;
bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_DOWNARROW);
bbd.pwszText = LPGENW("&User menu");
bbd.pwszTooltip = LPGENW("User menu");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_DETAILS;
bbd.dwDefPos = 30;
bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
bbd.pwszText = LPGENW("User &details");
bbd.pwszTooltip = LPGENW("View user's details");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.bbbFlags |= BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
bbd.dwButtonID = IDC_SRMM_HISTORY;
@@ -380,7 +380,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
bbd.pwszText = LPGENW("&History");
bbd.pwszTooltip = LPGENW("View user's history (CTRL+H)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
// chat buttons
bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID;
@@ -389,35 +389,35 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = GetIconHandle("bold");
bbd.pwszText = LPGENW("&Bold");
bbd.pwszTooltip = LPGENW("Make the text bold (CTRL+B)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_ITALICS;
bbd.dwDefPos = 15;
bbd.hIcon = GetIconHandle("italics");
bbd.pwszText = LPGENW("&Italic");
bbd.pwszTooltip = LPGENW("Make the text italicized (CTRL+I)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_UNDERLINE;
bbd.dwDefPos = 20;
bbd.hIcon = GetIconHandle("underline");
bbd.pwszText = LPGENW("&Underline");
bbd.pwszTooltip = LPGENW("Make the text underlined (CTRL+U)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_COLOR;
bbd.dwDefPos = 25;
bbd.hIcon = GetIconHandle("fgcol");
bbd.pwszText = LPGENW("&Color");
bbd.pwszTooltip = LPGENW("Select a foreground color for the text (CTRL+K)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_BKGCOLOR;
bbd.dwDefPos = 30;
bbd.hIcon = GetIconHandle("bkgcol");
bbd.pwszText = LPGENW("&Background color");
bbd.pwszTooltip = LPGENW("Select a background color for the text (CTRL+L)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID;
bbd.dwButtonID = IDC_SRMM_CHANMGR;
@@ -425,21 +425,21 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = GetIconHandle("settings");
bbd.pwszText = LPGENW("&Room settings");
bbd.pwszTooltip = LPGENW("Control this room (CTRL+O)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST;
bbd.dwDefPos = 20;
bbd.hIcon = GetIconHandle("nicklist");
bbd.pwszText = LPGENW("&Show/hide nick list");
bbd.pwszTooltip = LPGENW("Show/hide the nick list (CTRL+N)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
bbd.dwButtonID = IDC_SRMM_FILTER;
bbd.dwDefPos = 10;
bbd.hIcon = GetIconHandle("filter");
bbd.pwszText = LPGENW("&Filter");
bbd.pwszTooltip = LPGENW("Enable/disable the event filter (CTRL+F)");
- Srmm_AddButton(&bbd, g_plugin.m_hLang);
+ Srmm_AddButton(&bbd, &g_plugin);
return 0;
}
@@ -493,7 +493,7 @@ static int SplitmsgModulesLoaded(WPARAM, LPARAM) LoadMsgLogIcons();
OnCheckPlugins(0, 0);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x58d8dc1, 0x1c25, 0x49c0, 0xb8, 0x7c, 0xa3, 0x22, 0x2b, 0x3d, 0xf1, 0xd8);
mi.position = -2000090000;
mi.flags = CMIF_DEFAULT;
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index c5e6850b58..c3de5fbee5 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -399,7 +399,7 @@ static int PreShutdownHistoryModule(WPARAM, LPARAM) int LoadHistoryModule(void)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4);
mi.position = 1000090000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_HISTORY);
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp index 1cf54246b4..22f17335fe 100644 --- a/src/core/stduserinfo/src/stdinfo.cpp +++ b/src/core/stduserinfo/src/stdinfo.cpp @@ -607,9 +607,7 @@ int DetailsInit(WPARAM wParam, LPARAM lParam) if (GetContactProto(lParam) == nullptr)
return 0;
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
-
+ OPTIONSDIALOGPAGE odp = {};
odp.pfnDlgProc = SummaryDlgProc;
odp.position = -2100000000;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SUMMARY);
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 33206334ef..5f43ae35a7 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -45,7 +45,8 @@ struct DetailsPageData LPARAM dlgParam;
HWND hwnd;
HTREEITEM hItem;
- int changed, hLangpack;
+ HPLUGIN pPlugin;
+ int changed;
wchar_t *ptszTitle, *ptszTab;
};
@@ -66,12 +67,12 @@ struct DetailsData wchar_t* getTitle(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->szTitle.w : TranslateW_LP(p->szTitle.w, p->langId);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->szTitle.w : TranslateW_LP(p->szTitle.w, p->pPlugin);
}
wchar_t* getTab(OPTIONSDIALOGPAGE *p)
{
- return (p->flags & ODPF_DONTTRANSLATE) ? p->szTab.w : TranslateW_LP(p->szTab.w, p->langId);
+ return (p->flags & ODPF_DONTTRANSLATE) ? p->szTab.w : TranslateW_LP(p->szTab.w, p->pPlugin);
}
static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
@@ -141,7 +142,7 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) opi->odp = (OPTIONSDIALOGPAGE*)mir_realloc(opi->odp, sizeof(OPTIONSDIALOGPAGE)*(opi->pageCount + 1));
OPTIONSDIALOGPAGE *dst = opi->odp + opi->pageCount;
memset(dst, 0, sizeof(OPTIONSDIALOGPAGE));
- dst->hInstance = odp->hInstance;
+ dst->pPlugin = odp->pPlugin;
dst->pfnDlgProc = odp->pfnDlgProc;
dst->position = odp->position;
dst->pszTemplate = ((DWORD_PTR)odp->pszTemplate & 0xFFFF0000) ? mir_strdup(odp->pszTemplate) : odp->pszTemplate;
@@ -155,7 +156,6 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) dst->szTab.w = (odp->flags & ODPF_USERINFOTAB) ? mir_a2u(odp->szTab.a) : nullptr;
}
- dst->langId = odp->langId;
dst->flags = odp->flags;
dst->dwInitParam = odp->dwInitParam;
opi->pageCount++;
@@ -180,7 +180,7 @@ static void CreateDetailsTabs(HWND hwndDlg, DetailsData *dat, DetailsPageData *p if (!odp.ptszTab || mir_wstrcmp(odp.ptszTitle, ppg->ptszTitle))
continue;
- tie.pszText = TranslateW_LP(odp.ptszTab, odp.hLangpack);
+ tie.pszText = TranslateW_LP(odp.ptszTab, odp.pPlugin);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(odp.ptszTab, ppg->ptszTab))
@@ -280,15 +280,15 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP HWND hwndTree = GetDlgItem(hwndDlg, IDC_PAGETREE);
for (i = 0; i < dat->pageCount; i++) {
DetailsPageData &p = dat->opd[i];
- p.pTemplate = (LPDLGTEMPLATE)LockResource(LoadResource(odp[i].hInstance,
- FindResourceA(odp[i].hInstance, odp[i].pszTemplate, MAKEINTRESOURCEA(5))));
+ HINSTANCE hInst = odp[i].pPlugin->getInst();
+ p.pTemplate = (LPDLGTEMPLATE)LockResource(LoadResource(hInst, FindResourceA(hInst, odp[i].pszTemplate, MAKEINTRESOURCEA(5))));
p.dlgProc = odp[i].pfnDlgProc;
p.dlgParam = odp[i].dwInitParam;
- p.hInst = odp[i].hInstance;
+ p.hInst = hInst;
p.ptszTitle = odp[i].szTitle.w;
p.ptszTab = odp[i].szTab.w;
- p.hLangpack = odp[i].langId;
+ p.pPlugin = odp[i].pPlugin;
if (i && p.ptszTab && !mir_wstrcmp(dat->opd[i - 1].ptszTitle, p.ptszTitle)) {
p.hItem = dat->opd[i - 1].hItem;
@@ -303,7 +303,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (odp[i].flags & ODPF_DONTTRANSLATE)
tvis.item.pszText = p.ptszTitle;
else
- tvis.item.pszText = TranslateW_LP(p.ptszTitle, p.hLangpack);
+ tvis.item.pszText = TranslateW_LP(p.ptszTitle, p.pPlugin);
if (ptszLastTab && !mir_wstrcmp(tvis.item.pszText, ptszLastTab))
dat->currentPage = i;
p.hItem = TreeView_InsertItem(hwndTree, &tvis);
@@ -638,7 +638,7 @@ int LoadUserInfoModule(void) HookEvent(ME_DB_CONTACT_DELETED, UserInfoContactDelete);
HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownUserInfo);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xe8731d53, 0x95af, 0x42cf, 0xae, 0x27, 0xc7, 0xa7, 0xa, 0xbf, 0x14, 0x1c);
mi.position = 1000050000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS);
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index 66b9bfc2ae..e377e1c43a 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -60,15 +60,6 @@ MIR_APP_DLL(HINSTANCE) GetInstByAddress(void *codePtr) return result; } -MIR_APP_DLL(CMPluginBase*) GetPluginByLangId(int _hLang) -{ - for (auto &it : g_arPlugins) - if (it->m_hLang == _hLang) - return it; - - return nullptr; -} - MIR_APP_DLL(int) GetPluginLangId(const MUUID &uuid, int _hLang) { if (uuid == miid_last) @@ -104,13 +95,6 @@ MIR_APP_DLL(CMPluginBase&) GetPluginByInstance(HINSTANCE hInst) return (pPlugin == nullptr) ? g_plugin : *pPlugin; } -MIR_APP_DLL(int) GetPluginLangByInstance(HINSTANCE hInst) -{ - HINSTANCE boo[2] = { 0, hInst }; - CMPluginBase *pPlugin = g_arPlugins.find((CMPluginBase*)&boo); - return (pPlugin == nullptr) ? 0 : pPlugin->m_hLang; -} - ///////////////////////////////////////////////////////////////////////////////////////// // stubs for pascal plugins @@ -118,8 +102,6 @@ EXTERN_C MIR_APP_DLL(void) RegisterPlugin(CMPluginBase *pPlugin) { if (pPlugin->getInst() != nullptr) g_arPlugins.insert(pPlugin); - - mir_getLP(&pPlugin->getInfo(), &pPlugin->m_hLang); } EXTERN_C MIR_APP_DLL(void) UnregisterPlugin(CMPluginBase *pPlugin) @@ -129,23 +111,12 @@ EXTERN_C MIR_APP_DLL(void) UnregisterPlugin(CMPluginBase *pPlugin) ///////////////////////////////////////////////////////////////////////////////////////// -int PluginsLoadLangpack(WPARAM, LPARAM) -{ - for (auto &it : g_arPlugins) - mir_getLP(&it->getInfo(), &it->m_hLang); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - CMPluginBase::CMPluginBase(const char *moduleName, const PLUGININFOEX &pInfo) : m_szModuleName(moduleName), m_pInfo(pInfo) { if (m_hInst != nullptr) g_arPlugins.insert(this); - - mir_getLP(&pInfo, &m_hLang); } CMPluginBase::~CMPluginBase() @@ -181,83 +152,83 @@ void CMPluginBase::tryOpenLog() ///////////////////////////////////////////////////////////////////////////////////////// -int CMPluginBase::addOptions(WPARAM wParam, struct OPTIONSDIALOGPAGE *odp) +int CMPluginBase::addOptions(WPARAM wParam, OPTIONSDIALOGPAGE *odp) { - return ::Options_AddPage(wParam, odp, m_hLang); + return ::Options_AddPage(wParam, odp, this); } void CMPluginBase::openOptions(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab) { - ::Options_Open(pszGroup, pszPage, pszTab, m_hLang); + ::Options_Open(pszGroup, pszPage, pszTab, this); } void CMPluginBase::openOptionsPage(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab) { - ::Options_OpenPage(pszGroup, pszPage, pszTab, m_hLang); + ::Options_OpenPage(pszGroup, pszPage, pszTab, this); } ///////////////////////////////////////////////////////////////////////////////////////// int CMPluginBase::addFont(FontID *pFont) { - return Font_Register(pFont, m_hLang); + return Font_Register(pFont, this); } int CMPluginBase::addFont(FontIDW *pFont) { - return Font_RegisterW(pFont, m_hLang); + return Font_RegisterW(pFont, this); } int CMPluginBase::addColor(ColourID *pColor) { - return Colour_Register(pColor, m_hLang); + return Colour_Register(pColor, this); } int CMPluginBase::addColor(ColourIDW *pColor) { - return Colour_RegisterW(pColor, m_hLang); + return Colour_RegisterW(pColor, this); } int CMPluginBase::addEffect(EffectID *pEffect) { - return Effect_Register(pEffect, m_hLang); + return Effect_Register(pEffect, this); } int CMPluginBase::addEffect(EffectIDW *pEffect) { - return Effect_RegisterW(pEffect, m_hLang); + return Effect_RegisterW(pEffect, this); } ///////////////////////////////////////////////////////////////////////////////////////// int CMPluginBase::addFrame(const CLISTFrame *F) { - return (int)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)F, m_hLang); + return (int)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)F, (LPARAM)this); } int CMPluginBase::addHotkey(const HOTKEYDESC *hk) { - return Hotkey_Register(hk, m_hLang); + return Hotkey_Register(hk, this); } HANDLE CMPluginBase::addIcon(const SKINICONDESC *sid) { - return IcoLib_AddIcon(sid, m_hLang); + return IcoLib_AddIcon(sid, this); } HGENMENU CMPluginBase::addRootMenu(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib) { - return Menu_CreateRoot(hMenuObject, ptszName, position, hIcoLib, m_hLang); + return Menu_CreateRoot(hMenuObject, ptszName, position, hIcoLib, this); } HANDLE CMPluginBase::addTTB(const struct TTBButton *pButton) { - return (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)pButton, m_hLang); + return (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)pButton, (LPARAM)this); } int CMPluginBase::addUserInfo(WPARAM wParam, OPTIONSDIALOGPAGE *odp) { - odp->langId = m_hLang; + odp->pPlugin = this; return CallService("UserInfo/AddPage", wParam, (LPARAM)odp); } diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index a6b9bf0ad2..9c89f7d287 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -316,7 +316,7 @@ static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wc return nullptr;
}
-static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupName, int _hLang)
+static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupName, HPLUGIN pPlugin)
{
wchar_t itemName[1024];
wchar_t* sectionName;
@@ -335,7 +335,7 @@ static void sttFsuiCreateSettingsTreeNode(HWND hwndTree, const wchar_t *groupNam if (sectionName = wcschr(sectionName, '/'))
*sectionName = 0;
- pItemName = TranslateW_LP(pItemName, _hLang);
+ pItemName = TranslateW_LP(pItemName, pPlugin);
hItem = sttFindNamedTreeItemAt(hwndTree, hSection, pItemName);
if (!sectionName || !hItem) {
@@ -555,19 +555,19 @@ static void RebuildTree(HWND hwndDlg) for (auto &F : font_id_list_w2) {
// sync settings with database
UpdateFontSettings(F, &F->value);
- sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), F->group, F->hLangpack);
+ sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), F->group, F->pPlugin);
}
for (auto &C : colour_id_list_w2) {
// sync settings with database
UpdateColourSettings(C, &C->value);
- sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), C->group, C->hLangpack);
+ sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), C->group, C->pPlugin);
}
for (auto &E : effect_id_list_w2) {
// sync settings with database
UpdateEffectSettings(E, &E->value);
- sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), E->group, E->hLangpack);
+ sttFsuiCreateSettingsTreeNode(GetDlgItem(hwndDlg, IDC_FONTGROUP), E->group, E->pPlugin);
}
}
@@ -1183,9 +1183,8 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, int OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FONTS);
odp.szTitle.a = LPGEN("Fonts and colors");
odp.szGroup.a = LPGEN("Customize");
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index 1dd6e6a3e3..333c1a7176 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -245,7 +245,7 @@ void UpdateFontSettings(FontIDW *font_id, FontSettingsW *fontsettings) /////////////////////////////////////////////////////////////////////////////////////////
// RegisterFont service
-static int sttRegisterFontWorker(FontIDW *font_id, int _hLang)
+static int sttRegisterFontWorker(FontIDW *font_id, HPLUGIN pPlugin)
{
if (font_id->cbSize != sizeof(FontIDW))
return -1;
@@ -261,7 +261,7 @@ static int sttRegisterFontWorker(FontIDW *font_id, int _hLang) FontInternal* newItem = new FontInternal;
memset(newItem, 0, sizeof(FontInternal));
memcpy(newItem, font_id, font_id->cbSize);
- newItem->hLangpack = _hLang;
+ newItem->pPlugin = pPlugin;
if (!mir_wstrcmp(newItem->deffontsettings.szFace, L"MS Shell Dlg")) {
LOGFONT lf;
@@ -278,16 +278,16 @@ static int sttRegisterFontWorker(FontIDW *font_id, int _hLang) return 0;
}
-MIR_APP_DLL(int) Font_RegisterW(FontIDW *pFont, int _hLang)
+MIR_APP_DLL(int) Font_RegisterW(FontIDW *pFont, HPLUGIN pPlugin)
{
- return sttRegisterFontWorker(pFont, _hLang);
+ return sttRegisterFontWorker(pFont, pPlugin);
}
-MIR_APP_DLL(int) Font_Register(FontID *pFont, int _hLang)
+MIR_APP_DLL(int) Font_Register(FontID *pFont, HPLUGIN pPlugin)
{
FontIDW temp;
if (!ConvertFontID(pFont, &temp)) return -1;
- return sttRegisterFontWorker(&temp, _hLang);
+ return sttRegisterFontWorker(&temp, pPlugin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -333,11 +333,11 @@ static INT_PTR ReloadFonts(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleFonts(int _hLang)
+MIR_APP_DLL(void) KillModuleFonts(HPLUGIN pPlugin)
{
auto T = font_id_list.rev_iter();
for (auto &it : T) {
- if (it->hLangpack == _hLang) {
+ if (it->pPlugin == pPlugin) {
font_id_list.remove(T.indexOf(&it));
notifyOptions();
}
@@ -352,7 +352,7 @@ void UpdateColourSettings(ColourIDW *colour_id, COLORREF *colour) *colour = (COLORREF)db_get_dw(0, colour_id->dbSettingsGroup, colour_id->setting, colour_id->defcolour);
}
-static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int _hLang)
+static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, HPLUGIN pPlugin)
{
if (colour_id->cbSize != sizeof(ColourIDW))
return -1;
@@ -364,7 +364,7 @@ static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int _hLang) ColourInternal* newItem = new ColourInternal;
memset(newItem, 0, sizeof(ColourInternal));
memcpy(newItem, colour_id, sizeof(ColourIDW));
- newItem->hLangpack = _hLang;
+ newItem->pPlugin = pPlugin;
UpdateColourSettings(colour_id, &newItem->value);
colour_id_list.insert(newItem);
@@ -372,16 +372,16 @@ static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int _hLang) return 0;
}
-MIR_APP_DLL(int) Colour_RegisterW(ColourIDW *pFont, int _hLang)
+MIR_APP_DLL(int) Colour_RegisterW(ColourIDW *pFont, HPLUGIN pPlugin)
{
- return sttRegisterColourWorker(pFont, _hLang);
+ return sttRegisterColourWorker(pFont, pPlugin);
}
-MIR_APP_DLL(int) Colour_Register(ColourID *pFont, int _hLang)
+MIR_APP_DLL(int) Colour_Register(ColourID *pFont, HPLUGIN pPlugin)
{
ColourIDW temp;
if (!ConvertColourID(pFont, &temp)) return -1;
- return sttRegisterColourWorker(&temp, _hLang);
+ return sttRegisterColourWorker(&temp, pPlugin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -414,11 +414,11 @@ static INT_PTR ReloadColours(WPARAM, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleColours(int _hLang)
+MIR_APP_DLL(void) KillModuleColours(HPLUGIN pPlugin)
{
auto T = colour_id_list.rev_iter();
for (auto &it : T) {
- if (it->hLangpack == _hLang) {
+ if (it->pPlugin == pPlugin) {
colour_id_list.remove(T.indexOf(&it));
notifyOptions();
}
@@ -444,7 +444,7 @@ void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT *effectsettings) /////////////////////////////////////////////////////////////////////////////////////////
// RegisterEffect service
-static int sttRegisterEffectWorker(EffectIDW *effect_id, int _hLang)
+static int sttRegisterEffectWorker(EffectIDW *effect_id, HPLUGIN pPlugin)
{
if (effect_id->cbSize != sizeof(EffectIDW))
return -1;
@@ -456,7 +456,7 @@ static int sttRegisterEffectWorker(EffectIDW *effect_id, int _hLang) EffectInternal* newItem = new EffectInternal;
memset(newItem, 0, sizeof(EffectInternal));
memcpy(newItem, effect_id, sizeof(EffectIDW));
- newItem->hLangpack = _hLang;
+ newItem->pPlugin = pPlugin;
UpdateEffectSettings(effect_id, &newItem->value);
effect_id_list.insert(newItem);
@@ -464,16 +464,16 @@ static int sttRegisterEffectWorker(EffectIDW *effect_id, int _hLang) return 0;
}
-MIR_APP_DLL(int) Effect_RegisterW(EffectIDW *pFont, int _hLang)
+MIR_APP_DLL(int) Effect_RegisterW(EffectIDW *pFont, HPLUGIN pPlugin)
{
- return sttRegisterEffectWorker(pFont, _hLang);
+ return sttRegisterEffectWorker(pFont, pPlugin);
}
-MIR_APP_DLL(int) Effect_Register(EffectID *pFont, int _hLang)
+MIR_APP_DLL(int) Effect_Register(EffectID *pFont, HPLUGIN pPlugin)
{
EffectIDW temp;
if (!ConvertEffectID(pFont, &temp)) return -1;
- return sttRegisterEffectWorker(&temp, _hLang);
+ return sttRegisterEffectWorker(&temp, pPlugin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -503,11 +503,11 @@ MIR_APP_DLL(int) Effect_Get(const char *szGroup, const char *szName, FONTEFFECT /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleEffects(int _hLang)
+MIR_APP_DLL(void) KillModuleEffects(HPLUGIN pPlugin)
{
auto T = colour_id_list.rev_iter();
for (auto &it : T)
- if (it->hLangpack == _hLang)
+ if (it->pPlugin == pPlugin)
effect_id_list.remove(T.indexOf(&it));
}
diff --git a/src/mir_app/src/FontService.h b/src/mir_app/src/FontService.h index 083c235ffe..a12ed6e665 100644 --- a/src/mir_app/src/FontService.h +++ b/src/mir_app/src/FontService.h @@ -31,9 +31,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct FontInternal : public FontIDW
{
FontSettingsW value;
- int hLangpack;
+ HPLUGIN pPlugin;
- __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, pPlugin); }
__inline bool isHeader() const
{
@@ -49,17 +49,17 @@ struct FontInternal : public FontIDW struct ColourInternal : public ColourIDW
{
- __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, pPlugin); }
COLORREF value;
- int hLangpack;
+ HPLUGIN pPlugin;
};
struct EffectInternal : public EffectIDW
{
- __inline wchar_t* getName() const { return TranslateW_LP(name, hLangpack); }
+ __inline wchar_t* getName() const { return TranslateW_LP(name, pPlugin); }
- int hLangpack;
+ HPLUGIN pPlugin;
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index cccd788220..37c56a0fd7 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -84,7 +84,7 @@ struct IcolibItem : public MZeroedObject IconSourceFile* default_file;
int default_indx;
int cx, cy;
- int hLangpack;
+ HPLUGIN pPlugin;
IconSourceItem* source_small;
IconSourceItem* source_big;
@@ -95,7 +95,7 @@ struct IcolibItem : public MZeroedObject BOOL temp_reset;
__inline ~IcolibItem() { clear(); }
- __inline wchar_t* getDescr() const { return TranslateW_LP(description, hLangpack); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(description, pPlugin); }
void clear();
};
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index eb149a96fd..401adb6139 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -38,8 +38,9 @@ class CChatRoomDlg : public CSrmmBaseDialog };
extern HGENMENU hJoinMenuItem, hLeaveMenuItem;
+extern HPLUGIN g_pChatPlugin;
extern GlobalLogSettingsBase *g_Settings;
-extern int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
+extern int g_cbSession, g_cbModuleInfo, g_iFontMode;
extern wchar_t *g_szFontGroup;
extern mir_cs csChat;
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index dfff3b975f..f28d82768e 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -1009,7 +1009,7 @@ MIR_APP_DLL(CHAT_MANAGER*) Chat_CustomizeApi(const CHAT_MANAGER_INITDATA *pInit) g_cbSession = pInit->cbSession;
g_cbModuleInfo = pInit->cbModuleInfo;
g_iFontMode = pInit->iFontMode;
- g_iChatLang = pInit->iLangId;
+ g_pChatPlugin = pInit->pPlugin;
g_chatApi.SetActiveSession = SetActiveSession;
g_chatApi.GetActiveSession = GetActiveSession;
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index 8810a39c52..1a6a242a01 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -26,8 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern SESSION_INFO g_TabSession;
+HPLUGIN g_pChatPlugin;
GlobalLogSettingsBase *g_Settings;
-int g_cbSession, g_cbModuleInfo, g_iFontMode, g_iChatLang;
+int g_cbSession, g_cbModuleInfo, g_iFontMode;
wchar_t *g_szFontGroup;
#define FONTF_BOLD 1
@@ -177,7 +178,7 @@ void RegisterFonts(void) fontid.deffontsettings.colour = FO.defColour;
fontid.deffontsettings.size = FO.defSize;
fontid.deffontsettings.style = FO.defStyle;
- Font_RegisterW(&fontid, g_iChatLang);
+ Font_RegisterW(&fontid, g_pChatPlugin);
}
}
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index f8918ff67f..db9a72be2d 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -726,7 +726,7 @@ static int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_SMILEYADD_OPTIONSCHANGED, SmileyOptionsChanged);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x2bb76d5, 0x740d, 0x4fd2, 0x8f, 0xee, 0x7c, 0xa4, 0x5a, 0x74, 0x65, 0xa6);
mi.position = -2000090001;
mi.flags = CMIF_DEFAULT;
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 986e25a4db..9ac61b5ae7 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -695,14 +695,14 @@ MIR_APP_DLL(wchar_t*) Chat_UnescapeTags(wchar_t *str_in) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, int _hLang)
+MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item, HPLUGIN pPlugin)
{
if (nItems > 0)
AppendMenu(hMenu, MF_SEPARATOR, 0, nullptr);
HMENU hSubMenu = nullptr;
for (int i = 0; i < nItems; i++) {
- wchar_t *ptszText = TranslateW_LP(Item[i].pszDesc, _hLang);
+ wchar_t *ptszText = TranslateW_LP(Item[i].pszDesc, pPlugin);
DWORD dwState = Item[i].bDisabled ? MF_GRAYED : 0;
if (Item[i].uType == MENU_NEWPOPUP) {
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 528bc4492e..568586b417 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -317,7 +317,7 @@ int LoadCLUIModule(void) db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x66aada45, 0x8bcb, 0x49bb, 0x85, 0xb0, 0xae, 0x1, 0xf8, 0xbe, 0x78, 0x7e);
mi.position = 2000070000;
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp index ba1df15b2e..0c13ddb594 100644 --- a/src/mir_app/src/contacts.cpp +++ b/src/mir_app/src/contacts.cpp @@ -354,7 +354,7 @@ public: static int ContactOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1000000000;
odp.szGroup.a = LPGEN("Contact list");
odp.szTitle.a = LPGEN("Contact names");
diff --git a/src/mir_app/src/ei_baseIcon.cpp b/src/mir_app/src/ei_baseIcon.cpp index 8876e90bc1..9f13b103cb 100644 --- a/src/mir_app/src/ei_baseIcon.cpp +++ b/src/mir_app/src/ei_baseIcon.cpp @@ -45,7 +45,7 @@ void BaseExtraIcon::setOnClick(MIRANDAHOOKPARAM pFunc, LPARAM pParam) const wchar_t* BaseExtraIcon::getDescription() const { - return TranslateW_LP(m_tszDescription, m_hLangpack); + return TranslateW_LP(m_tszDescription, m_pPlugin); } void BaseExtraIcon::setDescription(const wchar_t *desc) diff --git a/src/mir_app/src/ei_options.cpp b/src/mir_app/src/ei_options.cpp index 7f763d87c8..7ee60636b8 100644 --- a/src/mir_app/src/ei_options.cpp +++ b/src/mir_app/src/ei_options.cpp @@ -473,7 +473,7 @@ void eiOptionsRefresh() int InitOptionsCallback(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Contact list"); odp.szTitle.a = LPGEN("Extra icons"); odp.szTab.a = LPGEN("General"); diff --git a/src/mir_app/src/ei_services.cpp b/src/mir_app/src/ei_services.cpp index 52017494e7..05e4969b2f 100644 --- a/src/mir_app/src/ei_services.cpp +++ b/src/mir_app/src/ei_services.cpp @@ -193,13 +193,13 @@ static void ResetSlots(BaseExtraIcon *extra, ExtraIconGroup *group) } } -MIR_APP_DLL(void) KillModuleExtraIcons(int _hLang) +MIR_APP_DLL(void) KillModuleExtraIcons(HPLUGIN pPlugin) { LIST<ExtraIcon> arIcons(1); auto T = registeredExtraIcons.rev_iter(); for (auto &it : T) - if (it->m_hLangpack == _hLang) { + if (it->m_pPlugin == pPlugin) { arIcons.insert(it); registeredExtraIcons.remove(T.indexOf(&it)); } @@ -375,7 +375,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const ptrW tszDesc(mir_a2u(description)); BaseExtraIcon *extra = new CallbackExtraIcon(name, tszDesc, descIcon == nullptr ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam); - extra->m_hLangpack = GetPluginLangByInstance(GetInstByAddress(RebuildIcons)); + extra->m_pPlugin = &GetPluginByInstance(GetInstByAddress(RebuildIcons)); EI_PostCreate(extra, name, flags); return extra; } @@ -409,7 +409,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch } else { extra = new IcolibExtraIcon(name, tszDesc, descIcon == nullptr ? "" : descIcon, OnClick, onClickParam); - extra->m_hLangpack = GetPluginLangByInstance(GetInstByAddress((void*)name)); + extra->m_pPlugin = &GetPluginByInstance(GetInstByAddress((void*)name)); EI_PostCreate(extra, name, flags); } diff --git a/src/mir_app/src/encrypt.cpp b/src/mir_app/src/encrypt.cpp index b31f2c6d3e..21adb6708d 100644 --- a/src/mir_app/src/encrypt.cpp +++ b/src/mir_app/src/encrypt.cpp @@ -41,9 +41,9 @@ static INT_PTR srvRegister(WPARAM, LPARAM lParam) CRYPTO_PROVIDER *pNew = new CRYPTO_PROVIDER(*p);
pNew->pszName = mir_strdup(p->pszName);
if (pNew->dwFlags & CPF_UNICODE)
- pNew->szDescr.w = mir_wstrdup(TranslateW_LP(p->szDescr.w, p->iLangId));
+ pNew->szDescr.w = mir_wstrdup(TranslateW_LP(p->szDescr.w, p->pPlugin));
else
- pNew->szDescr.w = mir_a2u(TranslateA_LP(p->szDescr.a, p->iLangId));
+ pNew->szDescr.w = mir_a2u(TranslateA_LP(p->szDescr.a, p->pPlugin));
arProviders.insert(pNew);
return 0;
}
diff --git a/src/mir_app/src/extraicons.h b/src/mir_app/src/extraicons.h index 5a0c1560d3..07bf67376f 100644 --- a/src/mir_app/src/extraicons.h +++ b/src/mir_app/src/extraicons.h @@ -73,7 +73,7 @@ public: virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage) = 0;
- int m_hLangpack = 0;
+ HPLUGIN m_pPlugin = nullptr;
protected:
ptrA m_szName;
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index 043c0ea379..4e7f00fa9a 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -1009,7 +1009,7 @@ int LoadFindAddModule(void) HookEvent(ME_PROTO_ACCLISTCHANGED, OnSystemModulesLoaded); HookEvent(ME_SYSTEM_PRESHUTDOWN, FindAddPreShutdown); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x860556b9, 0x1577, 0x4f6f, 0x8c, 0xb0, 0x93, 0x24, 0xa8, 0x2e, 0x20, 0x92); mi.position = 500020000; mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER); diff --git a/src/mir_app/src/help.cpp b/src/mir_app/src/help.cpp index 8eef92a7cf..89faf55ce6 100644 --- a/src/mir_app/src/help.cpp +++ b/src/mir_app/src/help.cpp @@ -150,7 +150,7 @@ int LoadHelpModule(void) { HookEvent(ME_SYSTEM_PRESHUTDOWN, ShutdownHelpModule); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("&Help"), 2000090000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8824ECA5-6942-46D7-9D07-1BA600E0D02E"); diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index c9361e20ff..d5492728d7 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -1022,8 +1022,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, int HotkeyOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.position = -180000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HOTKEYS); diff --git a/src/mir_app/src/hotkeys.cpp b/src/mir_app/src/hotkeys.cpp index d82754d3b8..63fdd8f8cc 100644 --- a/src/mir_app/src/hotkeys.cpp +++ b/src/mir_app/src/hotkeys.cpp @@ -117,7 +117,7 @@ static LRESULT CALLBACK sttKeyboardProc(int code, WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *desc, int _hLangpack)
+MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *desc, HPLUGIN pPlugin)
{
THotkeyItem *p = (THotkeyItem*)mir_alloc(sizeof(THotkeyItem));
if (desc->dwFlags & HKD_UNICODE) {
@@ -129,7 +129,7 @@ MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *desc, int _hLangpack) p->pwszDescription = mir_a2u(desc->szDescription.a);
}
- p->hLangpack = _hLangpack;
+ p->pPlugin = pPlugin;
p->allowSubHotkeys = TRUE;
p->rootHotkey = nullptr;
p->nSubHotkeys = 0;
@@ -186,7 +186,7 @@ MIR_APP_DLL(int) Hotkey_Register(const HOTKEYDESC *desc, int _hLangpack) if (!db_get_w(0, DBMODULENAME, buf, 0))
continue;
- Hotkey_Register(desc, _hLangpack);
+ Hotkey_Register(desc, pPlugin);
}
p->allowSubHotkeys = count < 0;
}
@@ -286,11 +286,11 @@ void RegisterHotkeys() }
}
-MIR_APP_DLL(void) KillModuleHotkeys(int _hLang)
+MIR_APP_DLL(void) KillModuleHotkeys(HPLUGIN pPlugin)
{
auto T = hotkeys.rev_iter();
for (auto &it : T)
- if (it->hLangpack == _hLang) {
+ if (it->pPlugin == pPlugin) {
FreeHotkey(it);
hotkeys.remove(T.indexOf(&it));
}
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index 153153a44c..f20a408870 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -461,7 +461,7 @@ void IcolibItem::clear() /////////////////////////////////////////////////////////////////////////////////////////
// IcoLib_AddIcon
-MIR_APP_DLL(HANDLE) IcoLib_AddIcon(const SKINICONDESC *sid, int _hLang)
+MIR_APP_DLL(HANDLE) IcoLib_AddIcon(const SKINICONDESC *sid, HPLUGIN pPlugin)
{
mir_cslock lck(csIconList);
@@ -499,7 +499,7 @@ MIR_APP_DLL(HANDLE) IcoLib_AddIcon(const SKINICONDESC *sid, int _hLang) item->cx = sid->cx;
item->cy = sid->cy;
- item->hLangpack = _hLang;
+ item->pPlugin = pPlugin;
if (sid->hDefaultIcon) {
bool big;
@@ -592,7 +592,7 @@ MIR_APP_DLL(void) IcoLib_RemoveIconByHandle(HANDLE hIcoLib) }
}
-MIR_APP_DLL(void) KillModuleIcons(int _hLang)
+MIR_APP_DLL(void) KillModuleIcons(HPLUGIN pPlugin)
{
if (!bModuleInitialized)
return;
@@ -600,7 +600,7 @@ MIR_APP_DLL(void) KillModuleIcons(int _hLang) mir_cslock lck(csIconList);
auto T = iconList.rev_iter();
for (auto &it : T)
- if (it->hLangpack == _hLang) {
+ if (it->pPlugin == pPlugin) {
delete it;
iconList.remove(T.indexOf(&it));
}
diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index 1d2aa10cf5..e217fa5325 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -326,9 +326,8 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM static int IgnoreOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 900000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_IGNORE);
odp.szTitle.a = LPGEN("Ignore");
odp.szGroup.a = LPGEN("Contacts");
diff --git a/src/mir_app/src/lpopts.cpp b/src/mir_app/src/lpopts.cpp index b3fd2d488a..667808bd01 100644 --- a/src/mir_app/src/lpopts.cpp +++ b/src/mir_app/src/lpopts.cpp @@ -257,7 +257,7 @@ void CLangpackDlg::OnDestroy() int LangpackOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -1300000000;
odp.szTitle.a = LPGEN("Languages");
odp.szGroup.a = LPGEN("Customize");
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp index e751cafcbf..269ceab44a 100644 --- a/src/mir_app/src/menu_clist.cpp +++ b/src/mir_app/src/menu_clist.cpp @@ -425,7 +425,7 @@ static INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) if (reset || check) {
TMO_IntMenuItem *timiParent = MO_GetIntMenuItem(pimi->mi.root);
if (timiParent) {
- LPTSTR ptszName = TranslateW_LP(pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"), pimi->mi.langId);
+ LPTSTR ptszName = TranslateW_LP(pimi->mi.hIcolibItem ? pimi->mi.name.w : LPGENW("Custom status"), pimi->mi.pPlugin);
timiParent = MO_GetIntMenuItem(pimi->mi.root);
@@ -727,7 +727,7 @@ void RebuildMenuOrder(void) int pos = 0;
// adding root
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = pos++;
mi.hIcon = ic = (HICON)CallProtoServiceInt(0, pa->szModuleName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
@@ -824,7 +824,7 @@ void RebuildMenuOrder(void) if (!(flags & it.Pf2flag))
continue;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
if (it.iStatus == ID_STATUS_OFFLINE)
mi.flags |= CMIF_CHECKED;
@@ -1086,7 +1086,7 @@ void InitCustomMenus(void) HookEvent(ME_LANGPACK_CHANGED, sttRebuildHotkeys);
// add exit command to menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x707c8962, 0xc33f, 0x4893, 0x8e, 0x36, 0x30, 0xb1, 0x7c, 0xd8, 0x61, 0x40);
mi.position = 0x7fffffff;
mi.pszService = "CloseAction";
diff --git a/src/mir_app/src/menu_groups.cpp b/src/mir_app/src/menu_groups.cpp index 065fee01a1..1d0f70523e 100644 --- a/src/mir_app/src/menu_groups.cpp +++ b/src/mir_app/src/menu_groups.cpp @@ -285,7 +285,7 @@ void InitGroupMenus(void) Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu");
Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSGroup/GroupMenuOnAddService");
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x2f75bc72, 0xd836, 0x4922, 0x9f, 0xe, 0xed, 0x9e, 0xe7, 0x2b, 0x84, 0xf0);
mi.position = 100000;
@@ -346,7 +346,7 @@ void InitGroupMenus(void) Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu");
Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_CHECK_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuCheckService");
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xd208f1d2, 0x7220, 0x4d37, 0xb6, 0xe4, 0xd5, 0x4a, 0xe8, 0xa3, 0xf4, 0x53);
mi.position = 1000;
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp index 011dff0698..a574e704c4 100644 --- a/src/mir_app/src/menu_options.cpp +++ b/src/mir_app/src/menu_options.cpp @@ -527,7 +527,7 @@ public: m_service.SetTextA(szText); } - CMPluginBase *pPlugin = GetPluginByLangId(iod->pimi->mi.langId); + const CMPluginBase *pPlugin = iod->pimi->mi.pPlugin; m_module.SetTextA(pPlugin == nullptr ? "" : pPlugin->getInfo().shortName); m_btnInsMenu.Enable(iod->pimi->mi.root == nullptr); @@ -547,7 +547,7 @@ public: int GenMenuOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -1000000000; odp.szTitle.a = LPGEN("Menus"); odp.szGroup.a = LPGEN("Customize"); diff --git a/src/mir_app/src/menu_tray.cpp b/src/mir_app/src/menu_tray.cpp index aa8b245c1d..bbf2d6c757 100644 --- a/src/mir_app/src/menu_tray.cpp +++ b/src/mir_app/src/menu_tray.cpp @@ -116,7 +116,7 @@ void InitTrayMenus(void) Menu_ConfigureObject(hTrayMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSTRAY/TrayMenuOnAddService");
// add exit command to menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x6c202553, 0xb4d5, 0x403c, 0xa6, 0x82, 0x2, 0xd8, 0x2b, 0x42, 0xba, 0x9e);
mi.flags = CMIF_DEFAULT;
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp index 7d27599165..d410c0e79f 100644 --- a/src/mir_app/src/menu_utils.cpp +++ b/src/mir_app/src/menu_utils.cpp @@ -78,7 +78,7 @@ LPTSTR GetMenuItemText(TMO_IntMenuItem *pimi) if (pimi->mi.flags & CMIF_KEEPUNTRANSLATED)
return pimi->mi.name.w;
- return TranslateW_LP(pimi->mi.name.w, pimi->mi.langId);
+ return TranslateW_LP(pimi->mi.name.w, pimi->mi.pPlugin);
}
///////////////////////////////////////////////////////////////////////////////
@@ -240,7 +240,7 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(PROTO_INTERFACE *pThis) return p;
// create protocol root in the main menu
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.name.w = pThis->m_tszUserName;
mi.position = 500090000;
mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
@@ -609,29 +609,29 @@ MIR_APP_DLL(int) Menu_RemoveItem(HGENMENU hMenuItem) struct KillMenuItemsParam
{
- KillMenuItemsParam(int _hLangpack) :
- langId(_hLangpack),
+ KillMenuItemsParam(HPLUGIN _pPlugin) :
+ pPlugin(_pPlugin),
arItems(10)
{
}
- int langId;
+ HPLUGIN pPlugin;
LIST<TMO_IntMenuItem> arItems;
};
int KillMenuItems(TMO_IntMenuItem *pimi, KillMenuItemsParam* param)
{
- if (pimi->mi.langId == param->langId)
+ if (pimi->mi.pPlugin == param->pPlugin)
param->arItems.insert(pimi);
return FALSE;
}
-MIR_APP_DLL(void) KillModuleMenus(int _hLang)
+MIR_APP_DLL(void) KillModuleMenus(HPLUGIN pPlugin)
{
if (!bIsGenMenuInited)
return;
- KillMenuItemsParam param(_hLang);
+ KillMenuItemsParam param(pPlugin);
mir_cslock lck(csMenuHook);
for (auto &p : g_menus)
@@ -675,7 +675,7 @@ static int FindRoot(TMO_IntMenuItem *pimi, void *param) return FALSE;
}
-MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int position, HANDLE hIcoLib, int _hLang)
+MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int position, HANDLE hIcoLib, HPLUGIN pPlugin)
{
mir_cslock lck(csMenuHook);
TIntMenuObject *pmo = GetMenuObjbyId(hMenuObject);
@@ -686,10 +686,10 @@ MIR_APP_DLL(HGENMENU) Menu_CreateRoot(int hMenuObject, LPCTSTR ptszName, int pos if (oldroot != nullptr)
return oldroot;
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
mi.hIcolibItem = hIcoLib;
- mi.langId = _hLang;
+ mi.pPlugin = pPlugin;
mi.name.w = (wchar_t*)ptszName;
mi.position = position;
return Menu_AddItem(hMenuObject, &mi, nullptr);
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index b73cdcc613..46fdc97adc 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -356,7 +356,7 @@ INT_PTR Meta_OnOff(WPARAM, LPARAM) void InitMenus()
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
// main menu item
SET_UID(mi, 0x8999a6ca, 0x9c66, 0x49c1, 0xad, 0xe1, 0x48, 0x17, 0x28, 0xb, 0x94, 0x86);
diff --git a/src/mir_app/src/meta_options.cpp b/src/mir_app/src/meta_options.cpp index 798af79448..91089df0d0 100644 --- a/src/mir_app/src/meta_options.cpp +++ b/src/mir_app/src/meta_options.cpp @@ -120,7 +120,7 @@ public: int Meta_OptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -790000000;
odp.flags = ODPF_BOLDGROUPS;
odp.szTitle.a = LPGEN("Metacontacts");
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 630502cda4..e6bd05338a 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -652,7 +652,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) sid.flags = MBF_UNICODE;
sid.tszTooltip = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
- Srmm_AddIcon(&sid, g_plugin.m_hLang);
+ Srmm_AddIcon(&sid, &g_plugin);
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 52a7b20b21..2e182da0aa 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -104,7 +104,6 @@ Skin_GetIconName @24 ?setWString@PROTO_INTERFACE@@QAEXPBDPB_W@Z @107 NONAME
?setWord@PROTO_INTERFACE@@QAEXIPBDG@Z @108 NONAME
?setWord@PROTO_INTERFACE@@QAEXPBDG@Z @109 NONAME
-GetPluginLangByInstance @110
ProtoBroadcastAck @111
ProtoCreateHookableEvent @113
ProtoCreateService @114
@@ -592,7 +591,6 @@ Contact_GetStatus @609 ??0PROTOACCOUNT@@QAE@PBD@Z @621 NONAME
??1PROTOACCOUNT@@QAE@XZ @622 NONAME
?addSound@CMPluginBase@@QAEHPBDPB_W11@Z @623 NONAME
-GetPluginByLangId @624
GetInstByAddress @625
GetPluginByInstance @626
?addUserInfo@CMPluginBase@@QAEHIPAUOPTIONSDIALOGPAGE@@@Z @627 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 360fe8adea..4bfa9b9ce9 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -104,7 +104,6 @@ Skin_GetIconName @24 ?setWString@PROTO_INTERFACE@@QEAAXPEBDPEB_W@Z @107 NONAME
?setWord@PROTO_INTERFACE@@QEAAXIPEBDG@Z @108 NONAME
?setWord@PROTO_INTERFACE@@QEAAXPEBDG@Z @109 NONAME
-GetPluginLangByInstance @110
ProtoBroadcastAck @111
ProtoCreateHookableEvent @113
ProtoCreateService @114
@@ -592,7 +591,6 @@ Contact_GetStatus @609 ??0PROTOACCOUNT@@QEAA@PEBD@Z @621 NONAME
??1PROTOACCOUNT@@QEAA@XZ @622 NONAME
?addSound@CMPluginBase@@QEAAHPEBDPEB_W11@Z @623 NONAME
-GetPluginByLangId @624
GetInstByAddress @625
GetPluginByInstance @626
?addUserInfo@CMPluginBase@@QEAAH_KPEAUOPTIONSDIALOGPAGE@@@Z @627 NONAME
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index eeee17772d..b37abcea3b 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -83,8 +83,8 @@ void InitPathVar(void); /**** srmm.cpp *************************************************************************/
-void KillModuleSrmmIcons(int hLangpack);
-void KillModuleToolbarIcons(int hLangpack);
+void KillModuleSrmmIcons(HPLUGIN);
+void KillModuleToolbarIcons(HPLUGIN);
/**** utf.cpp **************************************************************************/
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index f00bf63fd7..7e23871cfd 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -66,7 +66,7 @@ static wchar_t* PrepareGroupName(wchar_t* str) static void AddGroupItem(HGENMENU hRoot, wchar_t* name, int pos, WPARAM param, bool checked)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
mi.root = hRoot;
mi.position = pos;
mi.name.w = PrepareGroupName(name);
@@ -133,7 +133,7 @@ void MTG_OnmodulesLoad() HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnContactMenuBuild);
CreateServiceFunction(MTG_MOVE, MTG_DOMOVE);
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x403c548, 0x4ac6, 0x4ced, 0xa7, 0x6c, 0x4e, 0xb9, 0xc8, 0xba, 0x94, 0x5);
mi.position = 100000;
mi.name.a = LPGEN("&Move to group");
diff --git a/src/mir_app/src/netlibopts.cpp b/src/mir_app/src/netlibopts.cpp index 4c8db2c1ce..3d2a8320c9 100644 --- a/src/mir_app/src/netlibopts.cpp +++ b/src/mir_app/src/netlibopts.cpp @@ -507,9 +507,8 @@ int NetlibOptInitialise(WPARAM wParam, LPARAM) if (optionsCount == 0)
return 0;
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 900000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NETLIB);
odp.szTitle.a = LPGEN("Network");
odp.pfnDlgProc = DlgProcNetlibOpts;
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index c2fb0e475b..0eee4d52c2 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -274,20 +274,17 @@ bool Plugin_UnloadDyn(pluginEntry *p) KillModuleServices(hInst);
}
- int _hLang = ppb->m_hLang;
- if (_hLang != 0) {
- KillModuleMenus(_hLang);
- KillModuleFonts(_hLang);
- KillModuleColours(_hLang);
- KillModuleEffects(_hLang);
- KillModuleIcons(_hLang);
- KillModuleHotkeys(_hLang);
- KillModuleSounds(_hLang);
- KillModuleExtraIcons(_hLang);
- KillModuleSrmmIcons(_hLang);
- KillModuleToolbarIcons(_hLang);
- KillModuleOptions(_hLang);
- }
+ KillModuleMenus(ppb);
+ KillModuleFonts(ppb);
+ KillModuleColours(ppb);
+ KillModuleEffects(ppb);
+ KillModuleIcons(ppb);
+ KillModuleHotkeys(ppb);
+ KillModuleSounds(ppb);
+ KillModuleExtraIcons(ppb);
+ KillModuleSrmmIcons(ppb);
+ KillModuleToolbarIcons(ppb);
+ KillModuleOptions(ppb);
NotifyFastHook(hevUnloadModule, (WPARAM)&ppb->getInfo(), (LPARAM)ppb->getInst());
@@ -732,7 +729,6 @@ int LoadNewPluginsModule(void) Plugin_Uninit(it);
HookEvent(ME_OPT_INITIALISE, PluginOptionsInit);
- HookEvent(ME_LANGPACK_CHANGED, PluginsLoadLangpack);
return 0;
}
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index ddd93d997f..f6238af1f3 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -199,14 +199,16 @@ struct OptionsPageData : public MZeroedObject {
OptionsPageData(const OPTIONSDIALOGPAGE &src)
{
- if (src.hInstance != nullptr && src.pszTemplate != nullptr)
- pDialog = new COptionPageDialog(::GetPluginByInstance(src.hInstance), (INT_PTR)src.pszTemplate, src.pfnDlgProc, src.dwInitParam);
+ if (src.pszTemplate != nullptr) {
+ CMPluginBase *p = (CMPluginBase*)src.pPlugin;
+ pDialog = new COptionPageDialog(*p, (INT_PTR)src.pszTemplate, src.pfnDlgProc, src.dwInitParam);
+ }
else
pDialog = src.pDialog;
assert(pDialog != nullptr);
flags = src.flags;
- langId = src.langId;
+ pPlugin = src.pPlugin;
if (src.flags & ODPF_UNICODE)
ptszTitle = mir_wstrdup(src.szTitle.w);
@@ -231,7 +233,7 @@ struct OptionsPageData : public MZeroedObject }
CDlgBase *pDialog;
- int langId;
+ HPLUGIN pPlugin;
ptrW ptszTitle, ptszGroup, ptszTab;
HTREEITEM hTreeItem;
bool bChanged, bInsideTab;
@@ -246,7 +248,7 @@ struct OptionsPageData : public MZeroedObject {
if (flags & ODPF_DONTTRANSLATE)
return ptszStr;
- return TranslateW_LP(ptszStr, langId);
+ return TranslateW_LP(ptszStr, pPlugin);
}
HWND CreateOptionWindow(HWND hWndParent) const
@@ -565,9 +567,9 @@ class COptionsDlg : public CDlgBase continue;
opd = m_arOpd[i];
- wchar_t *ptszGroup = TranslateW_LP(opd->ptszGroup, opd->langId);
+ wchar_t *ptszGroup = TranslateW_LP(opd->ptszGroup, opd->pPlugin);
wchar_t *ptszTitle = opd->getString(opd->ptszTitle), *useTitle;
- wchar_t *ptszTab = TranslateW_LP(opd->ptszTab, opd->langId);
+ wchar_t *ptszTab = TranslateW_LP(opd->ptszTab, opd->pPlugin);
tvis.hParent = nullptr;
useTitle = ptszTitle;
@@ -987,7 +989,7 @@ public: if (mir_wstrcmp(opd->ptszTitle, p->ptszTitle) || mir_wstrcmp(opd->ptszGroup, p->ptszGroup))
continue;
- tie.pszText = TranslateW_LP(p->ptszTab, p->langId);
+ tie.pszText = TranslateW_LP(p->ptszTab, p->pPlugin);
tie.lParam = i;
TabCtrl_InsertItem(hwndTab, pages, &tie);
if (!mir_wstrcmp(opd->ptszTab, p->ptszTab))
@@ -1106,18 +1108,18 @@ public: RebuildPageTree();
}
- void Locate(const wchar_t *pszGroup, const wchar_t *pszPage, int _hLang)
+ void Locate(const wchar_t *pszGroup, const wchar_t *pszPage, HPLUGIN pPlugin)
{
ShowWindow(GetHwnd(), SW_RESTORE);
SetForegroundWindow(m_hwnd);
if (pszPage != nullptr) {
HTREEITEM hItem = nullptr;
if (pszGroup != nullptr) {
- hItem = FindNamedTreeItem(nullptr, TranslateW_LP(pszGroup, _hLang));
+ hItem = FindNamedTreeItem(nullptr, TranslateW_LP(pszGroup, pPlugin));
if (hItem != nullptr)
- hItem = FindNamedTreeItem(hItem, TranslateW_LP(pszPage, _hLang));
+ hItem = FindNamedTreeItem(hItem, TranslateW_LP(pszPage, pPlugin));
}
- else hItem = FindNamedTreeItem(nullptr, TranslateW_LP(pszPage, _hLang));
+ else hItem = FindNamedTreeItem(nullptr, TranslateW_LP(pszPage, pPlugin));
if (hItem != nullptr)
m_pageTree.SelectItem(hItem);
@@ -1138,10 +1140,10 @@ public: }
}
- void KillModule(int _hLang)
+ void KillModule(HPLUGIN pPlugin)
{
for (auto &opd : m_arOpd) {
- if (opd->langId != _hLang)
+ if (opd->pPlugin != pPlugin)
continue;
if (opd->pDialog != nullptr) {
@@ -1173,7 +1175,7 @@ void OpenAccountOptions(PROTOACCOUNT *pa) pOptionsDlg->Show();
}
-static void OpenOptionsNow(int _hLang, const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, bool bSinglePage)
+static void OpenOptionsNow(HPLUGIN pPlugin, const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, bool bSinglePage)
{
if (pOptionsDlg == nullptr) {
OptionsPageList arPages(1);
@@ -1184,24 +1186,24 @@ static void OpenOptionsNow(int _hLang, const wchar_t *pszGroup, const wchar_t *p pOptionsDlg = new COptionsDlg(TranslateT("Miranda NG options"), pszGroup, pszPage, pszTab, bSinglePage, arPages);
pOptionsDlg->Show();
}
- else pOptionsDlg->Locate(pszGroup, pszPage, _hLang);
+ else pOptionsDlg->Locate(pszGroup, pszPage, pPlugin);
}
-MIR_APP_DLL(int) Options_Open(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, int _hLangpack)
+MIR_APP_DLL(int) Options_Open(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, HPLUGIN pPlugin)
{
- OpenOptionsNow(_hLangpack, pszGroup, pszPage, pszTab, false);
+ OpenOptionsNow(pPlugin, pszGroup, pszPage, pszTab, false);
return 0;
}
-MIR_APP_DLL(HWND) Options_OpenPage(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, int _hLangpack)
+MIR_APP_DLL(HWND) Options_OpenPage(const wchar_t *pszGroup, const wchar_t *pszPage, const wchar_t *pszTab, HPLUGIN pPlugin)
{
- OpenOptionsNow(_hLangpack, pszGroup, pszPage, pszTab, true);
+ OpenOptionsNow(pPlugin, pszGroup, pszPage, pszTab, true);
return pOptionsDlg->GetHwnd();
}
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, int langId)
+MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, HPLUGIN pPlugin)
{
OptionsPageList *pList = (OptionsPageList*)wParam;
if (odp == nullptr)
@@ -1209,7 +1211,7 @@ MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, int lang OptionsPage *dst = new OptionsPage();
memcpy(dst, odp, sizeof(OPTIONSDIALOGPAGE));
- dst->langId = langId;
+ dst->pPlugin = pPlugin;
if (odp->szTitle.w != nullptr) {
if (odp->flags & ODPF_UNICODE)
@@ -1251,10 +1253,10 @@ MIR_APP_DLL(int) Options_AddPage(WPARAM wParam, OPTIONSDIALOGPAGE *odp, int lang /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleOptions(int _hLang)
+MIR_APP_DLL(void) KillModuleOptions(HPLUGIN pPlugin)
{
if (pOptionsDlg != nullptr)
- pOptionsDlg->KillModule(_hLang);
+ pOptionsDlg->KillModule(pPlugin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1274,7 +1276,7 @@ static int OptDynamicLoadOptions(WPARAM, LPARAM hInstance) static int OptModulesLoaded(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xc1284523, 0x548d, 0x4744, 0xb0, 0x9, 0xfb, 0xa0, 0x4, 0x8e, 0xa8, 0x67);
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index 48e29fd535..96b1f8e01d 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -539,7 +539,7 @@ public: m_plugList.GetItemText(hdr->iItem, 2, buf, _countof(buf));
SetDlgItemText(m_hwnd, IDC_PLUGININFOFRAME, sel ? buf : L"");
m_author.SetText(sel ? dat->author : L"");
- m_plugInfo.SetText(sel ? TranslateW_LP(dat->description, GetPluginLangByInstance(dat->hInst)) : L"");
+ m_plugInfo.SetText(sel ? TranslateW_LP(dat->description, &GetPluginByInstance(dat->hInst)) : L"");
m_copyright.SetText(sel ? dat->copyright : L"");
szUrl = sel ? _T2A(dat->homepage) : "";
@@ -561,8 +561,7 @@ public: int PluginOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_plugin.getInst();
+ OPTIONSDIALOGPAGE odp = {};
odp.pDialog = new CPluginOptDlg();
odp.position = 1300000000;
odp.szTitle.a = LPGEN("Plugins");
diff --git a/src/mir_app/src/plugins.h b/src/mir_app/src/plugins.h index 26cd0596e6..ff0764fd2f 100644 --- a/src/mir_app/src/plugins.h +++ b/src/mir_app/src/plugins.h @@ -57,7 +57,6 @@ extern LIST<pluginEntry> pluginList, servicePlugins, clistPlugins; extern MUUID miid_last;
int PluginOptionsInit(WPARAM, LPARAM);
-int PluginsLoadLangpack(WPARAM, LPARAM);
void LoadPluginOptions();
void UnloadPluginOptions();
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp index 85e7aa0947..875ff4882f 100644 --- a/src/mir_app/src/proto_opts.cpp +++ b/src/mir_app/src/proto_opts.cpp @@ -977,7 +977,7 @@ static INT_PTR OptProtosShow(WPARAM, LPARAM) int OptProtosLoaded(WPARAM, LPARAM)
{
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0xb1f74008, 0x1fa6, 0x4e98, 0x95, 0x28, 0x5a, 0x7e, 0xab, 0xfe, 0x10, 0x61);
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_ACCMGR);
mi.position = 1900000000;
diff --git a/src/mir_app/src/proto_order.cpp b/src/mir_app/src/proto_order.cpp index a8f9017f45..462c9eb9e1 100644 --- a/src/mir_app/src/proto_order.cpp +++ b/src/mir_app/src/proto_order.cpp @@ -224,7 +224,7 @@ public: int ProtocolOrderOptInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -10000000;
odp.szTitle.a = LPGEN("Accounts");
odp.szGroup.a = LPGEN("Contact list");
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index 8dff65dc03..4bd1b3da0e 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -122,7 +122,7 @@ static int __cdecl ProtoPrebuildContactMenu(WPARAM, LPARAM) void InitProtoMenus(void)
{
// "Request authorization"
- CMenuItem mi(g_plugin);
+ CMenuItem mi(&g_plugin);
SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
mi.pszService = "Proto/Menu/ReqAuth";
mi.name.a = LPGEN("Request authorization");
diff --git a/src/mir_app/src/skin.h b/src/mir_app/src/skin.h index d44b75c3e0..6f034e3220 100644 --- a/src/mir_app/src/skin.h +++ b/src/mir_app/src/skin.h @@ -44,7 +44,7 @@ struct THotkeyItem LPARAM lParam;
WORD DefHotkey, Hotkey;
bool Enabled;
- int hLangpack;
+ HPLUGIN pPlugin;
ATOM idHotkey;
THotkeyItem *rootHotkey;
@@ -60,8 +60,8 @@ struct THotkeyItem __inline char* getName() const { return (rootHotkey) ? rootHotkey->pszName : pszName; }
- __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
- __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, pPlugin); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, pPlugin); }
};
extern LIST<THotkeyItem> hotkeys;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index 6347d5347c..73302ecf22 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -939,7 +939,7 @@ INT_PTR CIconImportDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) int SkinOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.flags = ODPF_BOLDGROUPS;
odp.position = -180000000;
odp.pDialog = new CIcoLibOptsDlg();
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp index 88d95c2be1..607f8f1eb7 100644 --- a/src/mir_app/src/sounds.cpp +++ b/src/mir_app/src/sounds.cpp @@ -32,10 +32,10 @@ struct SoundItem ptrW pwszSection;
ptrW pwszDescription;
ptrW ptszTempFile;
- int hLangpack;
+ HPLUGIN pPlugin;
- __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, hLangpack); }
- __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, hLangpack); }
+ __inline wchar_t* getSection() const { return TranslateW_LP(pwszSection, pPlugin); }
+ __inline wchar_t* getDescr() const { return TranslateW_LP(pwszDescription, pPlugin); }
};
static int CompareSounds(const SoundItem* p1, const SoundItem* p2)
@@ -47,11 +47,11 @@ static OBJLIST<SoundItem> arSounds(10, CompareSounds); /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleSounds(int _hLang)
+MIR_APP_DLL(void) KillModuleSounds(HPLUGIN pPlugin)
{
auto T = arSounds.rev_iter();
for (auto &it : T)
- if (it->hLangpack == _hLang)
+ if (it->pPlugin == pPlugin)
arSounds.remove(T.indexOf(&it));
}
@@ -67,7 +67,7 @@ int CMPluginBase::addSound(const char *pszName, const wchar_t *pwszSection, cons SoundItem *item = new SoundItem; // due to OBJLIST
item->name = mir_strdup(pszName);
item->ptszTempFile = nullptr;
- item->hLangpack = m_hLang;
+ item->pPlugin = this;
arSounds.insert(item);
item->pwszDescription = mir_wstrdup(pwszDescription);
@@ -434,9 +434,8 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM static int SkinOptionsInit(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -200000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SOUND);
odp.szTitle.a = LPGEN("Sounds");
odp.pfnDlgProc = DlgProcSoundOpts;
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp index 72e3a4f936..b3d15efa68 100644 --- a/src/mir_app/src/srmm_statusicon.cpp +++ b/src/mir_app/src/srmm_statusicon.cpp @@ -67,7 +67,7 @@ struct StatusIconMain : public MZeroedObject StatusIconData sid;
- int hLangpack;
+ HPLUGIN pPlugin;
OBJLIST<StatusIconChild> arChildren;
};
@@ -84,7 +84,7 @@ static OBJLIST<StatusIconMain> arIcons(3, CompareIcons); /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, int _hLangpack)
+MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, HPLUGIN pPlugin)
{
if (sid == nullptr)
return 1;
@@ -95,7 +95,7 @@ MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, int _hLangpack) p = new StatusIconMain;
memcpy(&p->sid, sid, sizeof(p->sid));
- p->hLangpack = _hLangpack;
+ p->pPlugin = pPlugin;
p->sid.szModule = mir_strdup(sid->szModule);
if (sid->flags & MBF_UNICODE)
p->sid.tszTooltip = mir_wstrdup(sid->wszTooltip);
@@ -185,7 +185,7 @@ MIR_APP_DLL(StatusIconData*) Srmm_GetNthIcon(MCONTACT hContact, int index) if (pc->tszTooltip) res.tszTooltip = pc->tszTooltip;
res.flags = pc->flags;
}
- res.tszTooltip = TranslateW_LP(res.tszTooltip, it->hLangpack);
+ res.tszTooltip = TranslateW_LP(res.tszTooltip, it->pPlugin);
return &res;
}
nVis++;
@@ -203,11 +203,11 @@ MIR_APP_DLL(void) Srmm_ClickStatusIcon(MCONTACT hContact, const StatusIconClickD /////////////////////////////////////////////////////////////////////////////////////////
-void KillModuleSrmmIcons(int _hLang)
+void KillModuleSrmmIcons(HPLUGIN pPlugin)
{
auto T = arIcons.rev_iter();
for (auto &it : T)
- if (it->hLangpack == _hLang)
+ if (it->pPlugin == pPlugin)
arIcons.remove(T.indexOf(&it));
}
diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index 9f8f3e3aa1..bb4c076db0 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -65,7 +65,7 @@ static void CB_RegisterSeparators() bbd.bbbFlags = BBBF_ISSEPARATOR | BBBF_ISIMBUTTON; bbd.dwButtonID = i + 1; bbd.dwDefPos = 410 + i; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); } } @@ -79,7 +79,7 @@ MIR_APP_DLL(int) Srmm_GetButtonCount(void) return arButtonsList.getCount(); } -MIR_APP_DLL(HANDLE) Srmm_AddButton(const BBButton *bbdi, int _hLang) +MIR_APP_DLL(HANDLE) Srmm_AddButton(const BBButton *bbdi, HPLUGIN _hLang) { if (bbdi == nullptr) return nullptr; @@ -99,7 +99,7 @@ MIR_APP_DLL(HANDLE) Srmm_AddButton(const BBButton *bbdi, int _hLang) cbd->m_bDisabled = (bbdi->bbbFlags & BBBF_DISABLED) != 0; cbd->m_bPushButton = (bbdi->bbbFlags & BBBF_ISPUSHBUTTON) != 0; - cbd->m_iLangId = _hLang; + cbd->m_pPlugin = _hLang; cbd->m_dwOrigFlags.bit1 = cbd->m_bRSided = (bbdi->bbbFlags & BBBF_ISRSIDEBUTTON) != 0; cbd->m_dwOrigFlags.bit2 = cbd->m_bIMButton = (bbdi->bbbFlags & BBBF_ISIMBUTTON) != 0; @@ -687,7 +687,7 @@ public: bbd.bbbFlags = BBBF_ISSEPARATOR | BBBF_ISIMBUTTON; bbd.dwButtonID = ++dwSepCount; - CustomButtonData *cbd = (CustomButtonData*)Srmm_AddButton(&bbd, g_plugin.m_hLang); + CustomButtonData *cbd = (CustomButtonData*)Srmm_AddButton(&bbd, &g_plugin); TVINSERTSTRUCT tvis; tvis.hParent = nullptr; @@ -772,7 +772,7 @@ public: static int SrmmOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; odp.szGroup.a = LPGEN("Message sessions"); odp.szTitle.a = LPGEN("Toolbar"); @@ -784,11 +784,11 @@ static int SrmmOptionsInit(WPARAM wParam, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -void KillModuleToolbarIcons(int _hLang) +void KillModuleToolbarIcons(HPLUGIN pPlugin) { auto T = arButtonsList.rev_iter(); for (auto &cbd : T) - if (cbd->m_iLangId == _hLang) { + if (cbd->m_pPlugin == pPlugin) { delete cbd; arButtonsList.remove(T.indexOf(&cbd)); } diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp index fee552ce8e..e3d673e7ad 100644 --- a/src/mir_app/src/visibility.cpp +++ b/src/mir_app/src/visibility.cpp @@ -271,9 +271,8 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP static int VisibilityOptInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
+ OPTIONSDIALOGPAGE odp = {};
odp.position = 850000000;
- odp.hInstance = g_plugin.getInst();
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_VISIBILITY);
odp.szTitle.a = LPGEN("Visibility");
odp.szGroup.a = LPGEN("Contacts");
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp index 6bf0b703b4..bdf7ad78a9 100644 --- a/src/mir_core/src/CDlgBase.cpp +++ b/src/mir_core/src/CDlgBase.cpp @@ -203,7 +203,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) { case WM_INITDIALOG: m_initialized = false; - TranslateDialog_LP(m_hwnd, GetPluginLangByInstance(m_pPlugin.getInst())); + TranslateDialog_LP(m_hwnd, &m_pPlugin); ::EnumChildWindows(m_hwnd, &GlobalFieldEnum, LPARAM(this)); diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index df3f14af9b..be3fa97ae1 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, const char *prefix, int _hLang)
+MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconItem *pIcons, size_t iCount, const char *prefix, HPLUGIN pPlugin)
{
wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
@@ -44,11 +44,11 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte sid.cx = sid.cy = pIcons[i].size;
sid.description.a = pIcons[i].szDescr;
sid.iDefaultIndex = -pIcons[i].defIconID;
- pIcons[i].hIcolib = IcoLib_AddIcon(&sid, _hLang);
+ pIcons[i].hIcolib = IcoLib_AddIcon(&sid, pPlugin);
}
}
-MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, const char *prefix, int _hLang)
+MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, IconItemT *pIcons, size_t iCount, const char *prefix, HPLUGIN pPlugin)
{
wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
@@ -69,6 +69,6 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const wchar_t *szSection, Ico sid.cx = sid.cy = pIcons[i].size;
sid.description.w = pIcons[i].tszDescr;
sid.iDefaultIndex = -pIcons[i].defIconID;
- pIcons[i].hIcolib = IcoLib_AddIcon(&sid, _hLang);
+ pIcons[i].hIcolib = IcoLib_AddIcon(&sid, pPlugin);
}
}
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 22c19a8552..1d139b67dd 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -142,6 +142,14 @@ static unsigned int __fastcall hashstrW(const char *key) return mir_hash(buf, len);
}
+static const MUUID* GetMuid(HPLUGIN pPlugin)
+{
+ if (!pPlugin)
+ return nullptr;
+
+ return &pPlugin->getInfo().uuid;
+}
+
static int SortLangPackHashesProc(LangPackEntry *arg1, LangPackEntry *arg2)
{
if (arg1->englishHash < arg2->englishHash) return -1;
@@ -455,7 +463,7 @@ static int SortLangPackHashesProc2(LangPackEntry *arg1, LangPackEntry *arg2) return 0;
}
-char* LangPackTranslateString(MUUID *pUuid, const char *szEnglish, const int W)
+char* LangPackTranslateString(const MUUID *pUuid, const char *szEnglish, const int W)
{
if (g_entryCount == 0 || szEnglish == nullptr)
return (char*)szEnglish;
@@ -508,19 +516,19 @@ MIR_CORE_DLL(wchar_t*) Langpack_PcharToTchar(const char *pszStr) /////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int _hLangpack)
+MIR_CORE_DLL(char*) TranslateA_LP(const char *str, HPLUGIN pPlugin)
{
- return (char*)LangPackTranslateString(Langpack_LookupUuid(_hLangpack), str, FALSE);
+ return (char*)LangPackTranslateString(GetMuid(pPlugin), str, FALSE);
}
-MIR_CORE_DLL(WCHAR*) TranslateW_LP(const WCHAR *str, int _hLangpack)
+MIR_CORE_DLL(WCHAR*) TranslateW_LP(const WCHAR *str, HPLUGIN pPlugin)
{
- return (WCHAR*)LangPackTranslateString(Langpack_LookupUuid(_hLangpack), (LPCSTR)str, TRUE);
+ return (WCHAR*)LangPackTranslateString(GetMuid(pPlugin), (LPCSTR)str, TRUE);
}
-MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack)
+MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, HPLUGIN pPlugin)
{
- MUUID *uuid = Langpack_LookupUuid(_hLangpack);
+ const MUUID *uuid = &pPlugin->getInfo().uuid;
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -542,11 +550,11 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack) }
if (mii.hSubMenu != nullptr)
- TranslateMenu_LP(mii.hSubMenu, _hLangpack);
+ TranslateMenu_LP(mii.hSubMenu, pPlugin);
}
}
-static void TranslateWindow(MUUID *pUuid, HWND hwnd)
+static void TranslateWindow(const MUUID *pUuid, HWND hwnd)
{
wchar_t title[2048];
GetWindowText(hwnd, title, _countof(title));
@@ -558,8 +566,8 @@ static void TranslateWindow(MUUID *pUuid, HWND hwnd) static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam)
{
- int _hLangpack = (int)lParam;
- MUUID *uuid = Langpack_LookupUuid(_hLangpack);
+ HPLUGIN pPlugin = (HPLUGIN)lParam;
+ const MUUID *uuid = GetMuid(pPlugin);
wchar_t szClass[32];
GetClassName(hwnd, szClass, _countof(szClass));
@@ -572,29 +580,14 @@ static BOOL CALLBACK TranslateDialogEnumProc(HWND hwnd, LPARAM lParam) return TRUE;
}
-MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, int _hLangpack)
+MIR_CORE_DLL(void) TranslateDialog_LP(HWND hDlg, HPLUGIN pPlugin)
{
- TranslateWindow(Langpack_LookupUuid(_hLangpack), hDlg);
- EnumChildWindows(hDlg, TranslateDialogEnumProc, _hLangpack);
+ TranslateWindow(GetMuid(pPlugin), hDlg);
+ EnumChildWindows(hDlg, TranslateDialogEnumProc, (LPARAM)pPlugin);
}
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(MUUID*) Langpack_LookupUuid(WPARAM wParam)
-{
- int idx = (wParam >> 16) & 0xFFFF;
- return (idx > 0 && idx <= lMuuids.getCount()) ? lMuuids[idx - 1] : nullptr;
-}
-
-MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(const MUUID &uuid)
-{
- int idx = lMuuids.getIndex((MUUID*)&uuid);
- if (idx == -1)
- return 0;
-
- return (idx + 1) << 16;
-}
-
MIR_CORE_DLL(void) Langpack_SortDuplicates(void)
{
if (g_entryCount == 0)
@@ -683,14 +676,6 @@ void GetDefaultLang() /////////////////////////////////////////////////////////////////////////////////////////
-MIR_CORE_DLL(void) mir_getLP(const PLUGININFOEX *pInfo, int *_hLang)
-{
- if (_hLang && pInfo)
- *(int*)_hLang = GetPluginLangId(pInfo->uuid, Langpack_MarkPluginLoaded(pInfo->uuid));
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
MIR_CORE_DLL(void) ReloadLangpack(wchar_t *pszStr)
{
if (pszStr == nullptr)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 3c0afec46b..5fafb02730 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1,8 +1,6 @@ LIBRARY mir_core.mir
EXPORTS
-Langpack_LookupUuid @3
-Langpack_MarkPluginLoaded @4
CallFunctionAsync @5
CallPluginEventHook @7
CallService @8
@@ -923,7 +921,6 @@ WindowList_Remove @1108 Utils_AssertInsideScreen @1110
Utils_RestoreWindowPosition @1111
Utils_SaveWindowPosition @1112
-mir_getLP @1113
TimeZone_CreateByContact @1114
TimeZone_CreateByName @1115
TimeZone_GetDescription @1116
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 05064e9e3b..8b92b73dec 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1,8 +1,6 @@ LIBRARY mir_core.mir
EXPORTS
-Langpack_LookupUuid @3
-Langpack_MarkPluginLoaded @4
CallFunctionAsync @5
CallPluginEventHook @7
CallService @8
@@ -923,7 +921,6 @@ WindowList_Remove @1108 Utils_AssertInsideScreen @1110
Utils_RestoreWindowPosition @1111
Utils_SaveWindowPosition @1112
-mir_getLP @1113
TimeZone_CreateByContact @1114
TimeZone_CreateByName @1115
TimeZone_GetDescription @1116
diff --git a/src/mir_core/src/miranda.h b/src/mir_core/src/miranda.h index ceaa486314..ed4e37015b 100644 --- a/src/mir_core/src/miranda.h +++ b/src/mir_core/src/miranda.h @@ -24,12 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
-extern "C"
-{
- MIR_CORE_DLL(int) Langpack_MarkPluginLoaded(const MUUID &uuid);
- MIR_CORE_DLL(MUUID*) Langpack_LookupUuid(WPARAM wParam);
-};
-
void UnloadLangPackModule(void);
int InitialiseModularEngine(void);
@@ -86,7 +80,7 @@ extern LIST<CMPluginBase> pluginListAddr; /////////////////////////////////////////////////////////////////////////////////////////
// langpack.cpp
-char* LangPackTranslateString(MUUID *pUuid, const char *szEnglish, const int W);
+char* LangPackTranslateString(const MUUID *pUuid, const char *szEnglish, const int W);
/////////////////////////////////////////////////////////////////////////////////////////
// threads.cpp
|