summaryrefslogtreecommitdiff
path: root/plugins/CrashDumper/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/CrashDumper/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/CrashDumper/src')
-rw-r--r--plugins/CrashDumper/src/stdafx.h1
-rw-r--r--plugins/CrashDumper/src/ui.cpp82
2 files changed, 41 insertions, 42 deletions
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h
index ff77ceff81..a99afa3317 100644
--- a/plugins/CrashDumper/src/stdafx.h
+++ b/plugins/CrashDumper/src/stdafx.h
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <windows.h>
+#include <windowsx.h>
#include <richedit.h>
#include <delayimp.h>
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp
index 7050771388..b96870a9ea 100644
--- a/plugins/CrashDumper/src/ui.cpp
+++ b/plugins/CrashDumper/src/ui.cpp
@@ -102,12 +102,12 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case WM_GETMINMAXINFO:
- {
- LPMINMAXINFO mmi = (LPMINMAXINFO)lParam;
- mmi->ptMinTrackSize.x = 400; // The minimum width in points
- mmi->ptMinTrackSize.y = 300; // The minimum height in points
- }
- break;
+ {
+ LPMINMAXINFO mmi = (LPMINMAXINFO)lParam;
+ mmi->ptMinTrackSize.x = 400; // The minimum width in points
+ mmi->ptMinTrackSize.y = 300; // The minimum height in points
+ }
+ break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
@@ -126,44 +126,42 @@ INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
break;
case WM_CONTEXTMENU:
- {
- HWND hView = GetDlgItem(hwndDlg, IDC_VIEWVERSIONINFO);
- GetWindowRect(hView, &rc);
-
- POINT pt;
- pt.x = LOWORD(lParam);
- pt.y = HIWORD(lParam);
- if (PtInRect(&rc, pt)) {
- static const CHARRANGE all = { 0, -1 };
-
- HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
- HMENU hSubMenu = GetSubMenu(hMenu, 0);
- TranslateMenu(hSubMenu);
-
- CHARRANGE sel;
- SendMessage(hView, EM_EXGETSEL, 0, (LPARAM)&sel);
- if (sel.cpMin == sel.cpMax)
- EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
-
- switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) {
- case IDM_COPY:
- SendMessage(hView, WM_COPY, 0, 0);
- break;
-
- case IDM_COPYALL:
- SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
- SendMessage(hView, WM_COPY, 0, 0);
- SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&sel);
- break;
-
- case IDM_SELECTALL:
- SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
- break;
+ {
+ HWND hView = GetDlgItem(hwndDlg, IDC_VIEWVERSIONINFO);
+ GetWindowRect(hView, &rc);
+
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ if (PtInRect(&rc, pt)) {
+ static const CHARRANGE all = { 0, -1 };
+
+ HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
+ HMENU hSubMenu = GetSubMenu(hMenu, 0);
+ TranslateMenu(hSubMenu);
+
+ CHARRANGE sel;
+ SendMessage(hView, EM_EXGETSEL, 0, (LPARAM)&sel);
+ if (sel.cpMin == sel.cpMax)
+ EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED);
+
+ switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) {
+ case IDM_COPY:
+ SendMessage(hView, WM_COPY, 0, 0);
+ break;
+
+ case IDM_COPYALL:
+ SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
+ SendMessage(hView, WM_COPY, 0, 0);
+ SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&sel);
+ break;
+
+ case IDM_SELECTALL:
+ SendMessage(hView, EM_EXSETSEL, 0, (LPARAM)&all);
+ break;
+ }
+ DestroyMenu(hMenu);
}
- DestroyMenu(hMenu);
}
- }
- break;
+ break;
case WM_DESTROY:
hViewWnd = NULL;