summaryrefslogtreecommitdiff
path: root/plugins/AvatarHistory/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-19 12:50:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-19 12:50:25 +0000
commit24a39515399e9555dd0e4ad72b7a22f9152b0adf (patch)
tree3577b4bf1442497133aa1646bdb3443950ed0cef /plugins/AvatarHistory/src
parent400d7bb71630f774dc9392cad37a22528958e2bc (diff)
end of zoo with WM_CONTEXTMENU's lParam
git-svn-id: http://svn.miranda-ng.org/main/trunk@13693 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AvatarHistory/src')
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp5
-rw-r--r--plugins/AvatarHistory/src/popup.cpp78
-rw-r--r--plugins/AvatarHistory/src/stdafx.h1
3 files changed, 34 insertions, 50 deletions
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index 1ddb14c113..d94c292e82 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -180,10 +180,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l
int pos;
if ((HANDLE)wParam == hwndList) {
- POINT p;
- p.x = LOWORD(lParam);
- p.y = HIWORD(lParam);
-
+ POINT p = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
ScreenToClient(hwndList, &p);
pos = SendMessage(hwndList, LB_ITEMFROMPOINT, 0, MAKELONG(p.x, p.y));
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp
index 07810669c9..a43da24ef1 100644
--- a/plugins/AvatarHistory/src/popup.cpp
+++ b/plugins/AvatarHistory/src/popup.cpp
@@ -203,39 +203,32 @@ LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
// Handle to popup events
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
+ PopupDataType *popup = (PopupDataType*)PUGetPluginData(hWnd);
+
switch(message) {
- case WM_COMMAND:
- {
- PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
- PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_left_click_action);
+ case WM_COMMAND:
+ PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_left_click_action);
- if (opts.popup_left_click_action != POPUP_ACTION_DONOTHING)
- PUDeletePopup(hWnd);
+ if (opts.popup_left_click_action != POPUP_ACTION_DONOTHING)
+ PUDeletePopup(hWnd);
- return TRUE;
- }
+ return TRUE;
- case WM_CONTEXTMENU:
- {
- PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
- PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_right_click_action);
+ case WM_CONTEXTMENU:
+ PostMessage(hPopupWindow, WMU_ACTION, (WPARAM)popup->plugin_data, opts.popup_right_click_action);
- if (opts.popup_right_click_action != POPUP_ACTION_DONOTHING)
- PUDeletePopup(hWnd);
+ if (opts.popup_right_click_action != POPUP_ACTION_DONOTHING)
+ PUDeletePopup(hWnd);
- return TRUE;
- }
+ return TRUE;
- case UM_FREEPLUGINDATA:
- {
- PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
- if ((INT_PTR)popup != CALLSERVICE_NOTFOUND)
- {
- DestroyIcon(popup->hIcon);
- mir_free(popup);
- }
- return FALSE; //the return value is ignored
+ case UM_FREEPLUGINDATA:
+ PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
+ if ((INT_PTR)popup != CALLSERVICE_NOTFOUND) {
+ DestroyIcon(popup->hIcon);
+ mir_free(popup);
}
+ return FALSE; //the return value is ignored
}
return DefWindowProc(hWnd, message, wParam, lParam);
@@ -246,28 +239,21 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
- case WM_COMMAND:
- {
- PUDeletePopup(hWnd);
- return TRUE;
- }
-
- case WM_CONTEXTMENU:
- {
- PUDeletePopup(hWnd);
- return TRUE;
- }
-
- case UM_FREEPLUGINDATA:
- {
- PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
- if ((INT_PTR)popup != CALLSERVICE_NOTFOUND)
- {
- DestroyIcon(popup->hIcon);
- mir_free(popup);
- }
- return FALSE; //the return value is ignored
+ case WM_COMMAND:
+ PUDeletePopup(hWnd);
+ return TRUE;
+
+ case WM_CONTEXTMENU:
+ PUDeletePopup(hWnd);
+ return TRUE;
+
+ case UM_FREEPLUGINDATA:
+ PopupDataType* popup = (PopupDataType*)PUGetPluginData(hWnd);
+ if ((INT_PTR)popup != CALLSERVICE_NOTFOUND) {
+ DestroyIcon(popup->hIcon);
+ mir_free(popup);
}
+ return FALSE; //the return value is ignored
}
return DefWindowProc(hWnd, message, wParam, lParam);
diff --git a/plugins/AvatarHistory/src/stdafx.h b/plugins/AvatarHistory/src/stdafx.h
index f01d314e9d..2c294ccda7 100644
--- a/plugins/AvatarHistory/src/stdafx.h
+++ b/plugins/AvatarHistory/src/stdafx.h
@@ -1,4 +1,5 @@
#include <windows.h>
+#include <windowsx.h>
#include <time.h>
#include <ShObjIdl.h>
#include <ShlGuid.h>