summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/calendartool.cpp11
-rw-r--r--plugins/NewStory/src/fonts.cpp158
-rw-r--r--plugins/NewStory/src/fonts.h13
-rw-r--r--plugins/NewStory/src/history.cpp12
-rw-r--r--plugins/NewStory/src/history.h4
-rw-r--r--plugins/NewStory/src/history_control.cpp2
-rw-r--r--plugins/NewStory/src/opt_passwords.cpp2
-rw-r--r--plugins/NewStory/src/opt_passwords.h2
-rw-r--r--plugins/NewStory/src/options.cpp4
-rw-r--r--plugins/NewStory/src/password.cpp16
-rw-r--r--plugins/NewStory/src/templates.cpp2
-rw-r--r--plugins/NewStory/src/templates.h2
12 files changed, 100 insertions, 128 deletions
diff --git a/plugins/NewStory/src/calendartool.cpp b/plugins/NewStory/src/calendartool.cpp
index f45e125bcc..64e837e913 100644
--- a/plugins/NewStory/src/calendartool.cpp
+++ b/plugins/NewStory/src/calendartool.cpp
@@ -5,15 +5,15 @@ struct CalendarToolData
int x, y;
};
-int CALLBACK CalendarToolDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK CalendarToolDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- CalendarToolData *data = (CalendarToolData *)GetWindowLong(hwnd, GWL_USERDATA);
+ CalendarToolData *data = (CalendarToolData *)GetWindowLong(hwnd, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
{
data = (CalendarToolData *)lParam;
- SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LONG)data);
// This causes ALL miranda dialogs to have drop-shadow enabled. That's bad =(
// SetClassLong(hwnd, GCL_STYLE, GetClassLong(hwnd, GCL_STYLE)|CS_DROPSHADOW);
@@ -73,7 +73,7 @@ int CALLBACK CalendarToolDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
{
delete data;
data = 0;
- SetWindowLong(hwnd, GWL_USERDATA, 0);
+ SetWindowLong(hwnd, GWLP_USERDATA, 0);
}
}
return FALSE;
@@ -84,8 +84,5 @@ time_t CalendarTool_Show(HWND hwnd, int x, int y)
CalendarToolData *data = new CalendarToolData;
data->x = x;
data->y = y;
-
-// HWND hwndTool = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CALENDARTOOL), 0, CalendarToolDlgProc, (LPARAM)data);
-// ShowWindow(hwndTool, SW_SHOWNORMAL);
return DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CALENDARTOOL), 0, CalendarToolDlgProc, (LPARAM)data);
} \ No newline at end of file
diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp
index 0db756187b..515665fa57 100644
--- a/plugins/NewStory/src/fonts.cpp
+++ b/plugins/NewStory/src/fonts.cpp
@@ -1,119 +1,95 @@
#include "stdafx.h"
-MyColourID colors[] =
+MyColourID colors[] =
{
- {0, {MODULETITLE, "Incoming Messages", MODULENAME, "ColorMsgIn", 0, RGB(0xff, 0xff, 0xff), 0}},
- {0, {MODULETITLE, "Outgoing Messages", MODULENAME, "ColorMsgOut", 0, RGB(0xff, 0xff, 0xff), 1}},
-
- {0, {MODULETITLE, "Incoming Files", MODULENAME, "ColorFileIn", 0, RGB(0xff, 0xff, 0xff), 2}},
- {0, {MODULETITLE, "Outgoing Files", MODULENAME, "ColorFileOut", 0, RGB(0xff, 0xff, 0xff), 3}},
-
- {0, {MODULETITLE, "Incoming URLs", MODULENAME, "ColorURLIn", 0, RGB(0xff, 0xff, 0xff), 4}},
- {0, {MODULETITLE, "Outgoing URLs", MODULENAME, "ColorURLOut", 0, RGB(0xff, 0xff, 0xff), 5}},
-
- {0, {MODULETITLE, "Status changes", MODULENAME, "ColorStatus", 0, RGB(0xff, 0xff, 0xff), 6}},
-
- {0, {MODULETITLE, "Other Outgoing Events", MODULENAME, "ColorOut", 0, RGB(0xff, 0xff, 0xff), 7}},
- {0, {MODULETITLE, "Other Incoming Events", MODULENAME, "ColorIn", 0, RGB(0xff, 0xff, 0xff), 8}},
-
- {0, {MODULETITLE, "Selected Items", MODULENAME, "ColorSel", 0, RGB(0x60, 0x60, 0x60), 9}},
- {0, {MODULETITLE, "Selected Items (Text)", MODULENAME, "ColorSelTxt", 0, RGB(0xff, 0xff, 0xff), 10}}
+ { "Incoming Messages", "ColorMsgIn", RGB(0xff, 0xff, 0xff) },
+ { "Outgoing Messages", "ColorMsgOut", RGB(0xff, 0xff, 0xff) },
+
+ { "Incoming Files", "ColorFileIn", RGB(0xff, 0xff, 0xff) },
+ { "Outgoing Files", "ColorFileOut", RGB(0xff, 0xff, 0xff) },
+
+ { "Incoming URLs", "ColorURLIn", RGB(0xff, 0xff, 0xff) },
+ { "Outgoing URLs", "ColorURLOut", RGB(0xff, 0xff, 0xff) },
+
+ { "Status changes", "ColorStatus", RGB(0xff, 0xff, 0xff) },
+
+ { "Other Outgoing Events", "ColorOut", RGB(0xff, 0xff, 0xff) },
+ { "Other Incoming Events", "ColorIn", RGB(0xff, 0xff, 0xff) },
+
+ { "Selected Items", "ColorSel", RGB(0x60, 0x60, 0x60) },
+ { "Selected Items (Text)", "ColorSelTxt", RGB(0xff, 0xff, 0xff) }
};
-MyFontID fonts[] =
+MyFontID fonts[] =
{
- {0, 0, 0, {MODULETITLE, "Incoming Messages", MODULENAME, "FontMsgIn", 0, {0}, 0}},
- {0, 0, 0, {MODULETITLE, "Outgoing Messages", MODULENAME, "FontMsgOut", 0, {0}, 1}},
-
- {0, 0, 0, {MODULETITLE, "Incoming Files", MODULENAME, "FontFileIn", 0, {0}, 2}},
- {0, 0, 0, {MODULETITLE, "Outgoing Files", MODULENAME, "FontFileOut", 0, {0}, 3}},
+ { "Incoming Messages", "FontMsgIn" },
+ { "Outgoing Messages", "FontMsgOut" },
- {0, 0, 0, {MODULETITLE, "Incoming URLs", MODULENAME, "FontURLIn", 0, {0}, 4}},
- {0, 0, 0, {MODULETITLE, "Outgoing URLs", MODULENAME, "FontURLOut", 0, {0}, 5}},
+ { "Incoming Files", "FontFileIn" },
+ { "Outgoing Files", "FontFileOut" },
- {0, 0, 0, {MODULETITLE, "Status changes", MODULENAME, "FontStatus", 0, {0}, 6}},
+ { "Incoming URLs", "FontURLIn" },
+ { "Outgoing URLs", "FontURLOut" },
- {0, 0, 0, {MODULETITLE, "Other Outgoing Events", MODULENAME, "FontOut", 0, {0}, 7}},
- {0, 0, 0, {MODULETITLE, "Other Incoming Events", MODULENAME, "FontIn", 0, {0}, 8}}
+ { "Status changes", "FontStatus" },
-// {sizeof(FontID), MODULETITLE, "Default Text", MODULENAME, "FontDef", FIDF_SAVEPOINTSIZE, {0}, 0},
-// {sizeof(FontID), MODULETITLE, "Selected Item", MODULENAME, "FontSel", FIDF_SAVEPOINTSIZE, {0}, 1}
+ { "Other Outgoing Events", "FontOut" },
+ { "Other Incoming Events", "FontIn" }
};
int evtFontsChanged(WPARAM, LPARAM)
{
- int i;
- for (i = 0; i < COLOR_COUNT; i++)
- colors[i].cl = Colour_Get(colors[i].info.group, colors[i].info.name);
-
- for (i = 0; i < FONT_COUNT; i++) {
- fonts[i].cl = (COLORREF)Font_Get(fonts[i].info, fonts[i].lf);
- DeleteObject(fonts[i].hfnt);
- fonts[i].hfnt = CreateFontIndirectA(fonts[i].lf);
+ for (auto &it : colors)
+ it.cl = Colour_Get(MODULENAME, it.szName);
+
+ for (auto &it : fonts) {
+ it.cl = (COLORREF)Font_Get(MODULENAME, it.szName, &it.lf);
+
+ DeleteObject(it.hfnt);
+ it.hfnt = CreateFontIndirectA(&it.lf);
}
-// WindowList_Broadcast(hNewstoryWindows, UM_REDRAWLISTH, 0, 0);
+
+ // WindowList_Broadcast(hNewstoryWindows, UM_REDRAWLISTH, 0, 0);
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
void InitFonts()
{
- bool isFSInstalled = /*ServiceExists(MS_FONT_GET) ? */true/* : false*/;
-
- int i; // damn msvc can't handle for(int i...) correctly! =(
-
HookEvent(ME_FONT_RELOAD, evtFontsChanged);
HookEvent(ME_COLOUR_RELOAD, evtFontsChanged);
- if (isFSInstalled)
- {
- for (i = 0; i < COLOR_COUNT; i++)
- {
- g_plugin.addColor(&colors[i].info);
- colors[i].cl = Colour_Get(colors[i].info.group, colors[i].info.name);
- }
- for (i = 0; i < FONT_COUNT; i++)
- {
- //CallService(MS_FONT_REGISTER, (WPARAM)&fonts[i].info, 0);
- g_plugin.addFont(&fonts[i].info);
- fonts[i].lf = (LOGFONTA *)malloc(sizeof(LOGFONTA));
- fonts[i].cl = (COLORREF)Font_Get(fonts[i].info, fonts[i].lf);
- fonts[i].hfnt = CreateFontIndirectA(fonts[i].lf);
- //MessageBox(0, fonts[i].lf->lfFaceName, _T(""), MB_OK);
- }
- } else
- {
- LOGFONTA lfText = {0};
- lfText.lfHeight = -11;
- lfText.lfWidth = lfText.lfEscapement = lfText.lfOrientation = 0;
- lfText.lfItalic = lfText.lfUnderline = lfText.lfStrikeOut = FALSE;
- lfText.lfCharSet = DEFAULT_CHARSET;
- lfText.lfOutPrecision = OUT_DEFAULT_PRECIS;
- lfText.lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lfText.lfQuality = DEFAULT_QUALITY;
- lfText.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
- lstrcpyA(lfText.lfFaceName, "MS Shell Dlg");
- lfText.lfWeight = FW_REGULAR;
-
- for (i = 0; i < COLOR_COUNT; i++)
- {
- colors[i].cl = colors[i].info.defcolour;
- }
- for (i = 0; i < FONT_COUNT; i++)
- {
- fonts[i].lf = (LOGFONTA *)malloc(sizeof(LOGFONTA));
- *fonts[i].lf = lfText;
- fonts[i].cl = RGB(0,0,0);
- fonts[i].hfnt = CreateFontIndirectA(fonts[i].lf);
- }
+ ColourID cid = {};
+ strncpy_s(cid.group, MODULENAME, _TRUNCATE);
+ strncpy_s(cid.dbSettingsGroup, MODULENAME, _TRUNCATE);
+
+ for (auto &it : colors) {
+ cid.order = int(&it - colors);
+ strncpy_s(cid.name, it.szName, _TRUNCATE);
+ strncpy_s(cid.setting, it.szSetting, _TRUNCATE);
+ cid.defcolour = it.defaultValue;
+ g_plugin.addColor(&cid);
+ it.cl = Colour_Get(cid.group, cid.name);
+ }
+
+ FontID fontid = {};
+ strncpy_s(fontid.group, MODULENAME, _TRUNCATE);
+ strncpy_s(fontid.dbSettingsGroup, MODULENAME, _TRUNCATE);
+
+ for (auto &it : fonts) {
+ fontid.order = int(&it - fonts);
+ strncpy_s(fontid.name, it.szName, _TRUNCATE);
+ strncpy_s(fontid.setting, it.szSetting, _TRUNCATE);
+ g_plugin.addFont(&fontid);
+
+ it.cl = Font_Get(MODULENAME, it.szName, &it.lf);
+ it.hfnt = CreateFontIndirectA(&it.lf);
}
}
void DestroyFonts()
{
- int i;
- for (i = 0; i < FONT_COUNT; i++)
- {
- DeleteObject(fonts[i].hfnt);
- free(fonts[i].lf);
- }
-} \ No newline at end of file
+ for (auto &it : fonts)
+ DeleteObject(it.hfnt);
+}
diff --git a/plugins/NewStory/src/fonts.h b/plugins/NewStory/src/fonts.h
index cdb7f426d5..020e61d68a 100644
--- a/plugins/NewStory/src/fonts.h
+++ b/plugins/NewStory/src/fonts.h
@@ -19,8 +19,8 @@ enum
struct MyColourID
{
- COLORREF cl;
- ColourID info;
+ const char *szName, *szSetting;
+ COLORREF defaultValue, cl;
};
extern MyColourID colors[];
@@ -36,17 +36,16 @@ enum
FONT_STATUS,
FONT_INOTHER,
FONT_OUTOTHER,
-// FONT_DEFAULT,
-// FONT_SELECTED,
FONT_COUNT
};
struct MyFontID
{
+ const char *szName, *szSetting;
+
COLORREF cl;
- LOGFONTA *lf;
- HFONT hfnt;
- FontID info;
+ LOGFONTA lf;
+ HFONT hfnt;
};
extern MyFontID fonts[];
diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp
index e02501c219..f853b67299 100644
--- a/plugins/NewStory/src/history.cpp
+++ b/plugins/NewStory/src/history.cpp
@@ -404,16 +404,16 @@ bool ExportHistoryDialog(HANDLE hContact, HWND hwndHistory)
}
*/
-int CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
//CallSnappingWindowProc(hwnd, msg, wParam, lParam);
- WindowData *data = (WindowData *)GetWindowLong(hwnd, GWL_USERDATA);
+ WindowData *data = (WindowData *)GetWindowLong(hwnd, GWLP_USERDATA);
if ((msg >= NSM_FIRST) && (msg < NSM_LAST))
{
int result = SendMessage(GetDlgItem(hwnd, IDC_ITEMS2), msg, wParam, lParam);
- SetWindowLong(hwnd, DWL_MSGRESULT, result);
+ SetWindowLong(hwnd, DWLP_MSGRESULT, result);
return result;
}
@@ -511,7 +511,7 @@ int CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
SendMessage(data->ibTotal.hwndIcoOut, BM_SETCHECK, BST_CHECKED, 0);
data->ibTotal.hwndTxtOut = GetDlgItem(hwnd, IDC_TXT_TOTAL_OUT);
- SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LONG)data);
data->hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_POPUPS));
//CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)data->hMenu, 0);
@@ -1031,7 +1031,7 @@ int CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE; //DefWindowProc(hwnd, msg, wParam, lParam);
}
-int svcShowNewstory(WPARAM wParam, LPARAM lParam)
+INT_PTR svcShowNewstory(WPARAM wParam, LPARAM lParam)
{
HWND hwnd = (HWND)WindowList_Find(hNewstoryWindows, (MCONTACT)wParam);
if (hwnd && IsWindow(hwnd))
@@ -1047,7 +1047,7 @@ int svcShowNewstory(WPARAM wParam, LPARAM lParam)
return 0;
}
-int svcShowSystemNewstory(WPARAM wParam, LPARAM lParam)
+INT_PTR svcShowSystemNewstory(WPARAM wParam, LPARAM lParam)
{
HWND hwnd = (HWND)WindowList_Find(hNewstoryWindows, 0);
if (hwnd && IsWindow(hwnd))
diff --git a/plugins/NewStory/src/history.h b/plugins/NewStory/src/history.h
index 4aa5a05073..cf89af421e 100644
--- a/plugins/NewStory/src/history.h
+++ b/plugins/NewStory/src/history.h
@@ -34,7 +34,7 @@ extern MWindowList hNewstoryWindows;
void InitHistory();
void FreeHistory();
-int svcShowNewstory(WPARAM wParam, LPARAM lParam);
-int svcShowSystemNewstory(WPARAM wParam, LPARAM lParam);
+INT_PTR svcShowNewstory(WPARAM wParam, LPARAM lParam);
+INT_PTR svcShowSystemNewstory(WPARAM wParam, LPARAM lParam);
#endif // __history_h__ \ No newline at end of file
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 02df609ef2..801a578f0f 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -808,7 +808,7 @@ static void BeginEditItem(HWND hwnd, NewstoryListData *data, int index)
TCHAR *text = TplFormatString(tpl, item->hContact, item);
data->hwndEditBox = CreateWindow(_T("EDIT"), text, WS_CHILD|WS_BORDER|ES_READONLY|ES_MULTILINE|ES_AUTOVSCROLL, 0, top, rc.right-rc.left, itemHeight, hwnd, NULL, g_plugin.getInst(), NULL);
- OldEditWndProc = (WNDPROC)SetWindowLong(data->hwndEditBox, GWL_WNDPROC, (LONG)HistoryEditWndProc);
+ OldEditWndProc = (WNDPROC)SetWindowLong(data->hwndEditBox, GWLP_WNDPROC, (LONG)HistoryEditWndProc);
SendMessage(data->hwndEditBox, WM_SETFONT, (WPARAM)fonts[fontid].hfnt, 0);
SendMessage(data->hwndEditBox, EM_SETMARGINS, EC_RIGHTMARGIN, 100);
SendMessage(data->hwndEditBox, EM_SETSEL, 0, (LPARAM) (-1));
diff --git a/plugins/NewStory/src/opt_passwords.cpp b/plugins/NewStory/src/opt_passwords.cpp
index cb59426f3b..e23cdcf0f3 100644
--- a/plugins/NewStory/src/opt_passwords.cpp
+++ b/plugins/NewStory/src/opt_passwords.cpp
@@ -24,7 +24,7 @@ static void ResetListOptions(HWND hwndList)
SetWindowLong(hwndList, GWL_STYLE, GetWindowLong(hwndList, GWL_STYLE) | CLS_SHOWHIDDEN);
}
-BOOL CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HTREEITEM hitmGlobal, hitmMaster;
switch (msg)
diff --git a/plugins/NewStory/src/opt_passwords.h b/plugins/NewStory/src/opt_passwords.h
index f9583c266d..efe7d04793 100644
--- a/plugins/NewStory/src/opt_passwords.h
+++ b/plugins/NewStory/src/opt_passwords.h
@@ -1,6 +1,6 @@
#ifndef __opt_passwords_h__
#define __opt_passwords_h__
-BOOL CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif // __opt_passwords_h__ \ No newline at end of file
diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp
index c968da49e3..0fba7ed390 100644
--- a/plugins/NewStory/src/options.cpp
+++ b/plugins/NewStory/src/options.cpp
@@ -18,7 +18,7 @@ void InitOptions()
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
}
-BOOL CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static int OptionsInitialize(WPARAM wParam, LPARAM lParam)
{
@@ -47,7 +47,7 @@ static void ThemeDialogBackground(HWND hwnd) {
}
}
-BOOL CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
diff --git a/plugins/NewStory/src/password.cpp b/plugins/NewStory/src/password.cpp
index 0924037c69..36854d6dfb 100644
--- a/plugins/NewStory/src/password.cpp
+++ b/plugins/NewStory/src/password.cpp
@@ -53,9 +53,9 @@ void SetPassword(MCONTACT hContact, char *password)
db_set_blob(hContact, MODULENAME, "password", (PBYTE)digest, 16);
}
-int CALLBACK PasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK PasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- PasswordData *data = (PasswordData *)GetWindowLong(hwnd, GWL_USERDATA);
+ PasswordData *data = (PasswordData *)GetWindowLong(hwnd, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
@@ -63,7 +63,7 @@ int CALLBACK PasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
data = new PasswordData;
data->attempt = 0;
data->hContact = (MCONTACT)lParam;
- SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LONG)data);
RECT rc, rcMe;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
@@ -126,7 +126,7 @@ int CALLBACK PasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
delete data;
data = 0;
- SetWindowLong(hwnd, GWL_USERDATA, 0);
+ SetWindowLong(hwnd, GWLP_USERDATA, 0);
}
}
return FALSE;
@@ -148,15 +148,15 @@ bool AskPassword(MCONTACT hContact)
}
-int CALLBACK ChangePasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK ChangePasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- MCONTACT hContact = (MCONTACT)GetWindowLong(hwnd, GWL_USERDATA);
+ MCONTACT hContact = (MCONTACT)GetWindowLong(hwnd, GWLP_USERDATA);
switch (msg)
{
case WM_INITDIALOG:
{
hContact = (MCONTACT)lParam;
- SetWindowLong(hwnd, GWL_USERDATA, (LONG)hContact);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LONG)hContact);
// RECT rc, rcMe;
// SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
@@ -225,7 +225,7 @@ int CALLBACK ChangePasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_DESTROY:
{
- SetWindowLong(hwnd, GWL_USERDATA, 0);
+ SetWindowLong(hwnd, GWLP_USERDATA, 0);
}
}
return FALSE;
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp
index 199b009458..84e72ed00d 100644
--- a/plugins/NewStory/src/templates.cpp
+++ b/plugins/NewStory/src/templates.cpp
@@ -459,7 +459,7 @@ void vfOther(int mode, TemplateVars *vars, HANDLE hContact, HistoryArray::ItemDa
// Option dialog
-BOOL CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int CurrentTemplate;
switch (msg)
diff --git a/plugins/NewStory/src/templates.h b/plugins/NewStory/src/templates.h
index 2b703619f3..d2235b2c2c 100644
--- a/plugins/NewStory/src/templates.h
+++ b/plugins/NewStory/src/templates.h
@@ -71,6 +71,6 @@ void SaveTemplates();
TCHAR *TplFormatString(int tpl, MCONTACT hContact, HistoryArray::ItemData *args);
TCHAR *TplFormatStringEx(int tpl, TCHAR *sztpl, MCONTACT hContact, HistoryArray::ItemData *args);
-BOOL CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK OptTemplatesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
#endif // __templates_h__ \ No newline at end of file