diff options
-rw-r--r-- | plugins/MyDetails/data.cpp | 2 | ||||
-rw-r--r-- | plugins/MyDetails/data.h | 2 | ||||
-rw-r--r-- | plugins/MyDetails/frame.cpp | 62 | ||||
-rw-r--r-- | plugins/MyDetails/frame.h | 6 | ||||
-rw-r--r-- | plugins/MyDetails/mydetails.cpp | 68 | ||||
-rw-r--r-- | plugins/MyDetails/options.cpp | 62 | ||||
-rw-r--r-- | plugins/MyDetails/options.h | 4 |
7 files changed, 93 insertions, 113 deletions
diff --git a/plugins/MyDetails/data.cpp b/plugins/MyDetails/data.cpp index e04105a7d9..63892b0785 100644 --- a/plugins/MyDetails/data.cpp +++ b/plugins/MyDetails/data.cpp @@ -123,7 +123,7 @@ Protocol::~Protocol() {
}
-void Protocol::lcopystr(TCHAR *dest, TCHAR *src, int maxlen)
+void Protocol::lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen)
{
if (lstrcmp(dest, src) != 0)
{
diff --git a/plugins/MyDetails/data.h b/plugins/MyDetails/data.h index 3ae7b024e5..4f3a560ce9 100644 --- a/plugins/MyDetails/data.h +++ b/plugins/MyDetails/data.h @@ -34,7 +34,7 @@ protected: bool can_have_listening_to;
int PF3;
- void lcopystr(TCHAR *dest, TCHAR *src, int maxlen);
+ void lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen);
public:
// Name of protocol
diff --git a/plugins/MyDetails/frame.cpp b/plugins/MyDetails/frame.cpp index baa3928689..03aecc7664 100644 --- a/plugins/MyDetails/frame.cpp +++ b/plugins/MyDetails/frame.cpp @@ -87,10 +87,10 @@ void RedrawFrame(); // used when no multiwindow functionality available
bool MyDetailsFrameVisible();
void SetMyDetailsFrameVisible(bool visible);
-int ShowHideMenuFunc(WPARAM wParam, LPARAM lParam);
-int ShowFrameFunc(WPARAM wParam, LPARAM lParam);
-int HideFrameFunc(WPARAM wParam, LPARAM lParam);
-int ShowHideFrameFunc(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowHideMenuFunc(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowFrameFunc(WPARAM wParam, LPARAM lParam);
+INT_PTR HideFrameFunc(WPARAM wParam, LPARAM lParam);
+INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam);
@@ -323,7 +323,7 @@ int CreateFrame() WS_CHILD | WS_VISIBLE,
0,0,10,10, hwnd_container, NULL, hInst, NULL);
- SetWindowLong(hwnd_container, GWL_USERDATA, (LONG)hwnd_frame);
+ SetWindowLong(hwnd_container, GWLP_USERDATA, (LONG)hwnd_frame);
SendMessage(hwnd_container, WM_SIZE, 0, 0);
// Create menu item
@@ -380,7 +380,7 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP case WM_ERASEBKGND:
{
- HWND child = (HWND)GetWindowLong(hwnd, GWL_USERDATA);
+ HWND child = (HWND)GetWindowLong(hwnd, GWLP_USERDATA);
SendMessage(child, WM_ERASEBKGND, wParam, lParam);
break;
@@ -388,7 +388,7 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP case WM_SIZE:
{
- HWND child = (HWND)GetWindowLong(hwnd, GWL_USERDATA);
+ HWND child = (HWND)GetWindowLong(hwnd, GWLP_USERDATA);
RECT r;
GetClientRect(hwnd, &r);
@@ -647,7 +647,7 @@ void CalcRectangles(HWND hwnd) {
HDC hdc = GetDC(hwnd);
HFONT hOldFont = (HFONT) GetCurrentObject(hdc, OBJ_FONT);
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
if (hdc == NULL || data == NULL)
return;
@@ -1211,7 +1211,7 @@ void DrawTextWithRect(HDC hdc, const TCHAR *text, const TCHAR *def_text, RECT rc void Draw(HWND hwnd, HDC hdc_orig)
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
Protocol *proto = protocols->Get(data->protocol_number);
if (proto == NULL)
@@ -1727,7 +1727,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
MyDetailsFrameData *data = new MyDetailsFrameData();
ZeroMemory(data, sizeof(MyDetailsFrameData));
- SetWindowLong(hwnd, GWL_USERDATA, (LONG) data);
+ SetWindowLong(hwnd, GWLP_USERDATA, (LONG) data);
data->recalc_rectangles = true;
data->get_status_messages = false;
@@ -1786,7 +1786,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_SIZE:
{
//InvalidateRect(hwnd, NULL, FALSE);
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
data->recalc_rectangles = true;
RedrawFrame();
break;
@@ -1794,7 +1794,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_TIMER:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
if (wParam == ID_FRAME_TIMER)
{
@@ -1830,7 +1830,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_LBUTTONUP:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
Protocol *proto = protocols->Get(data->protocol_number);
if (proto == NULL)
break;
@@ -1947,7 +1947,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_CONTEXTMENU:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
Protocol *proto = protocols->Get(data->protocol_number);
if (proto == NULL)
break;
@@ -2360,7 +2360,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
case WM_NCMOUSEMOVE:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
MakeHover(hwnd, data->draw_img, &data->mouse_over_img, NULL, NULL);
MakeHover(hwnd, data->draw_nick, &data->mouse_over_nick, NULL, NULL);
@@ -2383,7 +2383,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
case WM_MOUSEMOVE:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
Protocol *proto = protocols->Get(data->protocol_number);
if (proto == NULL)
break;
@@ -2411,7 +2411,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar switch (lpnmhdr->code) {
case TTN_GETDISPINFO:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
Protocol *proto = protocols->Get(data->protocol_number);
LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO) lpnmhdr;
@@ -2441,7 +2441,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
KillTimer(hwnd, ID_FRAME_TIMER);
- MyDetailsFrameData *tmp = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *tmp = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
DeleteTooltipWindows(tmp);
if (tmp != NULL) delete tmp;
@@ -2452,7 +2452,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case MWM_REFRESH:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
// data->recalc_rectangles = true;
KillTimer(hwnd, ID_RECALC_TIMER);
@@ -2504,7 +2504,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case MWM_STATUS_MSG_CHANGED:
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd, GWLP_USERDATA);
data->get_status_messages = true;
RefreshFrame();
@@ -2529,7 +2529,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar }
-int ShowHideFrameFunc(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowHideFrameFunc(WPARAM wParam, LPARAM lParam)
{
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
{
@@ -2553,7 +2553,7 @@ int ShowHideFrameFunc(WPARAM wParam, LPARAM lParam) }
-int ShowFrameFunc(WPARAM wParam, LPARAM lParam)
+INT_PTR ShowFrameFunc(WPARAM wParam, LPARAM lParam)
{
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
{
@@ -2576,7 +2576,7 @@ int ShowFrameFunc(WPARAM wParam, LPARAM lParam) }
-int HideFrameFunc(WPARAM wParam, LPARAM lParam)
+INT_PTR HideFrameFunc(WPARAM wParam, LPARAM lParam)
{
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
{
@@ -2615,7 +2615,7 @@ void FixMainMenu() void RedrawFrame()
{
-// MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWL_USERDATA);
+// MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
// if (data != NULL)
// {
// data->recalc_rectangles = true;
@@ -2635,7 +2635,7 @@ void RefreshFrameAndCalcRects() {
if (hwnd_frame != NULL)
{
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
data->recalc_rectangles = true;
PostMessage(hwnd_frame, MWM_REFRESH, 0, 0);
@@ -2693,12 +2693,12 @@ void SetStatusMessageRefreshTime(HWND hwnd) }
}
-int PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam)
+INT_PTR PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam)
{
if (hwnd_frame == NULL)
return -1;
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
data->protocol_number ++;
if (data->protocol_number >= protocols->GetSize())
@@ -2717,12 +2717,12 @@ int PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam) return 0;
}
-int PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam)
+INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam)
{
if (hwnd_frame == NULL)
return -1;
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
data->protocol_number --;
if (data->protocol_number < 0)
@@ -2741,7 +2741,7 @@ int PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam) return 0;
}
-int PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam)
+INT_PTR PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam)
{
char * proto = (char *)lParam;
int proto_num = -1;
@@ -2764,7 +2764,7 @@ int PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam) if (hwnd_frame == NULL)
return -3;
- MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWL_USERDATA);
+ MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
data->protocol_number = proto_num;
DBWriteContactSettingWord(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
diff --git a/plugins/MyDetails/frame.h b/plugins/MyDetails/frame.h index ca314d56d0..5382d3ed46 100644 --- a/plugins/MyDetails/frame.h +++ b/plugins/MyDetails/frame.h @@ -30,9 +30,9 @@ void RefreshFrameAndCalcRects(); void SetCycleTime();
-int PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam);
-int PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam);
-int PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam);
+INT_PTR PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam);
+INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam);
+INT_PTR PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam);
#endif // __FRAME_H__
\ No newline at end of file diff --git a/plugins/MyDetails/mydetails.cpp b/plugins/MyDetails/mydetails.cpp index feb39c6e18..cf93e02065 100644 --- a/plugins/MyDetails/mydetails.cpp +++ b/plugins/MyDetails/mydetails.cpp @@ -53,14 +53,14 @@ static int MainInit(WPARAM wparam,LPARAM lparam); static int MainUninit(WPARAM wParam, LPARAM lParam);
// Services
-static int PluginCommand_SetMyNicknameUI(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_SetMyNickname(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_GetMyNickname(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_SetMyAvatarUI(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_SetMyAvatar(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_GetMyAvatar(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam);
-static int PluginCommand_CicleThroughtProtocols(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_SetMyNicknameUI(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_SetMyNickname(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_GetMyNickname(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_SetMyAvatarUI(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_SetMyAvatar(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam);
+static INT_PTR PluginCommand_CycleThroughtProtocols(WPARAM wParam,LPARAM lParam);
// Functions //////////////////////////////////////////////////////////////////////////////////////
@@ -104,7 +104,7 @@ extern "C" __declspec(dllexport) int Load() CreateServiceFunction(MS_MYDETAILS_SHOWNEXTPROTOCOL, PluginCommand_ShowNextProtocol);
CreateServiceFunction(MS_MYDETAILS_SHOWPREVIOUSPROTOCOL, PluginCommand_ShowPreviousProtocol);
CreateServiceFunction(MS_MYDETAILS_SHOWPROTOCOL, PluginCommand_ShowProtocol);
- CreateServiceFunction(MS_MYDETAILS_CYCLE_THROUGH_PROTOCOLS, PluginCommand_CicleThroughtProtocols);
+ CreateServiceFunction(MS_MYDETAILS_CYCLE_THROUGH_PROTOCOLS, PluginCommand_CycleThroughtProtocols);
return 0;
}
@@ -124,21 +124,21 @@ extern "C" __declspec(dllexport) int Unload(void) DestroyServiceFunction(MS_MYDETAILS_CYCLE_THROUGH_PROTOCOLS);
DeInitProtocolData();
- DeInitOptions();
-
return 0;
}
-static int Menu_SetMyAvatarUI(WPARAM wParam,LPARAM lParam)
+static INT_PTR Menu_SetMyAvatarUI(WPARAM wParam,LPARAM lParam)
{
return PluginCommand_SetMyAvatarUI(0, 0);
}
-static int Menu_SetMyNicknameUI(WPARAM wParam,LPARAM lParam)
+
+static INT_PTR Menu_SetMyNicknameUI(WPARAM wParam,LPARAM lParam)
{
return PluginCommand_SetMyNicknameUI(0, 0);
}
-static int Menu_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam)
+
+static INT_PTR Menu_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam)
{
return PluginCommand_SetMyStatusMessageUI(0, 0);
}
@@ -241,7 +241,7 @@ static int MainUninit(WPARAM wParam, LPARAM lParam) #define WMU_SETDATA (WM_USER+1)
-static BOOL CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch ( msg ) {
case WM_INITDIALOG:
@@ -254,7 +254,7 @@ static BOOL CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, L {
int proto_num = (int)wParam;
- SetWindowLong(hwndDlg, GWL_USERDATA, proto_num);
+ SetWindowLong(hwndDlg, GWLP_USERDATA, proto_num);
if (proto_num == -1) {
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
@@ -309,7 +309,7 @@ static BOOL CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, L TCHAR tmp[MS_MYDETAILS_GETMYNICKNAME_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_NICKNAME, tmp, SIZEOF(tmp));
- int proto_num = (int)GetWindowLong(hwndDlg, GWL_USERDATA);
+ int proto_num = (int)GetWindowLong(hwndDlg, GWLP_USERDATA);
if (proto_num == -1)
protocols->SetNicks(tmp);
else
@@ -336,7 +336,7 @@ static BOOL CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam, L return FALSE;
}
-static int PluginCommand_SetMyNicknameUI(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_SetMyNicknameUI(WPARAM wParam,LPARAM lParam)
{
char *proto = (char*)lParam;
int proto_num = -1;
@@ -373,7 +373,7 @@ static int PluginCommand_SetMyNicknameUI(WPARAM wParam,LPARAM lParam) return 0;
}
-static int PluginCommand_SetMyNickname(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_SetMyNickname(WPARAM wParam,LPARAM lParam)
{
char * proto = (char *)wParam;
if (proto != NULL) {
@@ -394,7 +394,7 @@ static int PluginCommand_SetMyNickname(WPARAM wParam,LPARAM lParam) return 0;
}
-static int PluginCommand_GetMyNickname(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_GetMyNickname(WPARAM wParam,LPARAM lParam)
{
TCHAR* ret = (TCHAR*)lParam;
char * proto = (char *)wParam;
@@ -423,7 +423,7 @@ static int PluginCommand_GetMyNickname(WPARAM wParam,LPARAM lParam) // Set avatar /////////////////////////////////////////////////////////////////////////////////////
-static int PluginCommand_SetMyAvatarUI(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_SetMyAvatarUI(WPARAM wParam,LPARAM lParam)
{
char * proto = (char *)lParam;
int proto_num = -1;
@@ -461,7 +461,7 @@ static int PluginCommand_SetMyAvatarUI(WPARAM wParam,LPARAM lParam) return 0;
}
-static int PluginCommand_SetMyAvatar(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_SetMyAvatar(WPARAM wParam,LPARAM lParam)
{
char *proto = (char*)wParam;
if (proto != NULL) {
@@ -500,7 +500,7 @@ int Status2SkinIcon(int status) return SKINICON_STATUS_OFFLINE;
}
-static int PluginCommand_GetMyAvatar(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_GetMyAvatar(WPARAM wParam,LPARAM lParam)
{
TCHAR* ret = (TCHAR*)lParam;
char * proto = (char *)wParam;
@@ -547,7 +547,7 @@ static LRESULT CALLBACK StatusMsgEditSubclassProc(HWND hwnd, UINT msg, WPARAM wP break;
}
- return CallWindowProc((WNDPROC) GetWindowLong(hwnd, GWL_USERDATA), hwnd, msg, wParam, lParam);
+ return CallWindowProc((WNDPROC) GetWindowLong(hwnd, GWLP_USERDATA), hwnd, msg, wParam, lParam);
}
struct SetStatusMessageData {
@@ -555,7 +555,7 @@ struct SetStatusMessageData { int proto_num;
};
-static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -564,8 +564,8 @@ static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wPar MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE - 1, 0);
{
WNDPROC old_proc = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE),
- GWL_WNDPROC, (LONG) StatusMsgEditSubclassProc);
- SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWL_USERDATA, (long) old_proc);
+ GWLP_WNDPROC, (LONG) StatusMsgEditSubclassProc);
+ SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_USERDATA, (long) old_proc);
}
return TRUE;
@@ -575,7 +575,7 @@ static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wPar data->status = (int)wParam;
data->proto_num = (int)lParam;
- SetWindowLong(hwndDlg, GWL_USERDATA, (LONG) data);
+ SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG) data);
if (data->proto_num >= 0) {
Protocol *proto = protocols->Get(data->proto_num);
@@ -619,7 +619,7 @@ static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wPar TCHAR tmp[MS_MYDETAILS_GETMYSTATUSMESSAGE_BUFFER_SIZE];
GetDlgItemText(hwndDlg, IDC_STATUSMESSAGE, tmp, sizeof(tmp));
- SetStatusMessageData *data = (SetStatusMessageData *) GetWindowLong(hwndDlg, GWL_USERDATA);
+ SetStatusMessageData *data = (SetStatusMessageData *) GetWindowLong(hwndDlg, GWLP_USERDATA);
if (data->proto_num >= 0)
protocols->Get(data->proto_num)->SetStatusMsg(tmp);
@@ -643,9 +643,9 @@ static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wPar break;
case WM_DESTROY:
- SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWL_WNDPROC,
- GetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWL_USERDATA));
- free((SetStatusMessageData *) GetWindowLong(hwndDlg, GWL_USERDATA));
+ SetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_WNDPROC,
+ GetWindowLong(GetDlgItem(hwndDlg, IDC_STATUSMESSAGE), GWLP_USERDATA));
+ free((SetStatusMessageData *) GetWindowLong(hwndDlg, GWLP_USERDATA));
InterlockedExchange(&status_msg_dialog_open, 0);
break;
}
@@ -653,7 +653,7 @@ static BOOL CALLBACK DlgProcSetStatusMessage(HWND hwndDlg, UINT msg, WPARAM wPar return FALSE;
}
-static int PluginCommand_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam)
{
int status = (int)wParam;
char * proto_name = (char *)lParam;
@@ -724,7 +724,7 @@ static int PluginCommand_SetMyStatusMessageUI(WPARAM wParam,LPARAM lParam) }
-static int PluginCommand_CicleThroughtProtocols(WPARAM wParam,LPARAM lParam)
+static INT_PTR PluginCommand_CycleThroughtProtocols(WPARAM wParam,LPARAM lParam)
{
DBWriteContactSettingByte(NULL,"MyDetails","CicleThroughtProtocols", (BYTE) wParam);
diff --git a/plugins/MyDetails/options.cpp b/plugins/MyDetails/options.cpp index 5e4db774cf..10f3823c0b 100644 --- a/plugins/MyDetails/options.cpp +++ b/plugins/MyDetails/options.cpp @@ -21,20 +21,12 @@ Boston, MA 02111-1307, USA. #include "commons.h"
#include "options.h"
-
-
// Prototypes /////////////////////////////////////////////////////////////////////////////////////
Options opts;
-
-static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-
// Functions //////////////////////////////////////////////////////////////////////////////////////
-
-
static OptPageControl pageControls[] = {
{ &opts.cycle_through_protocols, CONTROL_CHECKBOX, IDC_CYCLE_THROUGH_PROTOS, "CicleThroughtProtocols", (BYTE) 1 },
{ &opts.seconds_to_show_protocol, CONTROL_SPIN, IDC_CYCLE_TIME, "CicleTime", (WORD) 5, IDC_CYCLE_TIME_SPIN, (WORD) 1, (WORD) 255 },
@@ -80,37 +72,7 @@ void LoadOptions() RefreshFrameAndCalcRects();
}
-
-int InitOptionsCallback(WPARAM wParam,LPARAM lParam)
-{
- OPTIONSDIALOGPAGE odp = { 0 };
- odp.cbSize = sizeof(odp);
- odp.position = -200000000;
- odp.hInstance = hInst;
- odp.pfnDlgProc = DlgProcOpts;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
- odp.pszGroup = LPGEN("Customize");
- odp.pszTitle = LPGEN("My Details");
- odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wParam, &odp);
- return 0;
-}
-
-
-void InitOptions()
-{
- LoadOptions();
-
- HookEvent(ME_OPT_INITIALISE, InitOptionsCallback);
-}
-
-// Deinitializations needed by options
-void DeInitOptions()
-{
-}
-
-
-static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL ret = SaveOptsDlgProc(pageControls, SIZEOF(pageControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
@@ -193,3 +155,25 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return ret;
}
+
+int InitOptionsCallback(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.cbSize = sizeof(odp);
+ odp.position = -200000000;
+ odp.hInstance = hInst;
+ odp.pfnDlgProc = DlgProcOpts;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS);
+ odp.pszGroup = LPGEN("Customize");
+ odp.pszTitle = LPGEN("My Details");
+ odp.flags = ODPF_BOLDGROUPS;
+ Options_AddPage(wParam, &odp);
+ return 0;
+}
+
+void InitOptions()
+{
+ LoadOptions();
+
+ HookEvent(ME_OPT_INITIALISE, InitOptionsCallback);
+}
diff --git a/plugins/MyDetails/options.h b/plugins/MyDetails/options.h index a17ad13ed5..c8b11ef725 100644 --- a/plugins/MyDetails/options.h +++ b/plugins/MyDetails/options.h @@ -71,10 +71,6 @@ extern Options opts; // Initializations needed by options
void InitOptions();
-// Deinitializations needed by options
-void DeInitOptions();
-
-
// Loads the options from DB
// It don't need to be called, except in some rare cases
void LoadOptions();
|