summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-11 18:58:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-11 18:58:29 +0300
commit13c65091dba7803ddc8b604732d3cf3e8cb2fe5d (patch)
tree77d39ba8d777f24c022d9141fa709165a2e802da
parent70ff82fd507835546c5f9a54e593f8868ab50891 (diff)
PS_CREATEACCMGRUI is obsoleted and converted into event
-rw-r--r--include/m_protoint.h3
-rw-r--r--include/m_protosvc.h11
-rw-r--r--libs/win32/mir_app.libbin236612 -> 237018 bytes
-rw-r--r--libs/win64/mir_app.libbin233528 -> 233948 bytes
-rw-r--r--protocols/CloudFile/src/cloud_file.cpp8
-rw-r--r--protocols/CloudFile/src/cloud_file.h6
-rw-r--r--protocols/Discord/src/options.cpp6
-rw-r--r--protocols/Discord/src/proto.cpp4
-rw-r--r--protocols/Discord/src/proto.h2
-rw-r--r--protocols/Dummy/src/dummy_options.cpp4
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp2
-rw-r--r--protocols/Dummy/src/dummy_proto.h4
-rw-r--r--protocols/Facebook/src/proto.cpp5
-rw-r--r--protocols/Facebook/src/proto.h2
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp7
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp1
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h2
-rw-r--r--protocols/Gadu-Gadu/src/services.cpp11
-rw-r--r--protocols/ICQ-WIM/src/options.cpp6
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp2
-rw-r--r--protocols/ICQ-WIM/src/proto.h2
-rw-r--r--protocols/IRCG/src/ircproto.cpp1
-rw-r--r--protocols/IRCG/src/ircproto.h2
-rw-r--r--protocols/IRCG/src/options.cpp6
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp6
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.h2
-rw-r--r--protocols/MinecraftDynmap/src/proto.cpp6
-rw-r--r--protocols/MinecraftDynmap/src/proto.h4
-rw-r--r--protocols/Omegle/src/proto.cpp7
-rw-r--r--protocols/Omegle/src/proto.h4
-rw-r--r--protocols/SkypeWeb/src/skype_options.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp1
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h3
-rw-r--r--protocols/Steam/src/steam_options.cpp6
-rw-r--r--protocols/Steam/src/steam_proto.cpp2
-rw-r--r--protocols/Steam/src/steam_proto.h2
-rw-r--r--protocols/Telegram/src/options.cpp6
-rw-r--r--protocols/Telegram/src/proto.cpp3
-rw-r--r--protocols/Telegram/src/proto.h21
-rw-r--r--protocols/Tox/src/tox_accounts.cpp4
-rw-r--r--protocols/Tox/src/tox_proto.cpp2
-rw-r--r--protocols/Tox/src/tox_proto.h3
-rw-r--r--protocols/Twitter/src/proto.cpp6
-rw-r--r--protocols/Twitter/src/proto.h2
-rw-r--r--protocols/VKontakte/src/vk_options.cpp6
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp1
-rw-r--r--protocols/VKontakte/src/vk_proto.h2
-rw-r--r--protocols/WhatsApp/src/options.cpp6
-rw-r--r--protocols/WhatsApp/src/proto.cpp2
-rw-r--r--protocols/WhatsApp/src/proto.h5
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/proto_interface.cpp5
-rw-r--r--src/mir_app/src/proto_opts.cpp7
55 files changed, 91 insertions, 140 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 184d36d4c5..ed8b0f907f 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -258,6 +258,9 @@ public:
// called when an account's contact is deleted
virtual void OnContactDeleted(MCONTACT);
+ // called when the Account Manager needs to draw short account's options
+ virtual MWindow OnCreateAccMgrUI(MWindow hwndParent);
+
// called when an event is altered in database
virtual void OnEventEdited(MCONTACT, MEVENT);
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index 031622a3a5..32fcc8bc7b 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -291,17 +291,6 @@ static __inline unsigned long Proto_Status2Flag(int status)
#define PS_AUTHDENY "/AuthDeny"
///////////////////////////////////////////////////////////////////////////////
-// Create account manager UI form
-// wParam = 0
-// lParam = (LPARAM)(HWND)hwndAccMgr
-// Returns handle on newly created form.
-// Size for best fit is 186x134 DLUs, please avoid groupboxes
-// paddind and advanced options. This should provide minimal setup
-// for initial connect.
-
-#define PS_CREATEACCMGRUI "/CreateAccMgrUI"
-
-///////////////////////////////////////////////////////////////////////////////
// Send a basic search request
// wParam = 0
// lParam = (LPARAM)(const wchar_t*)szId
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 9962c6a371..4f09e3492e 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 91c52d10e6..a2b5e64bba 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/protocols/CloudFile/src/cloud_file.cpp b/protocols/CloudFile/src/cloud_file.cpp
index 81e2c37a2b..8674789126 100644
--- a/protocols/CloudFile/src/cloud_file.cpp
+++ b/protocols/CloudFile/src/cloud_file.cpp
@@ -9,8 +9,6 @@ CCloudService::CCloudService(const char *protoName, const wchar_t *userName, HPL
nlu.szSettingsModule = (char*)protoName;
nlu.szDescriptiveName.w = (wchar_t*)userName;
m_hConnection = Netlib_RegisterUser(&nlu);
-
- CreateProtoService(PS_CREATEACCMGRUI, &CCloudService::OnAccountManagerInit);
}
CCloudService::~CCloudService()
@@ -86,12 +84,12 @@ void CCloudService::OpenUploadDialog(MCONTACT hContact)
SetActiveWindow(it->second);
}
-INT_PTR CCloudService::OnAccountManagerInit(WPARAM, LPARAM lParam)
+MWindow CCloudService::OnCreateAccMgrUI(MWindow hwndParent)
{
CAccountManagerDlg *page = new CAccountManagerDlg(this);
- page->SetParent((HWND)lParam);
+ page->SetParent(hwndParent);
page->Show();
- return (INT_PTR)page->GetHwnd();
+ return page->GetHwnd();
}
std::string CCloudService::PreparePath(const std::string &path) const
diff --git a/protocols/CloudFile/src/cloud_file.h b/protocols/CloudFile/src/cloud_file.h
index f02589c2bd..de053af431 100644
--- a/protocols/CloudFile/src/cloud_file.h
+++ b/protocols/CloudFile/src/cloud_file.h
@@ -14,8 +14,6 @@ protected:
HPLUGIN m_pPlugin;
HNETLIBUSER m_hConnection;
- INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
-
// utils
std::string PreparePath(const std::string &path) const;
@@ -24,7 +22,9 @@ protected:
virtual void HandleHttpError(NETLIBHTTPREQUEST *response);
virtual void HandleJsonError(JSONNode &node) = 0;
+ // events
void OnModulesLoaded() override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
JSONNode GetJsonResponse(NETLIBHTTPREQUEST *response);
@@ -40,7 +40,7 @@ public:
int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *msg, wchar_t **ppszFiles) override;
-
+
HPLUGIN GetId() const;
virtual const char* GetModuleName() const = 0;
const char* GetAccountName() const;
diff --git a/protocols/Discord/src/options.cpp b/protocols/Discord/src/options.cpp
index 3ced623311..4716584b96 100644
--- a/protocols/Discord/src/options.cpp
+++ b/protocols/Discord/src/options.cpp
@@ -77,12 +77,12 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR CDiscordProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent)
+MWindow CDiscordProto::OnCreateAccMgrUI(MWindow hwndParent)
{
CDiscardAccountOptions *pDlg = new CDiscardAccountOptions(this, IDD_OPTIONS_ACCMGR, false);
- pDlg->SetParent((HWND)hwndParent);
+ pDlg->SetParent(hwndParent);
pDlg->Create();
- return (INT_PTR)pDlg->GetHwnd();
+ return pDlg->GetHwnd();
}
int CDiscordProto::OnOptionsInit(WPARAM wParam, LPARAM)
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index f984595ff4..cf5bd0671f 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -56,8 +56,6 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) :
m_bSyncDeleteMsgs(this, "DeleteServerMsgs", true)
{
// Services
- CreateProtoService(PS_CREATEACCMGRUI, &CDiscordProto::SvcCreateAccMgrUI);
-
CreateProtoService(PS_GETAVATARINFO, &CDiscordProto::GetAvatarInfo);
CreateProtoService(PS_GETAVATARCAPS, &CDiscordProto::GetAvatarCaps);
CreateProtoService(PS_GETMYAVATAR, &CDiscordProto::GetMyAvatar);
@@ -597,7 +595,7 @@ void CDiscordProto::SendMarkRead()
}
}
-void CDiscordProto::OnMarkRead(MCONTACT hContact, MEVENT hDbEvent)
+void CDiscordProto::OnMarkRead(MCONTACT hContact, MEVENT)
{
if (m_bOnline) {
m_impl.m_markRead.Start(200);
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index 2c0bd0709a..dd69f60e20 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -377,6 +377,7 @@ public:
void OnBuildProtoMenu() override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
void OnShutdown() override;
@@ -385,7 +386,6 @@ public:
// Services
INT_PTR __cdecl RequestFriendship(WPARAM, LPARAM);
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
diff --git a/protocols/Dummy/src/dummy_options.cpp b/protocols/Dummy/src/dummy_options.cpp
index 3ceecc0225..37125777a7 100644
--- a/protocols/Dummy/src/dummy_options.cpp
+++ b/protocols/Dummy/src/dummy_options.cpp
@@ -114,7 +114,7 @@ INT_PTR CALLBACK DummyAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
return FALSE;
}
-INT_PTR CDummyProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow CDummyProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- return (INT_PTR)CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ACCMGRUI), (HWND)lParam, DummyAccountProc, (LPARAM)this);
+ return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ACCMGRUI), hwndParent, DummyAccountProc, (LPARAM)this);
}
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index 7ec308eb3e..8a67a9763d 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -68,8 +68,6 @@ static int sttCompareProtocols(const CDummyProto *p1, const CDummyProto *p2)
CDummyProto::CDummyProto(const char *szModuleName, const wchar_t *ptszUserName) :
PROTO<CDummyProto>(szModuleName, ptszUserName)
{
- CreateProtoService(PS_CREATEACCMGRUI, &CDummyProto::SvcCreateAccMgrUI);
-
msgid = 0;
int id = getTemplateId();
diff --git a/protocols/Dummy/src/dummy_proto.h b/protocols/Dummy/src/dummy_proto.h
index ffe2d4b9fc..d7836f7f64 100644
--- a/protocols/Dummy/src/dummy_proto.h
+++ b/protocols/Dummy/src/dummy_proto.h
@@ -38,9 +38,9 @@ struct CDummyProto : public PROTO<CDummyProto>
MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
- //==== Services ======================================================================
+ //==== Events ==========================================================================
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
+ MWindow OnCreateAccMgrUI(MWindow) override;
void __cdecl SearchIdAckThread(void*);
diff --git a/protocols/Facebook/src/proto.cpp b/protocols/Facebook/src/proto.cpp
index 82043fdf55..ab9a35a58a 100644
--- a/protocols/Facebook/src/proto.cpp
+++ b/protocols/Facebook/src/proto.cpp
@@ -297,8 +297,7 @@ int FacebookProto::UserIsTyping(MCONTACT hContact, int type)
//////////////////////////////////////////////////////////////////////////////
// Services
-INT_PTR FacebookProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow FacebookProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- return (INT_PTR) CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FACEBOOKACCOUNT),
- (HWND) lParam, FBAccountProc, (LPARAM) this);
+ return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FACEBOOKACCOUNT), hwndParent, FBAccountProc, (LPARAM)this);
}
diff --git a/protocols/Facebook/src/proto.h b/protocols/Facebook/src/proto.h
index 20d218b4b1..16a3cbd4c1 100644
--- a/protocols/Facebook/src/proto.h
+++ b/protocols/Facebook/src/proto.h
@@ -532,6 +532,7 @@ public:
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
////////////////////////////////////////////////////////////////////////////////////////
@@ -547,7 +548,6 @@ public:
INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
};
typedef CProtoDlgBase<FacebookProto> CFBDlgBase;
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index 656db1888a..02bfe9451e 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -71,7 +71,7 @@ void gg_optsdlgcheck(HWND m_hwnd)
////////////////////////////////////////////////////////////////////////////////////////////
// Proc: Account manager options dialog
-INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
GaduProto *gg = (GaduProto *)GetWindowLongPtr(m_hwnd, GWLP_USERDATA);
@@ -176,3 +176,8 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND m_hwnd, UINT msg, WPARAM wParam, LPA
}
return FALSE;
}
+
+MWindow GaduProto::OnCreateAccMgrUI(MWindow hwndParent)
+{
+ return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ACCMGRUI), hwndParent, gg_acc_mgr_guidlgproc, (LPARAM)this);
+}
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 3df051bdb6..44234ddb35 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -67,7 +67,6 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) :
CreateProtoService(PS_SETMYAVATAR, &GaduProto::setmyavatar);
CreateProtoService(PS_GETMYAWAYMSG, &GaduProto::getmyawaymsg);
- CreateProtoService(PS_CREATEACCMGRUI, &GaduProto::get_acc_mgr_gui);
CreateProtoService(PS_LEAVECHAT, &GaduProto::leavechat);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index 6142e92838..388fe907e0 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -58,6 +58,7 @@ struct GaduProto : public PROTO<GaduProto>
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnModulesLoaded() override;
void OnShutdown() override;
@@ -66,7 +67,6 @@ struct GaduProto : public PROTO<GaduProto>
INT_PTR __cdecl blockuser(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl getmyawaymsg(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl get_acc_mgr_gui(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl leavechat(WPARAM wParam, LPARAM lParam);
//////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp
index 15c7e14096..392e9b0d66 100644
--- a/protocols/Gadu-Gadu/src/services.cpp
+++ b/protocols/Gadu-Gadu/src/services.cpp
@@ -369,17 +369,6 @@ INT_PTR GaduProto::getmyawaymsg(WPARAM wParam, LPARAM lParam)
return res;
}
-extern INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-
-//////////////////////////////////////////////////////////
-// gets account manager GUI
-// registered as ProtoService PS_CREATEACCMGRUI
-//
-INT_PTR GaduProto::get_acc_mgr_gui(WPARAM, LPARAM lParam)
-{
- return (INT_PTR)CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ACCMGRUI), (HWND)lParam, gg_acc_mgr_guidlgproc, (LPARAM)this);
-}
-
//////////////////////////////////////////////////////////
// leaves (terminates) conference
// registered as ProtoService PS_LEAVECHAT
diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp
index 5f9d9ce5db..d5cd234cf4 100644
--- a/protocols/ICQ-WIM/src/options.cpp
+++ b/protocols/ICQ-WIM/src/options.cpp
@@ -366,12 +366,12 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
// Services
-INT_PTR CIcqProto::CreateAccMgrUI(WPARAM, LPARAM hwndParent)
+MWindow CIcqProto::OnCreateAccMgrUI(MWindow hwndParent)
{
COptionsDlg *pDlg = new COptionsDlg(this, IDD_OPTIONS_ACCMGR, false);
- pDlg->SetParent((HWND)hwndParent);
+ pDlg->SetParent(hwndParent);
pDlg->Create();
- return (INT_PTR)pDlg->GetHwnd();
+ return pDlg->GetHwnd();
}
int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM)
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 4f34d1c0ff..7a2c9d1002 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -63,8 +63,6 @@ CIcqProto::CIcqProto(const char *aProtoName, const wchar_t *aUserName) :
m_isMra = !stricmp(Proto_GetAccount(m_szModuleName)->szProtoName, "MRA");
// services
- CreateProtoService(PS_CREATEACCMGRUI, &CIcqProto::CreateAccMgrUI);
-
CreateProtoService(PS_GETAVATARCAPS, &CIcqProto::GetAvatarCaps);
CreateProtoService(PS_GETAVATARINFO, &CIcqProto::GetAvatarInfo);
CreateProtoService(PS_GETMYAVATAR, &CIcqProto::GetAvatar);
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index c184e02c8e..f36f6911ab 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -406,7 +406,6 @@ class CIcqProto : public PROTO<CIcqProto>
INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
INT_PTR __cdecl SetAvatar(WPARAM, LPARAM);
- INT_PTR __cdecl CreateAccMgrUI(WPARAM, LPARAM);
INT_PTR __cdecl EditGroups(WPARAM, LPARAM);
INT_PTR __cdecl EditProfile(WPARAM, LPARAM);
INT_PTR __cdecl GetEmailCount(WPARAM, LPARAM);
@@ -450,6 +449,7 @@ class CIcqProto : public PROTO<CIcqProto>
void OnBuildProtoMenu(void) override;
void OnContactAdded(MCONTACT) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnEventEdited(MCONTACT, MEVENT) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 205dab708d..3b807fea9d 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -41,7 +41,6 @@ CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) :
{
CreateProtoService(PS_GETMYAWAYMSG, &CIrcProto::GetMyAwayMsg);
- CreateProtoService(PS_CREATEACCMGRUI, &CIrcProto::SvcCreateAccMgrUI);
CreateProtoService(PS_JOINCHAT, &CIrcProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &CIrcProto::OnLeaveChat);
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h
index ee40589a8a..6614bf4df7 100644
--- a/protocols/IRCG/src/ircproto.h
+++ b/protocols/IRCG/src/ircproto.h
@@ -71,11 +71,11 @@ struct CIrcProto : public PROTO<CIrcProto>
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnModulesLoaded() override;
void OnShutdown() override;
// Services
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
INT_PTR __cdecl GetMyAwayMsg(WPARAM, LPARAM);
INT_PTR __cdecl OnChangeNickMenuCommand(WPARAM, LPARAM);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index c9be724a6a..4f3439540d 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -1352,11 +1352,11 @@ public:
}
};
-INT_PTR CIrcProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow CIrcProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- CDlgAccMgrUI *dlg = new CDlgAccMgrUI(this, (HWND)lParam);
+ CDlgAccMgrUI *dlg = new CDlgAccMgrUI(this, hwndParent);
dlg->Show();
- return (INT_PTR)dlg->GetHwnd();
+ return dlg->GetHwnd();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 5313e260fb..c516232099 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -1400,11 +1400,11 @@ private:
}
};
-INT_PTR CJabberProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow CJabberProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- CJabberDlgAccMgrUI *dlg = new CJabberDlgAccMgrUI(this, (HWND)lParam);
+ CJabberDlgAccMgrUI *dlg = new CJabberDlgAccMgrUI(this, hwndParent);
dlg->Show();
- return (INT_PTR)dlg->GetHwnd();
+ return dlg->GetHwnd();
}
INT_PTR __cdecl CJabberProto::OnMenuOptions(WPARAM, LPARAM)
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 6c425da2c4..a00e52b195 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -148,8 +148,6 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
m_hEventXStatusIconChanged = CreateProtoEvent(JE_CUSTOMSTATUS_EXTRAICON_CHANGED);
m_hEventXStatusChanged = CreateProtoEvent(JE_CUSTOMSTATUS_CHANGED);
- CreateProtoService(PS_CREATEACCMGRUI, &CJabberProto::SvcCreateAccMgrUI);
-
CreateProtoService(PS_GETAVATARINFO, &CJabberProto::JabberGetAvatarInfo);
CreateProtoService(PS_GETMYAWAYMSG, &CJabberProto::GetMyAwayMsg);
CreateProtoService(PS_SET_LISTENINGTO, &CJabberProto::OnSetListeningTo);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 9f5d8d5c0b..643b432bd0 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -150,12 +150,12 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
void OnShutdown() override;
//====| Services |====================================================================
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl JabberVOIP_call(WPARAM hContact, LPARAM);
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp
index f5c780a07a..69ffe75278 100644
--- a/protocols/MinecraftDynmap/src/proto.cpp
+++ b/protocols/MinecraftDynmap/src/proto.cpp
@@ -36,8 +36,6 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const wchar_t
CreateProtoService(PS_JOINCHAT, &MinecraftDynmapProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &MinecraftDynmapProto::OnLeaveChat);
- CreateProtoService(PS_CREATEACCMGRUI, &MinecraftDynmapProto::SvcCreateAccMgrUI);
-
HookProtoEvent(ME_GC_EVENT, &MinecraftDynmapProto::OnChatEvent);
// Create standard network connection
@@ -133,9 +131,9 @@ int MinecraftDynmapProto::SetStatus(int new_status)
//////////////////////////////////////////////////////////////////////////////
// EVENTS
-INT_PTR MinecraftDynmapProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow MinecraftDynmapProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- return (INT_PTR)CreateDialogParam(g_plugin.getInst(),MAKEINTRESOURCE(IDD_MinecraftDynmapACCOUNT), (HWND)lParam, MinecraftDynmapAccountProc, (LPARAM)this);
+ return CreateDialogParam(g_plugin.getInst(),MAKEINTRESOURCE(IDD_MinecraftDynmapACCOUNT), hwndParent, MinecraftDynmapAccountProc, (LPARAM)this);
}
void MinecraftDynmapProto::OnShutdown()
diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h
index 7cae90dae4..39a7b0e08f 100644
--- a/protocols/MinecraftDynmap/src/proto.h
+++ b/protocols/MinecraftDynmap/src/proto.h
@@ -47,11 +47,9 @@ public:
int SetStatus(int iNewStatus) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnShutdown() override;
- // Services
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
-
// Chat handling
int __cdecl OnChatEvent(WPARAM,LPARAM);
INT_PTR __cdecl OnJoinChat(WPARAM,LPARAM);
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp
index 036dc41d6f..36b85b01dd 100644
--- a/protocols/Omegle/src/proto.cpp
+++ b/protocols/Omegle/src/proto.cpp
@@ -36,8 +36,6 @@ OmegleProto::OmegleProto(const char* proto_name, const wchar_t* username) :
CreateProtoService(PS_JOINCHAT, &OmegleProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &OmegleProto::OnLeaveChat);
- CreateProtoService(PS_CREATEACCMGRUI, &OmegleProto::SvcCreateAccMgrUI);
-
HookProtoEvent(ME_OPT_INITIALISE, &OmegleProto::OnOptionsInit);
HookProtoEvent(ME_GC_EVENT, &OmegleProto::OnChatEvent);
@@ -136,10 +134,9 @@ int OmegleProto::SetStatus(int new_status)
//////////////////////////////////////////////////////////////////////////////
// EVENTS
-INT_PTR OmegleProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow OmegleProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- return (INT_PTR)CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_OmegleACCOUNT),
- (HWND)lParam, OmegleAccountProc, (LPARAM)this);
+ return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_OmegleACCOUNT), hwndParent, OmegleAccountProc, (LPARAM)this);
}
void OmegleProto::OnShutdown()
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h
index c1a0c5dcfa..da10733393 100644
--- a/protocols/Omegle/src/proto.h
+++ b/protocols/Omegle/src/proto.h
@@ -54,11 +54,9 @@ public:
int UserIsTyping(MCONTACT hContact, int type) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnShutdown() override;
- // Services
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
-
// Events
int __cdecl OnOptionsInit(WPARAM, LPARAM);
diff --git a/protocols/SkypeWeb/src/skype_options.cpp b/protocols/SkypeWeb/src/skype_options.cpp
index 07f15c215a..358440dd1f 100644
--- a/protocols/SkypeWeb/src/skype_options.cpp
+++ b/protocols/SkypeWeb/src/skype_options.cpp
@@ -82,12 +82,12 @@ public:
/////////////////////////////////////////////////////////////////////////////////
-INT_PTR CSkypeProto::OnAccountManagerInit(WPARAM, LPARAM lParam)
+MWindow CSkypeProto::OnCreateAccMgrUI(MWindow hwndParent)
{
auto *pDlg = new CSkypeOptionsMain(this, IDD_ACCOUNT_MANAGER);
- pDlg->SetParent(HWND(lParam));
+ pDlg->SetParent(hwndParent);
pDlg->Show();
- return (INT_PTR)pDlg->GetHwnd();
+ return pDlg->GetHwnd();
}
int CSkypeProto::OnOptionsInit(WPARAM wParam, LPARAM)
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 5a70b171a8..8bf269e682 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -38,7 +38,6 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :
nlu.szSettingsModule = m_szModuleName;
m_hNetlibUser = Netlib_RegisterUser(&nlu);
- CreateProtoService(PS_CREATEACCMGRUI, &CSkypeProto::OnAccountManagerInit);
CreateProtoService(PS_GETAVATARINFO, &CSkypeProto::SvcGetAvatarInfo);
CreateProtoService(PS_GETAVATARCAPS, &CSkypeProto::SvcGetAvatarCaps);
CreateProtoService(PS_GETMYAVATAR, &CSkypeProto::SvcGetMyAvatar);
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index f2d9c467ac..8a48e595dc 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -69,6 +69,7 @@ public:
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
void OnShutdown() override;
@@ -186,8 +187,6 @@ private:
EventHandle m_hTrouterHealthEvent;
- INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
-
INT_PTR __cdecl SvcGetAvatarInfo(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetMyAvatar(WPARAM, LPARAM);
diff --git a/protocols/Steam/src/steam_options.cpp b/protocols/Steam/src/steam_options.cpp
index c59d90e9bb..bbfa7311cd 100644
--- a/protocols/Steam/src/steam_options.cpp
+++ b/protocols/Steam/src/steam_options.cpp
@@ -60,11 +60,11 @@ public:
}
};
-INT_PTR CSteamProto::OnAccountManagerInit(WPARAM, LPARAM lParam)
+MWindow CSteamProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- auto *page = new CSteamOptionsMain(this, IDD_ACCMGR, (HWND)lParam);
+ auto *page = new CSteamOptionsMain(this, IDD_ACCMGR, hwndParent);
page->Show();
- return (INT_PTR)page->GetHwnd();
+ return page->GetHwnd();
}
/////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 8a2959f84a..5f42e3ebe2 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -4,8 +4,6 @@ CSteamProto::CSteamProto(const char *protoName, const wchar_t *userName) :
PROTO<CSteamProto>(protoName, userName),
m_requestQueue(1), hAuthProcess(1), hMessageProcess(1)
{
- CreateProtoService(PS_CREATEACCMGRUI, &CSteamProto::OnAccountManagerInit);
-
m_hRequestsQueueEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
// default group
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 4c72b97c57..b6605e50e3 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -106,6 +106,7 @@ public:
int UserIsTyping(MCONTACT hContact, int type) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnModulesLoaded() override;
// menus
@@ -236,7 +237,6 @@ protected:
// events
int __cdecl OnIdleChanged(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam);
// utils
static uint16_t SteamToMirandaStatus(PersonaState state);
diff --git a/protocols/Telegram/src/options.cpp b/protocols/Telegram/src/options.cpp
index 0604f8dc0d..5f8719da69 100644
--- a/protocols/Telegram/src/options.cpp
+++ b/protocols/Telegram/src/options.cpp
@@ -167,12 +167,12 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR CTelegramProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent)
+MWindow CTelegramProto::OnCreateAccMgrUI(MWindow hwndParent)
{
auto *pDlg = new COptionsDlg(this, IDD_ACCMGRUI, false);
- pDlg->SetParent((HWND)hwndParent);
+ pDlg->SetParent(hwndParent);
pDlg->Create();
- return (INT_PTR)pDlg->GetHwnd();
+ return pDlg->GetHwnd();
}
int CTelegramProto::OnOptionsInit(WPARAM wParam, LPARAM)
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 2ed51339d7..3ac7dcb924 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -49,7 +49,6 @@ CTelegramProto::CTelegramProto(const char* protoName, const wchar_t* userName) :
{
m_iOwnId = _atoi64(getMStringA(DBKEY_ID));
- CreateProtoService(PS_CREATEACCMGRUI, &CTelegramProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETAVATARCAPS, &CTelegramProto::SvcGetAvatarCaps);
CreateProtoService(PS_GETAVATARINFO, &CTelegramProto::SvcGetAvatarInfo);
CreateProtoService(PS_GETMYAVATAR, &CTelegramProto::SvcGetMyAvatar);
@@ -169,7 +168,7 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
- return PF1_IM | PF1_FILE | PF1_CHAT | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_MODEMSGRECV;
+ return PF1_IM | PF1_FILE | PF1_CHAT | PF1_EXTSEARCH | PF1_ADDSEARCHRES | PF1_MODEMSGRECV | PF1_SERVERCLIST;
case PFLAGNUM_2:
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY;
case PFLAGNUM_4:
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 1585f9d62d..2c0fe18116 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -238,18 +238,15 @@ public:
INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
- int SendMsg(MCONTACT hContact, int flags, const char *pszMessage) override;
- int SetStatus(int iNewStatus) override;
-
- void OnContactDeleted(MCONTACT hContact) override;
- void OnMarkRead(MCONTACT, MEVENT) override;
- void OnModulesLoaded() override;
- void OnShutdown() override;
- void OnErase() override;
-
- // Services //////////////////////////////////////////////////////////////////////////
-
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
+ int SendMsg(MCONTACT hContact, int flags, const char *pszMessage) override;
+ int SetStatus(int iNewStatus) override;
+
+ void OnContactDeleted(MCONTACT hContact) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
+ void OnMarkRead(MCONTACT, MEVENT) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
+ void OnErase() override;
// Events ////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp
index b4c7f62c4d..352707ecc1 100644
--- a/protocols/Tox/src/tox_accounts.cpp
+++ b/protocols/Tox/src/tox_accounts.cpp
@@ -15,7 +15,7 @@ int CToxProto::OnAccountRenamed(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR CToxProto::OnAccountManagerInit(WPARAM, LPARAM lParam)
+MWindow CToxProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- return (INT_PTR)(CToxOptionsMain::CreateAccountManagerPage(this, (HWND)lParam))->GetHwnd();
+ return (CToxOptionsMain::CreateAccountManagerPage(this, hwndParent))->GetHwnd();
}
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index 7a231ef89d..4d29655855 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -15,8 +15,6 @@ CToxProto::CToxProto(const char* protoName, const wchar_t* userName)
if (m_defaultGroup == nullptr)
m_defaultGroup = mir_wstrdup(L"Tox");
- CreateProtoService(PS_CREATEACCMGRUI, &CToxProto::OnAccountManagerInit);
-
setAllContactStatuses(ID_STATUS_OFFLINE);
// avatars
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index 22efa4f6e1..2a6e485932 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -48,6 +48,7 @@ public:
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnErase() override;
void OnModulesLoaded() override;
@@ -117,8 +118,6 @@ private:
// accounts
int __cdecl OnAccountRenamed(WPARAM, LPARAM);
- INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
-
// netlib
void InitNetlib();
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index aadfb416a2..3cf8a955dd 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -27,8 +27,6 @@ CTwitterProto::CTwitterProto(const char *proto_name, const wchar_t *username) :
PROTO<CTwitterProto>(proto_name, username),
m_arChatMarks(10, NumericKeySortT)
{
- CreateProtoService(PS_CREATEACCMGRUI, &CTwitterProto::SvcCreateAccMgrUI);
-
CreateProtoService(PS_JOINCHAT, &CTwitterProto::OnJoinChat);
CreateProtoService(PS_LEAVECHAT, &CTwitterProto::OnLeaveChat);
@@ -181,9 +179,9 @@ int CTwitterProto::SetStatus(int new_status)
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR CTwitterProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow CTwitterProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- return (INT_PTR)CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_TWITTERACCOUNT), (HWND)lParam, first_run_dialog, (LPARAM)this);
+ return CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_TWITTERACCOUNT), hwndParent, first_run_dialog, (LPARAM)this);
}
INT_PTR CTwitterProto::ReplyToTweet(WPARAM wParam, LPARAM)
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h
index d545f409db..544c08d9a7 100644
--- a/protocols/Twitter/src/proto.h
+++ b/protocols/Twitter/src/proto.h
@@ -167,6 +167,7 @@ public:
HANDLE GetAwayMsg(MCONTACT) override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
@@ -175,7 +176,6 @@ public:
//////////////////////////////////////////////////////////////////////////////////////
// Services
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM,LPARAM);
INT_PTR __cdecl ReplyToTweet(WPARAM,LPARAM);
INT_PTR __cdecl VisitHomepage(WPARAM,LPARAM);
INT_PTR __cdecl GetAvatar(WPARAM,LPARAM);
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index 8342842cd3..3c80b825e8 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -74,11 +74,11 @@ public:
}
};
-INT_PTR CVkProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
+MWindow CVkProto::OnCreateAccMgrUI(MWindow hwndParent)
{
- CVkAccMgrForm *dlg = new CVkAccMgrForm(this, (HWND)lParam);
+ CVkAccMgrForm *dlg = new CVkAccMgrForm(this, hwndParent);
dlg->Show();
- return (INT_PTR)dlg->GetHwnd();
+ return dlg->GetHwnd();
}
////////////////////// Options ///////////////////////////////////////////////
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 9e7a621593..78ccaf1bf8 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -48,7 +48,6 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *pwszUserName) :
InitQueue();
CheckUpdate();
- CreateProtoService(PS_CREATEACCMGRUI, &CVkProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETAVATARINFO, &CVkProto::SvcGetAvatarInfo);
CreateProtoService(PS_GETAVATARCAPS, &CVkProto::SvcGetAvatarCaps);
CreateProtoService(PS_GETMYAVATAR, &CVkProto::SvcGetMyAvatar);
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 4c9cb67a08..2ee40961f3 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -69,6 +69,7 @@ struct CVkProto : public PROTO<CVkProto>
void OnBuildProtoMenu() override;
void OnContactDeleted(MCONTACT) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
void OnShutdown() override;
@@ -81,7 +82,6 @@ struct CVkProto : public PROTO<CVkProto>
//==== Services ======================================================================
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetAvatarInfo(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetAvatarCaps(WPARAM, LPARAM);
INT_PTR __cdecl SvcGetMyAvatar(WPARAM, LPARAM);
diff --git a/protocols/WhatsApp/src/options.cpp b/protocols/WhatsApp/src/options.cpp
index 86cffde83b..073ac02d49 100644
--- a/protocols/WhatsApp/src/options.cpp
+++ b/protocols/WhatsApp/src/options.cpp
@@ -71,12 +71,12 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR WhatsAppProto::SvcCreateAccMgrUI(WPARAM, LPARAM hwndParent)
+MWindow WhatsAppProto::OnCreateAccMgrUI(MWindow hwndParent)
{
auto *pDlg = new COptionsDlg(this, IDD_ACCMGRUI, false);
- pDlg->SetParent((HWND)hwndParent);
+ pDlg->SetParent(hwndParent);
pDlg->Create();
- return (INT_PTR)pDlg->GetHwnd();
+ return pDlg->GetHwnd();
}
int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM)
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index 1c2e0a7142..be3526d996 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -58,8 +58,6 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) :
{
db_set_resident(m_szModuleName, "StatusMsg");
- CreateProtoService(PS_CREATEACCMGRUI, &WhatsAppProto::SvcCreateAccMgrUI);
-
CreateProtoService(PS_GETAVATARINFO, &WhatsAppProto::GetAvatarInfo);
CreateProtoService(PS_GETAVATARCAPS, &WhatsAppProto::GetAvatarCaps);
CreateProtoService(PS_GETMYAVATAR, &WhatsAppProto::GetMyAvatar);
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 4edc296d3f..942ab8d862 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -464,13 +464,10 @@ public:
int SetStatus(int iNewStatus) override;
int UserIsTyping(MCONTACT hContact, int type) override;
+ MWindow OnCreateAccMgrUI(MWindow) override;
void OnErase() override;
void OnModulesLoaded() override;
- // Services ////////////////////////////////////////////////////////////////////////////
-
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
-
// Events //////////////////////////////////////////////////////////////////////////////
int __cdecl OnOptionsInit(WPARAM, LPARAM);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 208d93904c..bca07ef01d 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -819,3 +819,4 @@ Srmm_CreateHotkey @886 NONAME
?Chat_Control@@YGHPBDH@Z @934 NONAME
?UpdateChatLog@CSrmmBaseDialog@@IAEXXZ @935 NONAME
?OnMarkRead@PROTO_INTERFACE@@UAEXII@Z @936 NONAME
+?OnCreateAccMgrUI@PROTO_INTERFACE@@UAEPAUHWND__@@PAU2@@Z @937 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 451d75680a..b1ec756b7f 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -819,3 +819,4 @@ Srmm_CreateHotkey @886 NONAME
?Chat_Control@@YAHPEBDH@Z @934 NONAME
?UpdateChatLog@CSrmmBaseDialog@@IEAAXXZ @935 NONAME
?OnMarkRead@PROTO_INTERFACE@@UEAAXII@Z @936 NONAME
+?OnCreateAccMgrUI@PROTO_INTERFACE@@UEAAPEAUHWND__@@PEAU2@@Z @937 NONAME
diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp
index 96c155a9a9..16718039f7 100644
--- a/src/mir_app/src/proto_interface.cpp
+++ b/src/mir_app/src/proto_interface.cpp
@@ -74,6 +74,11 @@ void PROTO_INTERFACE::OnContactAdded(MCONTACT)
void PROTO_INTERFACE::OnContactDeleted(MCONTACT)
{}
+MWindow PROTO_INTERFACE::OnCreateAccMgrUI(MWindow)
+{
+ return nullptr; // error
+}
+
void PROTO_INTERFACE::OnEventEdited(MCONTACT, MEVENT)
{}
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index c2dfe73e72..68e2d71658 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -202,12 +202,11 @@ class CAccountManagerDlg : public CDlgBase
SetDlgItemText(m_hwnd, IDC_TXT_INFO, TranslateT("Account is disabled. Please activate it to access options."));
}
else {
- HWND hwnd = (HWND)CallProtoService(pa->szModuleName, PS_CREATEACCMGRUI, 0, (LPARAM)m_hwnd);
- if (hwnd && (hwnd != (HWND)CALLSERVICE_NOTFOUND)) {
- RECT rc;
-
+ MWindow hwnd = pa->ppro->OnCreateAccMgrUI(m_hwnd);
+ if (hwnd) {
ShowWindow(GetDlgItem(m_hwnd, IDC_TXT_INFO), SW_HIDE);
+ RECT rc;
GetWindowRect(GetDlgItem(m_hwnd, IDC_TXT_INFO), &rc);
MapWindowPoints(nullptr, m_hwnd, (LPPOINT)&rc, 2);
SetWindowPos(hwnd, m_accList.GetHwnd(), rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);