diff options
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;
|