summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/userprefs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src/userprefs.cpp')
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index c210ebecc5..d8c947e8f8 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -397,7 +397,7 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
//
// @return LRESULT (ignored for dialog procs, use DWLP_MSGRESULT)
-INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
HWND hwndTab = GetDlgItem(hwndDlg, IDC_OPTIONSTAB);
@@ -498,3 +498,17 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
return FALSE;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// service function. Invokes the user preferences dialog for the contact given (by handle) in wParam
+
+INT_PTR SetUserPrefs(WPARAM wParam, LPARAM)
+{
+ HWND hWnd = WindowList_Find(PluginConfig.hUserPrefsWindowList, wParam);
+ if (hWnd) {
+ SetForegroundWindow(hWnd); // already open, bring it to front
+ return 0;
+ }
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_USERPREFS_FRAME), nullptr, DlgProcUserPrefsFrame, (LPARAM)wParam);
+ return 0;
+}