diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-19 12:50:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-19 12:50:25 +0000 |
commit | 24a39515399e9555dd0e4ad72b7a22f9152b0adf (patch) | |
tree | 3577b4bf1442497133aa1646bdb3443950ed0cef /plugins/CrashDumper/src | |
parent | 400d7bb71630f774dc9392cad37a22528958e2bc (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.h | 1 | ||||
-rw-r--r-- | plugins/CrashDumper/src/ui.cpp | 82 |
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;
|